Bug 1233340: [ffmpeg] Support YUV420J pixel format. r=kentuckyfriedtakahe a=sylvestre
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 21 Dec 2015 11:20:58 +1100
changeset 298059 081b14fd8bf9c76649c74940759e584208f7a0ba
parent 298058 aa47aa5c7a22a4ce7ab1bcfe5119b5b944b4ef38
child 298060 8785e7694bd0d31f23fba9b63dadc12c9924ba86
push id8857
push userkwierso@gmail.com
push dateMon, 28 Dec 2015 16:46:13 +0000
treeherdermozilla-aurora@5628bb302871 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe, sylvestre
bugs1233340
milestone45.0a2
Bug 1233340: [ffmpeg] Support YUV420J pixel format. r=kentuckyfriedtakahe a=sylvestre YUV420J is 12bpp YUV420P.
dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
@@ -52,17 +52,17 @@ FFmpegDataDecoder<LIBAV_VER>::~FFmpegDat
  * For now, we just look for YUV420P as it is the only non-HW accelerated format
  * supported by FFmpeg's H264 decoder.
  */
 static PixelFormat
 ChoosePixelFormat(AVCodecContext* aCodecContext, const PixelFormat* aFormats)
 {
   FFMPEG_LOG("Choosing FFmpeg pixel format for video decoding.");
   for (; *aFormats > -1; aFormats++) {
-    if (*aFormats == PIX_FMT_YUV420P) {
+    if (*aFormats == PIX_FMT_YUV420P || *aFormats == PIX_FMT_YUVJ420P) {
       FFMPEG_LOG("Requesting pixel format YUV420P.");
       return PIX_FMT_YUV420P;
     }
   }
 
   NS_WARNING("FFmpeg does not share any supported pixel formats.");
   return PIX_FMT_NONE;
 }