Reland of Delete webrtc::VideoFrame methods buffer and stride. (patchset #1 id:1 of https://codereview.webrtc.org/1935443002/ )
Reason for revert: I plan to reland this change in a week or two, after downstream users are updated. Original issue's description: > 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 > > Committed: https://crrev.com/5b3c443d301f2c2f18dac5b02652c08b91ea3828 > Cr-Commit-Position: refs/heads/master@{#12558} TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=webrtc:5682 Review-Url: https://codereview.webrtc.org/1963413004 Cr-Commit-Position: refs/heads/master@{#12721}
This commit is contained in:
@ -752,15 +752,18 @@ 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.buffer(kYPlane));
|
||||
const_cast<uint8_t*>(input_image.video_frame_buffer()->DataY());
|
||||
raw_images_[0].planes[VPX_PLANE_U] =
|
||||
const_cast<uint8_t*>(input_image.buffer(kUPlane));
|
||||
const_cast<uint8_t*>(input_image.video_frame_buffer()->DataU());
|
||||
raw_images_[0].planes[VPX_PLANE_V] =
|
||||
const_cast<uint8_t*>(input_image.buffer(kVPlane));
|
||||
const_cast<uint8_t*>(input_image.video_frame_buffer()->DataV());
|
||||
|
||||
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);
|
||||
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();
|
||||
|
||||
for (size_t i = 1; i < encoders_.size(); ++i) {
|
||||
// Scale the image down a number of times by downsampling factor
|
||||
@ -1357,9 +1360,12 @@ 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.buffer(kYPlane), decoded_image.stride(kYPlane),
|
||||
decoded_image.buffer(kUPlane), decoded_image.stride(kUPlane),
|
||||
decoded_image.buffer(kVPlane), decoded_image.stride(kVPlane),
|
||||
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(),
|
||||
img->d_w, img->d_h);
|
||||
decoded_image.set_ntp_time_ms(ntp_time_ms);
|
||||
int ret = decode_complete_callback_->Decoded(decoded_image);
|
||||
|
||||
Reference in New Issue
Block a user