1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(video): force the use of non-deprecated pixel formats for YUV

This commit is contained in:
initramfs 2016-08-04 23:46:37 +08:00
parent de6475f3d3
commit df3345dce5
No known key found for this signature in database
GPG Key ID: 78B8BDF87E9EF0AF
2 changed files with 7 additions and 7 deletions

View File

@ -93,7 +93,6 @@ VideoFrame::VideoFrame(IDType sourceID, AVFrame* sourceFrame, QRect dimensions,
: frameID(frameIDs++), : frameID(frameIDs++),
sourceID(sourceID), sourceID(sourceID),
sourceDimensions(dimensions), sourceDimensions(dimensions),
sourcePixelFormat(pixFmt),
sourceFrameKey(getFrameKey(dimensions.size(), pixFmt, sourceFrame->linesize[0])), sourceFrameKey(getFrameKey(dimensions.size(), pixFmt, sourceFrame->linesize[0])),
freeSourceFrame(freeSourceFrame) freeSourceFrame(freeSourceFrame)
{ {
@ -103,40 +102,41 @@ VideoFrame::VideoFrame(IDType sourceID, AVFrame* sourceFrame, QRect dimensions,
{ {
case AV_PIX_FMT_YUVJ420P: case AV_PIX_FMT_YUVJ420P:
{ {
pixFmt = AV_PIX_FMT_YUV420P; sourcePixelFormat = AV_PIX_FMT_YUV420P;
sourceFrame->color_range = AVCOL_RANGE_MPEG; sourceFrame->color_range = AVCOL_RANGE_MPEG;
break; break;
} }
case AV_PIX_FMT_YUVJ411P: case AV_PIX_FMT_YUVJ411P:
{ {
pixFmt = AV_PIX_FMT_YUV411P; sourcePixelFormat = AV_PIX_FMT_YUV411P;
sourceFrame->color_range = AVCOL_RANGE_MPEG; sourceFrame->color_range = AVCOL_RANGE_MPEG;
break; break;
} }
case AV_PIX_FMT_YUVJ422P: case AV_PIX_FMT_YUVJ422P:
{ {
pixFmt = AV_PIX_FMT_YUV422P; sourcePixelFormat = AV_PIX_FMT_YUV422P;
sourceFrame->color_range = AVCOL_RANGE_MPEG; sourceFrame->color_range = AVCOL_RANGE_MPEG;
break; break;
} }
case AV_PIX_FMT_YUVJ444P: case AV_PIX_FMT_YUVJ444P:
{ {
pixFmt = AV_PIX_FMT_YUV444P; sourcePixelFormat = AV_PIX_FMT_YUV444P;
sourceFrame->color_range = AVCOL_RANGE_MPEG; sourceFrame->color_range = AVCOL_RANGE_MPEG;
break; break;
} }
case AV_PIX_FMT_YUVJ440P: case AV_PIX_FMT_YUVJ440P:
{ {
pixFmt = AV_PIX_FMT_YUV440P; sourcePixelFormat = AV_PIX_FMT_YUV440P;
sourceFrame->color_range = AVCOL_RANGE_MPEG; sourceFrame->color_range = AVCOL_RANGE_MPEG;
break; break;
} }
default:{ default:{
sourcePixelFormat = pixFmt;
sourceFrame->color_range = AVCOL_RANGE_UNSPECIFIED; sourceFrame->color_range = AVCOL_RANGE_UNSPECIFIED;
} }
} }

View File

@ -299,7 +299,7 @@ private:
// Source frame // Source frame
const QRect sourceDimensions; const QRect sourceDimensions;
const int sourcePixelFormat; int sourcePixelFormat;
const FrameBufferKey sourceFrameKey; const FrameBufferKey sourceFrameKey;
const bool freeSourceFrame; const bool freeSourceFrame;