Bug 1207442: Disable ffvpx with libav0.8 and earlier. r=edwin a=lizzard
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 01 Oct 2015 17:37:03 +1000
changeset 298172 8990ce7755ed846a560c7731af59fee7177eb871
parent 298171 6787b57b02300454dc7e4c8a64f375c4d2956b51
child 298173 b49459989720944f4b98c681a0463d216f210cc2
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin, lizzard
bugs1207442
milestone43.0a2
Bug 1207442: Disable ffvpx with libav0.8 and earlier. r=edwin a=lizzard
dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
@@ -74,16 +74,17 @@ FFmpegH264Decoder<LIBAV_VER>::GetPts(con
 FFmpegH264Decoder<LIBAV_VER>::DecodeResult
 FFmpegH264Decoder<LIBAV_VER>::DoDecodeFrame(MediaRawData* aSample)
 {
   MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
 
   uint8_t* inputData = const_cast<uint8_t*>(aSample->Data());
   size_t inputSize = aSample->Size();
 
+#if LIBAVCODEC_VERSION_MAJOR >= 54
   if (inputSize && mCodecParser && (mCodecID == AV_CODEC_ID_VP8
 #if LIBAVCODEC_VERSION_MAJOR >= 55
       || mCodecID == AV_CODEC_ID_VP9
 #endif
       )) {
     bool gotFrame = false;
     while (inputSize) {
       uint8_t* data;
@@ -107,16 +108,17 @@ FFmpegH264Decoder<LIBAV_VER>::DoDecodeFr
             break;
           default:
             break;
         }
       }
     }
     return gotFrame ? DecodeResult::DECODE_FRAME : DecodeResult::DECODE_NO_FRAME;
   }
+#endif
   return DoDecodeFrame(aSample, inputData, inputSize);
 }
 
 FFmpegH264Decoder<LIBAV_VER>::DecodeResult
 FFmpegH264Decoder<LIBAV_VER>::DoDecodeFrame(MediaRawData* aSample,
                                             uint8_t* aData, int aSize)
 {
   MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
@@ -360,19 +362,21 @@ FFmpegH264Decoder<LIBAV_VER>::GetCodecId
   if (aMimeType.EqualsLiteral("video/avc") || aMimeType.EqualsLiteral("video/mp4")) {
     return AV_CODEC_ID_H264;
   }
 
   if (aMimeType.EqualsLiteral("video/x-vnd.on2.vp6")) {
     return AV_CODEC_ID_VP6F;
   }
 
+#if LIBAVCODEC_VERSION_MAJOR >= 54
   if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
     return AV_CODEC_ID_VP8;
   }
+#endif
 
 #if LIBAVCODEC_VERSION_MAJOR >= 55
   if (aMimeType.EqualsLiteral("video/webm; codecs=vp9")) {
     return AV_CODEC_ID_VP9;
   }
 #endif
 
   return AV_CODEC_ID_NONE;