Bug 1329369 - Initialize the decoded video frame to the pixel size of the buffer. r=jya, a=abillings
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 17 Feb 2017 15:01:25 +1300
changeset 378648 06b5866b0bd8c7023479c9ea031713c3df5aa7aa
parent 378647 bfb5c94e40150a801c78b395201d39baa08576bd
child 378649 432f86adc83ea171bda9c04a809c3eb80f1eb608
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, abillings
bugs1329369
milestone53.0a2
Bug 1329369 - Initialize the decoded video frame to the pixel size of the buffer. r=jya, a=abillings 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
@@ -239,16 +239,17 @@ VideoDecoderParent::Output(MediaData* aD
 
     VideoDataIPDL output(MediaDataIPDL(data->mOffset,
                                        data->mTime,
                                        data->mTimecode,
                                        data->mDuration,
                                        data->mFrames,
                                        data->mKeyframe),
                          video->mDisplay,
+                         texture ? texture->GetSize() : IntSize(),
                          texture ? self->mParent->StoreImage(video->mImage, texture) : SurfaceDescriptorGPUVideo(0),
                          video->mFrameID);
     Unused << self->SendOutput(output);
   }));
 }
 
 void
 VideoDecoderParent::Error(const MediaResult& aError)