Bug 1197319: P3. Allow VP8/VP9 decoding via FFmpeg. r=kentuckyfriedtakahe
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 08 Sep 2015 16:53:31 +1000
changeset 296086 3a5f6d92197239ad6c58b6c0e57b0324921a425a
parent 296085 dec6b701c9eaf417bee88b4fc2e6cdf4e5fe2516
child 296087 c558ee35c092ea9ac8f7b01937143d4681403f64
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)
reviewerskentuckyfriedtakahe
bugs1197319
milestone43.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 1197319: P3. Allow VP8/VP9 decoding via FFmpeg. r=kentuckyfriedtakahe
dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
dom/media/platforms/ffmpeg/FFmpegLibs.h
--- a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
@@ -380,12 +380,22 @@ 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 (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
+    return AV_CODEC_ID_VP8;
+  }
+
+#if LIBAVCODEC_VERSION_MAJOR >= 55
+  if (aMimeType.EqualsLiteral("video/webm; codecs=vp9")) {
+    return AV_CODEC_ID_VP9;
+  }
+#endif
+
   return AV_CODEC_ID_NONE;
 }
 
 } // namespace mozilla
--- a/dom/media/platforms/ffmpeg/FFmpegLibs.h
+++ b/dom/media/platforms/ffmpeg/FFmpegLibs.h
@@ -15,16 +15,17 @@ extern "C" {
 #pragma GCC visibility pop
 }
 
 #if LIBAVCODEC_VERSION_MAJOR < 55
 #define AV_CODEC_ID_VP6F CODEC_ID_VP6F
 #define AV_CODEC_ID_H264 CODEC_ID_H264
 #define AV_CODEC_ID_AAC CODEC_ID_AAC
 #define AV_CODEC_ID_MP3 CODEC_ID_MP3
+#define AV_CODEC_ID_VP8 CODEC_ID_VP8
 #define AV_CODEC_ID_NONE CODEC_ID_NONE
 typedef CodecID AVCodecID;
 #endif
 
 enum { LIBAV_VER = LIBAVFORMAT_VERSION_MAJOR };
 
 namespace mozilla {