Bug 965440 - VideoData::Create should use gralloc where possible - r=doublec
☠☠ backed out by 026d41e6bf55 ☠ ☠
authorBenoit Jacob <bjacob@mozilla.com>
Fri, 31 Jan 2014 13:23:39 -0500
changeset 182400 a6094047ffca185e0e08e703a5048098527b5b24
parent 182399 00470cecfc56e0bfc5c339b1d1911fa1106f788c
child 182401 df85e7787732b1c262205c8cfe895f786a66899e
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdoublec
bugs965440
milestone29.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 965440 - VideoData::Create should use gralloc where possible - r=doublec
content/media/MediaDecoderReader.cpp
--- a/content/media/MediaDecoderReader.cpp
+++ b/content/media/MediaDecoderReader.cpp
@@ -67,17 +67,17 @@ static bool
 ValidatePlane(const VideoData::YCbCrBuffer::Plane& aPlane)
 {
   return aPlane.mWidth <= PlanarYCbCrImage::MAX_DIMENSION &&
          aPlane.mHeight <= PlanarYCbCrImage::MAX_DIMENSION &&
          aPlane.mWidth * aPlane.mHeight < MAX_VIDEO_WIDTH * MAX_VIDEO_HEIGHT &&
          aPlane.mStride > 0;
 }
 
-#if 0
+#ifdef MOZ_WIDGET_GONK
 static bool
 IsYV12Format(const VideoData::YCbCrBuffer::Plane& aYPlane,
              const VideoData::YCbCrBuffer::Plane& aCbPlane,
              const VideoData::YCbCrBuffer::Plane& aCrPlane)
 {
   return
     aYPlane.mWidth % 2 == 0 &&
     aYPlane.mHeight % 2 == 0 &&
@@ -220,17 +220,17 @@ VideoData* VideoData::Create(VideoInfo& 
                                        aInfo.mDisplay));
   const YCbCrBuffer::Plane &Y = aBuffer.mPlanes[0];
   const YCbCrBuffer::Plane &Cb = aBuffer.mPlanes[1];
   const YCbCrBuffer::Plane &Cr = aBuffer.mPlanes[2];
 
   if (!aImage) {
     // Currently our decoder only knows how to output to ImageFormat::PLANAR_YCBCR
     // format.
-#if 0
+#ifdef MOZ_WIDGET_GONK
     if (IsYV12Format(Y, Cb, Cr)) {
       v->mImage = aContainer->CreateImage(ImageFormat::GRALLOC_PLANAR_YCBCR);
     }
 #endif
     if (!v->mImage) {
       v->mImage = aContainer->CreateImage(ImageFormat::PLANAR_YCBCR);
     }
   } else {