Revert of Delete unused and almost unused frame-related methods. (patchset #12 id:220001 of https://codereview.webrtc.org/2065733003/ )

Reason for revert:
Breaks downstream applications which inherits webrtc::VideoFrameBuffer and tries to override deleted methods data(), stride() and MutableData().

Original issue's description:
> Delete unused and almost unused frame-related methods.
>
> webrtc::VideoFrame::set_video_frame_buffer
> webrtc::VideoFrame::ConvertNativeToI420Frame
>
> cricket::WebRtcVideoFrame::InitToBlack
>
> VideoFrameBuffer::data
> VideoFrameBuffer::stride
> VideoFrameBuffer::MutableData
>
> TBR=tkchin@webrtc.org # Refactoring affecting RTCVideoFrame
> BUG=webrtc:5682
>
> Committed: https://crrev.com/76270de4bc2dac188f10f805e6e2fb86693ef864
> Cr-Commit-Position: refs/heads/master@{#13183}

TBR=perkj@webrtc.org,pbos@webrtc.org,marpan@webrtc.org,tkchin@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/2076113002
Cr-Commit-Position: refs/heads/master@{#13184}
This commit is contained in:
nisse
2016-06-17 02:55:14 -07:00
committed by Commit bot
parent 76270de4bc
commit 72e735d386
16 changed files with 174 additions and 92 deletions

View File

@ -670,8 +670,7 @@ int32_t MediaCodecVideoEncoder::EncodeOnCodecThread(
}
consecutive_full_queue_frame_drops_ = 0;
rtc::scoped_refptr<webrtc::VideoFrameBuffer> input_buffer(
frame.video_frame_buffer());
VideoFrame input_frame = frame;
if (scale_) {
// Check framerate before spatial resolution change.
quality_scaler_.OnEncodeFrame(frame.width(), frame.height());
@ -679,22 +678,21 @@ int32_t MediaCodecVideoEncoder::EncodeOnCodecThread(
quality_scaler_.GetScaledResolution();
if (scaled_resolution.width != frame.width() ||
scaled_resolution.height != frame.height()) {
if (input_buffer->native_handle() != nullptr) {
input_buffer = static_cast<AndroidTextureBuffer*>(input_buffer.get())
->CropScaleAndRotate(frame.width(), frame.height(),
0, 0,
scaled_resolution.width,
scaled_resolution.height,
webrtc::kVideoRotation_0);
if (frame.video_frame_buffer()->native_handle() != nullptr) {
rtc::scoped_refptr<webrtc::VideoFrameBuffer> scaled_buffer(
static_cast<AndroidTextureBuffer*>(
frame.video_frame_buffer().get())->CropScaleAndRotate(
frame.width(), frame.height(), 0, 0,
scaled_resolution.width, scaled_resolution.height,
webrtc::kVideoRotation_0));
input_frame.set_video_frame_buffer(scaled_buffer);
} else {
input_buffer = quality_scaler_.GetScaledBuffer(input_buffer);
input_frame.set_video_frame_buffer(
quality_scaler_.GetScaledBuffer(frame.video_frame_buffer()));
}
}
}
VideoFrame input_frame(input_buffer, frame.timestamp(),
frame.render_time_ms(), frame.rotation());
if (!MaybeReconfigureEncoderOnCodecThread(input_frame)) {
ALOGE << "Failed to reconfigure encoder.";
return WEBRTC_VIDEO_CODEC_ERROR;