Revert of Delete webrtc::VideoFrame methods buffer and stride. (patchset #14 id:250001 of https://codereview.webrtc.org/1900673002/ )

Reason for revert:
Breaks chrome FYI bots.

Original issue's description:
> Delete webrtc::VideoFrame methods buffer and stride.
>
> To make the HasOneRef/IsMutable hack work, also had to change the
> video_frame_buffer method to return a const ref to a scoped_ref_ptr,
> to not imply an AddRef.
>
> BUG=webrtc:5682

TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5682

Review-Url: https://codereview.webrtc.org/1935443002
Cr-Commit-Position: refs/heads/master@{#12558}
This commit is contained in:
nisse
2016-04-29 02:39:24 -07:00
committed by Commit bot
parent a0591b5473
commit 5b3c443d30
26 changed files with 399 additions and 415 deletions

View File

@ -752,18 +752,15 @@ int VP8EncoderImpl::Encode(const VideoFrame& frame,
// Image in vpx_image_t format.
// Input image is const. VP8's raw image is not defined as const.
raw_images_[0].planes[VPX_PLANE_Y] =
const_cast<uint8_t*>(input_image.video_frame_buffer()->DataY());
const_cast<uint8_t*>(input_image.buffer(kYPlane));
raw_images_[0].planes[VPX_PLANE_U] =
const_cast<uint8_t*>(input_image.video_frame_buffer()->DataU());
const_cast<uint8_t*>(input_image.buffer(kUPlane));
raw_images_[0].planes[VPX_PLANE_V] =
const_cast<uint8_t*>(input_image.video_frame_buffer()->DataV());
const_cast<uint8_t*>(input_image.buffer(kVPlane));
raw_images_[0].stride[VPX_PLANE_Y] =
input_image.video_frame_buffer()->StrideY();
raw_images_[0].stride[VPX_PLANE_U] =
input_image.video_frame_buffer()->StrideU();
raw_images_[0].stride[VPX_PLANE_V] =
input_image.video_frame_buffer()->StrideV();
raw_images_[0].stride[VPX_PLANE_Y] = input_image.stride(kYPlane);
raw_images_[0].stride[VPX_PLANE_U] = input_image.stride(kUPlane);
raw_images_[0].stride[VPX_PLANE_V] = input_image.stride(kVPlane);
for (size_t i = 1; i < encoders_.size(); ++i) {
// Scale the image down a number of times by downsampling factor
@ -1360,12 +1357,9 @@ int VP8DecoderImpl::ReturnFrame(const vpx_image_t* img,
libyuv::I420Copy(img->planes[VPX_PLANE_Y], img->stride[VPX_PLANE_Y],
img->planes[VPX_PLANE_U], img->stride[VPX_PLANE_U],
img->planes[VPX_PLANE_V], img->stride[VPX_PLANE_V],
decoded_image.video_frame_buffer()->MutableDataY(),
decoded_image.video_frame_buffer()->StrideY(),
decoded_image.video_frame_buffer()->MutableDataU(),
decoded_image.video_frame_buffer()->StrideU(),
decoded_image.video_frame_buffer()->MutableDataV(),
decoded_image.video_frame_buffer()->StrideV(),
decoded_image.buffer(kYPlane), decoded_image.stride(kYPlane),
decoded_image.buffer(kUPlane), decoded_image.stride(kUPlane),
decoded_image.buffer(kVPlane), decoded_image.stride(kVPlane),
img->d_w, img->d_h);
decoded_image.set_ntp_time_ms(ntp_time_ms);
int ret = decode_complete_callback_->Decoded(decoded_image);