Bug 1043558: use Gralloc buffer for target of gum image Rotation r=sotaro
☠☠ backed out by 426497473505 ☠ ☠
authorRandell Jesup <rjesup@jesup.org>
Wed, 17 Sep 2014 17:18:08 -0400
changeset 205871 e87724022bc12d584f5e1a106c23272911da7de5
parent 205870 89c373278e798219518a4670233a6898653287e4
child 205872 e0fea74eb1e6712ba0c1e9b4716d47539736a52b
push id49277
push userrjesup@wgate.com
push dateWed, 17 Sep 2014 21:19:09 +0000
treeherdermozilla-inbound@e87724022bc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1043558
milestone35.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 1043558: use Gralloc buffer for target of gum image Rotation r=sotaro
content/media/webrtc/MediaEngineWebRTCVideo.cpp
--- a/content/media/webrtc/MediaEngineWebRTCVideo.cpp
+++ b/content/media/webrtc/MediaEngineWebRTCVideo.cpp
@@ -992,17 +992,22 @@ MediaEngineWebRTCVideoSource::RotateImag
   android::sp<android::GraphicBuffer> graphicBuffer = nativeImage->GetGraphicBuffer();
   void *pMem = nullptr;
   uint32_t size = aWidth * aHeight * 3 / 2;
 
   graphicBuffer->lock(android::GraphicBuffer::USAGE_SW_READ_MASK, &pMem);
 
   uint8_t* srcPtr = static_cast<uint8_t*>(pMem);
   // Create a video frame and append it to the track.
-  nsRefPtr<layers::Image> image = mImageContainer->CreateImage(ImageFormat::PLANAR_YCBCR);
+#ifdef MOZ_WIDGET_GONK
+  ImageFormat format = ImageFormat::GRALLOC_PLANAR_YCBCR;
+#else
+  ImageFormat format = ImageFormat::PLANAR_YCBCR;
+#endif
+  nsRefPtr<layers::Image> image = mImageContainer->CreateImage(format);
   layers::PlanarYCbCrImage* videoImage = static_cast<layers::PlanarYCbCrImage*>(image.get());
 
   uint32_t dstWidth;
   uint32_t dstHeight;
 
   if (mRotation == 90 || mRotation == 270) {
     dstWidth = aHeight;
     dstHeight = aWidth;