Commit 4daf117c authored by Chrome Cunningham's avatar Chrome Cunningham Committed by Commit Bot

Revert "[media] vpx_video_decoder: dynamically update natural size"

This reverts commit c4948f05.

Reason for revert: Landed too soon (tried to uncheck CQ)

Original change's description:
> [media] vpx_video_decoder: dynamically update natural size
> 
> This changes the behavior implicit resizing of for VP8/9 video. By
> implicit, we mean streams where the dimensions change without a new
> MSE init segment that explicitly describes the new size.
> 
> Prior to this CL, we took whatever resolution was specified by the
> container metadata and scaled any later differing resolution into an
> element of that original size. Many of our decoders worked this way
> before https://chromium-review.googlesource.com/c/chromium/src/+/1026992/,
> which shifted the consensus is to allow dynamic resize. This CL makes
> the libVPX wrapper consistent with those.
> 
> When the size changes we will update videoWidth and videoHeight and
> fire a 'resize' event.
> 
> Bug: 992235
> Change-Id: I5bca7a68709594500e6ec9b4e107531b41e20925
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1828226
> Commit-Queue: Dan Sanders <sandersd@chromium.org>
> Reviewed-by: Dan Sanders <sandersd@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#701373}

TBR=sandersd@chromium.org,chcunningham@chromium.org

Change-Id: I80354370bb61189127bb894ba1f7d2da48445bb1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 992235
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832689Reviewed-by: default avatarChrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701381}
parent cc1c7bfa
...@@ -508,7 +508,6 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame( ...@@ -508,7 +508,6 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame(
// benefit, and only risk copying too much data. // benefit, and only risk copying too much data.
const gfx::Size coded_size(vpx_image->w, vpx_image->d_h); const gfx::Size coded_size(vpx_image->w, vpx_image->d_h);
const gfx::Size visible_size(vpx_image->d_w, vpx_image->d_h); const gfx::Size visible_size(vpx_image->d_w, vpx_image->d_h);
const gfx::Size natural_size(vpx_image->r_w, vpx_image->r_h);
if (memory_pool_) { if (memory_pool_) {
DCHECK_EQ(kCodecVP9, config_.codec()); DCHECK_EQ(kCodecVP9, config_.codec());
...@@ -522,18 +521,19 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame( ...@@ -522,18 +521,19 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame(
vpx_image_alpha->stride[VPX_PLANE_Y], vpx_image_alpha->stride[VPX_PLANE_Y],
vpx_image_alpha->d_w, vpx_image_alpha->d_h); vpx_image_alpha->d_w, vpx_image_alpha->d_h);
*video_frame = VideoFrame::WrapExternalYuvaData( *video_frame = VideoFrame::WrapExternalYuvaData(
codec_format, coded_size, gfx::Rect(visible_size), natural_size, codec_format, coded_size, gfx::Rect(visible_size),
vpx_image->stride[VPX_PLANE_Y], vpx_image->stride[VPX_PLANE_U], config_.natural_size(), vpx_image->stride[VPX_PLANE_Y],
vpx_image->stride[VPX_PLANE_V], vpx_image_alpha->stride[VPX_PLANE_Y], vpx_image->stride[VPX_PLANE_U], vpx_image->stride[VPX_PLANE_V],
vpx_image->planes[VPX_PLANE_Y], vpx_image->planes[VPX_PLANE_U], vpx_image_alpha->stride[VPX_PLANE_Y], vpx_image->planes[VPX_PLANE_Y],
vpx_image->planes[VPX_PLANE_V], alpha_plane, kNoTimestamp); vpx_image->planes[VPX_PLANE_U], vpx_image->planes[VPX_PLANE_V],
alpha_plane, kNoTimestamp);
} else { } else {
*video_frame = VideoFrame::WrapExternalYuvData( *video_frame = VideoFrame::WrapExternalYuvData(
codec_format, coded_size, gfx::Rect(visible_size), natural_size, codec_format, coded_size, gfx::Rect(visible_size),
vpx_image->stride[VPX_PLANE_Y], vpx_image->stride[VPX_PLANE_U], config_.natural_size(), vpx_image->stride[VPX_PLANE_Y],
vpx_image->stride[VPX_PLANE_V], vpx_image->planes[VPX_PLANE_Y], vpx_image->stride[VPX_PLANE_U], vpx_image->stride[VPX_PLANE_V],
vpx_image->planes[VPX_PLANE_U], vpx_image->planes[VPX_PLANE_V], vpx_image->planes[VPX_PLANE_Y], vpx_image->planes[VPX_PLANE_U],
kNoTimestamp); vpx_image->planes[VPX_PLANE_V], kNoTimestamp);
} }
if (!(*video_frame)) if (!(*video_frame))
return false; return false;
...@@ -544,8 +544,8 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame( ...@@ -544,8 +544,8 @@ bool VpxVideoDecoder::CopyVpxImageToVideoFrame(
} }
*video_frame = frame_pool_.CreateFrame(codec_format, visible_size, *video_frame = frame_pool_.CreateFrame(codec_format, visible_size,
gfx::Rect(visible_size), natural_size, gfx::Rect(visible_size),
kNoTimestamp); config_.natural_size(), kNoTimestamp);
if (!(*video_frame)) if (!(*video_frame))
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment