Bug 1223270: P4. Remove extra copy of YUV buffer for Theora. r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 04 May 2017 15:44:46 +0200
changeset 365332 809aef3e8b196ce9b5fb560c1400b3f7d4ad73c5
parent 365331 89e57eae53e907501d99fb9fafc020bab2395031
child 365333 79d9bc4917e1300c8cd22a04236447222f66d231
push id91734
push userkwierso@gmail.com
push dateThu, 22 Jun 2017 01:05:37 +0000
treeherdermozilla-inbound@2576a0695305 [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;