Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(video): force the use of non-deprecated pixel formats for YUV
Browse files Browse the repository at this point in the history
  • Loading branch information
initramfs committed Aug 4, 2016
1 parent de6475f commit df3345d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/video/videoframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/video/videoframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class VideoFrame

// Source frame
const QRect sourceDimensions;
const int sourcePixelFormat;
int sourcePixelFormat;
const FrameBufferKey sourceFrameKey;
const bool freeSourceFrame;

Expand Down

0 comments on commit df3345d

Please sign in to comment.