Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-02-27 12:15:12 +08:00
commit 7c0ddca067
280 changed files with 111730 additions and 37706 deletions

View file

@ -246,6 +246,8 @@ AOMDecoder::DoDecode(MediaRawData* aSample)
LOG("Unhandled colorspace %d", img->mc);
break;
}
b.mColorRange = img->range == AOM_CR_FULL_RANGE ? ColorRange::FULL
: ColorRange::LIMITED;
RefPtr<VideoData> v =
VideoData::CreateAndCopyData(mInfo,

View file

@ -173,6 +173,7 @@ VPXDecoder::DoDecode(MediaRawData* aSample)
return YUVColorSpace::BT601;
}
}();
// TODO: need a newer libvpx to support full color range
RefPtr<VideoData> v =
VideoData::CreateAndCopyData(mInfo,

View file

@ -154,6 +154,7 @@ FFmpegLibWrapper::Link()
AV_FUNC(av_frame_free, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58))
AV_FUNC(av_frame_unref, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58))
AV_FUNC_OPTION(av_frame_get_colorspace, AV_FUNC_AVUTIL_ALL)
AV_FUNC_OPTION(av_frame_get_color_range, AV_FUNC_AVUTIL_ALL)
#undef AV_FUNC
#undef AV_FUNC_OPTION

View file

@ -87,6 +87,7 @@ struct FFmpegLibWrapper
// libavutil optional
int (*av_frame_get_colorspace)(const AVFrame *frame);
int (*av_frame_get_color_range)(const AVFrame *frame);
PRLibrary* mAVCodecLib;
PRLibrary* mAVUtilLib;

View file

@ -388,6 +388,11 @@ FFmpegVideoDecoder<LIBAV_VER>::CreateImage(int64_t aOffset, int64_t aPts,
break;
}
}
if (mLib->av_frame_get_color_range) {
auto range = mLib->av_frame_get_color_range(mFrame);
b.mColorRange = range == AVCOL_RANGE_JPEG ? ColorRange::FULL : ColorRange::LIMITED;
}
RefPtr<VideoData> v =
VideoData::CreateAndCopyData(mInfo,
mImageContainer,