Bug 1223270: P4. Remove extra copy of YUV buffer for Theora. r=mattwoodrow
☠☠ backed out by 5d2d884164ea ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 04 May 2017 15:44:46 +0200
changeset 364989 b0b4667e25df717bc5b1bdaf83221a34e735aa65
parent 364988 c79b6d337d04dabea4530e2c237a5e58d6ed12c3
child 364990 3e74b1fb1b799ce3e22de0c579c5de7604c571fd
push id91680
push userkwierso@gmail.com
push dateWed, 21 Jun 2017 01:32:01 +0000
treeherdermozilla-inbound@f7b9dc31956c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1223270
milestone56.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 1223270: P4. Remove extra copy of YUV buffer for Theora. r=mattwoodrow MozReview-Commit-ID: FnhPObcv4U3
dom/media/platforms/agnostic/TheoraDecoder.cpp
dom/media/platforms/agnostic/TheoraDecoder.h
--- a/dom/media/platforms/agnostic/TheoraDecoder.cpp
+++ b/dom/media/platforms/agnostic/TheoraDecoder.cpp
@@ -33,17 +33,18 @@ ogg_packet InitTheoraPacket(const unsign
   packet.b_o_s = aBOS;
   packet.e_o_s = aEOS;
   packet.granulepos = aGranulepos;
   packet.packetno = aPacketNo;
   return packet;
 }
 
 TheoraDecoder::TheoraDecoder(const CreateDecoderParams& aParams)
-  : mImageContainer(aParams.mImageContainer)
+  : mImageAllocator(aParams.mKnowsCompositor)
+  , mImageContainer(aParams.mImageContainer)
   , mTaskQueue(aParams.mTaskQueue)
   , mTheoraSetupInfo(nullptr)
   , mTheoraDecoderContext(nullptr)
   , mPacketCount(0)
   , mInfo(aParams.VideoConfig())
 {
   MOZ_COUNT_CTOR(TheoraDecoder);
 }
@@ -173,17 +174,18 @@ TheoraDecoder::ProcessDecode(MediaRawDat
                                    mImageContainer,
                                    aSample->mOffset,
                                    aSample->mTime,
                                    aSample->mDuration,
                                    b,
                                    aSample->mKeyframe,
                                    aSample->mTimecode,
                                    mInfo.ScaledImageRect(mTheoraInfo.frame_width,
-                                                         mTheoraInfo.frame_height));
+                                                         mTheoraInfo.frame_height),
+                                   mImageAllocator);
     if (!v) {
       LOG(
         "Image allocation error source %ux%u display %ux%u picture %ux%u",
         mTheoraInfo.frame_width,
         mTheoraInfo.frame_height,
         mInfo.mDisplay.width,
         mInfo.mDisplay.height,
         mInfo.mImage.width,
--- a/dom/media/platforms/agnostic/TheoraDecoder.h
+++ b/dom/media/platforms/agnostic/TheoraDecoder.h
@@ -33,16 +33,17 @@ public:
   }
 
 private:
   ~TheoraDecoder();
   nsresult DoDecodeHeader(const unsigned char* aData, size_t aLength);
 
   RefPtr<DecodePromise> ProcessDecode(MediaRawData* aSample);
 
+  RefPtr<layers::KnowsCompositor> mImageAllocator;
   RefPtr<layers::ImageContainer> mImageContainer;
   RefPtr<TaskQueue> mTaskQueue;
 
   // Theora header & decoder state
   th_info mTheoraInfo;
   th_comment mTheoraComment;
   th_setup_info *mTheoraSetupInfo;
   th_dec_ctx *mTheoraDecoderContext;