Bug 1329369 - Initialize the decoded video frame to the pixel size of the buffer. r=jya
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 17 Feb 2017 15:01:25 +1300
changeset 344310 1c52a38e6fd4126fcd961ed27b2cbabc6800585e
parent 344309 1b113fa672072bedc07de1d71e5ab5475b99416b
child 344311 8a885b6135f022af93cdf91feb683fb4bd038125
push id31406
push userkwierso@gmail.com
push dateWed, 22 Feb 2017 23:01:18 +0000
treeherdermozilla-central@32dcdde1fc64 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1329369
milestone54.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 1329369 - Initialize the decoded video frame to the pixel size of the buffer. r=jya MozReview-Commit-ID: ChfGNFxjJpc
dom/media/ipc/PVideoDecoder.ipdl
dom/media/ipc/VideoDecoderChild.cpp
dom/media/ipc/VideoDecoderParent.cpp
--- a/dom/media/ipc/PVideoDecoder.ipdl
+++ b/dom/media/ipc/PVideoDecoder.ipdl
@@ -21,16 +21,17 @@ struct MediaDataIPDL
   uint32_t frames;
   bool keyframe;
 };
 
 struct VideoDataIPDL
 {
   MediaDataIPDL base;
   IntSize display;
+  IntSize frameSize;
   SurfaceDescriptorGPUVideo sd;
   int32_t frameID;
 };
 
 struct MediaRawDataIPDL
 {
   MediaDataIPDL base;
   Shmem buffer;
--- a/dom/media/ipc/VideoDecoderChild.cpp
+++ b/dom/media/ipc/VideoDecoderChild.cpp
@@ -39,17 +39,17 @@ mozilla::ipc::IPCResult
 VideoDecoderChild::RecvOutput(const VideoDataIPDL& aData)
 {
   AssertOnManagerThread();
   VideoInfo info(aData.display().width, aData.display().height);
 
   // The Image here creates a TextureData object that takes ownership
   // of the SurfaceDescriptor, and is responsible for making sure that
   // it gets deallocated.
-  RefPtr<Image> image = new GPUVideoImage(GetManager(), aData.sd(), aData.display());
+  RefPtr<Image> image = new GPUVideoImage(GetManager(), aData.sd(), aData.frameSize());
 
   RefPtr<VideoData> video = VideoData::CreateFromImage(info,
                                                        aData.base().offset(),
                                                        aData.base().time(),
                                                        aData.base().duration(),
                                                        image,
                                                        aData.base().keyframe(),
                                                        aData.base().timecode(),
--- a/dom/media/ipc/VideoDecoderParent.cpp
+++ b/dom/media/ipc/VideoDecoderParent.cpp
@@ -184,16 +184,17 @@ VideoDecoderParent::ProcessDecodedData(
       texture->InitIPDLActor(mKnowsCompositor);
       texture->SetAddedToCompositableClient();
     }
 
     VideoDataIPDL output(
       MediaDataIPDL(data->mOffset, data->mTime, data->mTimecode,
                     data->mDuration, data->mFrames, data->mKeyframe),
       video->mDisplay,
+      texture ? texture->GetSize() : IntSize(),
       texture ? mParent->StoreImage(video->mImage, texture)
               : SurfaceDescriptorGPUVideo(0),
       video->mFrameID);
     Unused << SendOutput(output);
   }
 }
 
 mozilla::ipc::IPCResult