Bug 1243538: [webm] P7. Let the decoder handle picture resizing. r?SingingTree draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 18 Apr 2016 10:02:14 +1000
changeset 352923 571faee00b1add3351cf8f863edf9a7d4f4faf0e
parent 352922 30a877c912fe60853f5b84f40d132d2f5c0fb718
child 518784 65a8720886d83e6d2af5cbbb6c4c20fd1783b9c0
push id15841
push userbmo:jyavenard@mozilla.com
push dateTue, 19 Apr 2016 00:09:30 +0000
reviewersSingingTree
bugs1243538
milestone48.0a1
Bug 1243538: [webm] P7. Let the decoder handle picture resizing. r?SingingTree Is is now up to the decoders to automatically determine the correct size of the decoded frame. By leaving the original dimensions in the VideoInfo, it will allow automatic rescale of the cropping window according to the original dimensions. MozReview-Commit-ID: FZM4YlataNz
dom/media/webm/WebMDemuxer.cpp
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -577,21 +577,17 @@ WebMDemuxer::GetNextPacket(TrackInfo::Tr
       }
       isKeyframe = si.is_kf;
       if (isKeyframe) {
         // We only look for resolution changes on keyframes for both VP8 and
         // VP9. Other resolution changes are invalid.
         if (mLastSeenFrameWidth.isSome() && mLastSeenFrameHeight.isSome() &&
             (si.w != mLastSeenFrameWidth.value() ||
              si.h != mLastSeenFrameHeight.value())) {
-          // We ignore cropping information on resizes during streams.
-          // Cropping alone is rare, and we do not consider cropping to
-          // still be valid after a resolution change
-          mInfo.mVideo.mImage = mInfo.mVideo.mDisplay = nsIntSize(si.w, si.h);
-          mInfo.mVideo.SetImageRect(nsIntRect(0, 0, si.w, si.h));
+          mInfo.mVideo.mDisplay = nsIntSize(si.w, si.h);
           mSharedVideoTrackInfo = new SharedTrackInfo(mInfo.mVideo, ++sStreamSourceID);
         }
         mLastSeenFrameWidth = Some(si.w);
         mLastSeenFrameHeight = Some(si.h);
       }
     }
 
     WEBM_DEBUG("push sample tstamp: %ld next_tstamp: %ld length: %ld kf: %d",