Browse Source

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

reviewable/pr3185/r14
initramfs 10 years ago
parent
commit
df3345dce5
No known key found for this signature in database
GPG Key ID: 78B8BDF87E9EF0AF
  1. 12
      src/video/videoframe.cpp
  2. 2
      src/video/videoframe.h

12
src/video/videoframe.cpp

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

2
src/video/videoframe.h

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

Loading…
Cancel
Save