Bug 1230641: P1. Use UYVY (YUV422) format in decoders. r?mattwoodrow draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 15 Mar 2016 11:41:00 +1100
changeset 340201 719606de20ee1166b102286b843769be1f371d9e
parent 340200 3c4a045fe05f3e69e9454ab87199673da0b16dd9
child 340202 5d8311cc3116989b691ded8b77dc5ef403fe0fd5
push id12915
push userbmo:jyavenard@mozilla.com
push dateTue, 15 Mar 2016 01:23:04 +0000
reviewersmattwoodrow
bugs1230641
milestone48.0a1
Bug 1230641: P1. Use UYVY (YUV422) format in decoders. r?mattwoodrow MozReview-Commit-ID: I6KZLi2bHk0
dom/media/platforms/apple/AppleVDADecoder.cpp
--- a/dom/media/platforms/apple/AppleVDADecoder.cpp
+++ b/dom/media/platforms/apple/AppleVDADecoder.cpp
@@ -590,38 +590,44 @@ AppleVDADecoder::CreateDecoderSpecificat
                             ArrayLength(decoderKeys),
                             &kCFTypeDictionaryKeyCallBacks,
                             &kCFTypeDictionaryValueCallBacks);
 }
 
 CFDictionaryRef
 AppleVDADecoder::CreateOutputConfiguration()
 {
-  // Output format type:
-  SInt32 PixelFormatTypeValue = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
-  AutoCFRelease<CFNumberRef> PixelFormatTypeNumber =
-    CFNumberCreate(kCFAllocatorDefault,
-                   kCFNumberSInt32Type,
-                   &PixelFormatTypeValue);
-
   if (mUseSoftwareImages) {
+    // Output format type:
+    SInt32 PixelFormatTypeValue =
+      kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
+    AutoCFRelease<CFNumberRef> PixelFormatTypeNumber =
+      CFNumberCreate(kCFAllocatorDefault,
+                     kCFNumberSInt32Type,
+                     &PixelFormatTypeValue);
     const void* outputKeys[] = { kCVPixelBufferPixelFormatTypeKey };
     const void* outputValues[] = { PixelFormatTypeNumber };
     static_assert(ArrayLength(outputKeys) == ArrayLength(outputValues),
                   "Non matching keys/values array size");
 
     return CFDictionaryCreate(kCFAllocatorDefault,
                               outputKeys,
                               outputValues,
                               ArrayLength(outputKeys),
                               &kCFTypeDictionaryKeyCallBacks,
                               &kCFTypeDictionaryValueCallBacks);
   }
 
 #ifndef MOZ_WIDGET_UIKIT
+  // Output format type:
+  SInt32 PixelFormatTypeValue = kCVPixelFormatType_422YpCbCr8;
+  AutoCFRelease<CFNumberRef> PixelFormatTypeNumber =
+    CFNumberCreate(kCFAllocatorDefault,
+                   kCFNumberSInt32Type,
+                   &PixelFormatTypeValue);
   // Construct IOSurface Properties
   const void* IOSurfaceKeys[] = { MacIOSurfaceLib::kPropIsGlobal };
   const void* IOSurfaceValues[] = { kCFBooleanTrue };
   static_assert(ArrayLength(IOSurfaceKeys) == ArrayLength(IOSurfaceValues),
                 "Non matching keys/values array size");
 
   // Contruct output configuration.
   AutoCFRelease<CFDictionaryRef> IOSurfaceProperties =