Bug 1657845 [Linux] Set AV_CODEC_FLAG_LOW_DELAY to low-latency vaapi decoder, r=jya
authorMartin Stransky <stransky@redhat.com>
Tue, 11 Aug 2020 05:55:06 +0000
changeset 544241 9ab98ba476ef620a75d9f7f213a96bae7be8893c
parent 544240 ac2c3f906e9d6e0890250eb61277e6f0ddf1c43d
child 544242 fb86d921926db263dadc85148defdd21e38415e1
push id123910
push userncsoregi@mozilla.com
push dateTue, 11 Aug 2020 06:15:31 +0000
treeherderautoland@9ab98ba476ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1657845
milestone81.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1657845 [Linux] Set AV_CODEC_FLAG_LOW_DELAY to low-latency vaapi decoder, r=jya Differential Revision: https://phabricator.services.mozilla.com/D86326
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -430,16 +430,19 @@ void FFmpegVideoDecoder<LIBAV_VER>::Init
   mCodecContext->thread_count = 1;
   mCodecContext->get_format = ChooseVAAPIPixelFormat;
   if (mCodecID == AV_CODEC_ID_H264) {
     mCodecContext->extra_hw_frames =
         H264::ComputeMaxRefFrames(mInfo.mExtraData);
   } else {
     mCodecContext->extra_hw_frames = EXTRA_HW_FRAMES;
   }
+  if (mLowLatency) {
+    mCodecContext->flags |= AV_CODEC_FLAG_LOW_DELAY;
+  }
 }
 #endif
 
 MediaResult FFmpegVideoDecoder<LIBAV_VER>::DoDecode(
     MediaRawData* aSample, uint8_t* aData, int aSize, bool* aGotFrame,
     MediaDataDecoder::DecodedData& aResults) {
   AVPacket packet;
   mLib->av_init_packet(&packet);