Bug 1207442: Disable ffvpx with libav0.8 and earlier. r=edwin
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 01 Oct 2015 17:37:03 +1000
changeset 607021 91a5dbaf6e66529290db1fc0466a0252e6040644
parent 607020 efce0ce216d9ef6ac72fb4c0cb158598e95fd08e
child 607022 dfb4633ba5fe4244a65e1712609a462d4ad79a23
push id93006
push userjyavenard@mozilla.com
push dateThu, 15 Oct 2015 05:15:33 +0000
treeherdertry@45ea2a01301e [default view] [failures only]
reviewersedwin
bugs1207442
milestone43.0a2
Bug 1207442: Disable ffvpx with libav0.8 and earlier. r=edwin
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;