Refactor FrameGenerator to return VideoFrameBuffer with VideoFrame::UpdateRect

Bug: webrtc:10138
Change-Id: I22079e2630bb1f3bb27472795fe923f9143b3401
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161010
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29973}
This commit is contained in:
Artem Titov
2019-12-02 10:34:12 +01:00
committed by Commit Bot
parent b2b58d84e3
commit 5256d8bc4b
18 changed files with 229 additions and 304 deletions

View File

@ -93,13 +93,18 @@ void VideoCodecUnitTest::SetUp() {
void VideoCodecUnitTest::ModifyCodecSettings(VideoCodec* codec_settings) {}
VideoFrame* VideoCodecUnitTest::NextInputFrame() {
VideoFrame* input_frame = input_frame_generator_->NextFrame();
VideoFrame VideoCodecUnitTest::NextInputFrame() {
test::FrameGenerator::VideoFrameData frame_data =
input_frame_generator_->NextFrame();
VideoFrame input_frame = VideoFrame::Builder()
.set_video_frame_buffer(frame_data.buffer)
.set_update_rect(frame_data.update_rect)
.build();
const uint32_t timestamp =
last_input_frame_timestamp_ +
kVideoPayloadTypeFrequency / codec_settings_.maxFramerate;
input_frame->set_timestamp(timestamp);
input_frame.set_timestamp(timestamp);
last_input_frame_timestamp_ = timestamp;
return input_frame;