Revert "Copy video frames metadata between encoded and plain frames in one place"

This reverts commit 00d0a0a1a9520fb4323d7e3a1c02133b7b942978.

Reason for revert: Breaks downstream tests

Original change's description:
> Copy video frames metadata between encoded and plain frames in one place
> 
> Currently some video frames metadata like rotation or ntp timestamps are
> copied in every encoder and decoder separately. This CL makes copying to
> happen at a single place for send or receive side. This will make it
> easier to add new metadata in the future.
> 
> Also, added some missing tests.
> 
> Bug: webrtc:10460
> Change-Id: Ia49072c3041e75433f125a61050d2982b2bec1da
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133346
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Johannes Kron <kron@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27719}

TBR=ilnik@webrtc.org,sprang@webrtc.org,kron@webrtc.org

Change-Id: I8960a6cc15e552925129ba0037f197ff3fd93c25
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10460
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134100
Reviewed-by: Artem Titarenko <artit@webrtc.org>
Commit-Queue: Artem Titarenko <artit@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27737}
This commit is contained in:
Artem Titarenko
2019-04-24 12:56:36 +00:00
committed by Commit Bot
parent eb415cd482
commit 84ae2b6efd
23 changed files with 365 additions and 381 deletions

View File

@ -125,6 +125,8 @@ int H264DecoderImpl::AVGetBuffer2(
static_cast<void*>(absl::make_unique<VideoFrame>(
VideoFrame::Builder()
.set_video_frame_buffer(frame_buffer)
.set_rotation(kVideoRotation_0)
.set_timestamp_us(0)
.build())
.release()),
0);
@ -283,11 +285,16 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image,
RTC_CHECK_EQ(av_frame_->data[kUPlaneIndex], i420_buffer->DataU());
RTC_CHECK_EQ(av_frame_->data[kVPlaneIndex], i420_buffer->DataV());
const ColorSpace& color_space = ExtractH264ColorSpace(av_context_.get());
// Pass on color space from input frame if explicitly specified.
const ColorSpace& color_space =
input_image.ColorSpace() ? *input_image.ColorSpace()
: ExtractH264ColorSpace(av_context_.get());
VideoFrame decoded_frame =
VideoFrame::Builder()
.set_video_frame_buffer(input_frame->video_frame_buffer())
.set_timestamp_us(input_frame->timestamp_us())
.set_timestamp_rtp(input_image.Timestamp())
.set_rotation(input_frame->rotation())
.set_color_space(color_space)
.build();
@ -312,7 +319,9 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image,
VideoFrame cropped_frame =
VideoFrame::Builder()
.set_video_frame_buffer(cropped_buf)
.set_timestamp_ms(decoded_frame.render_time_ms())
.set_timestamp_rtp(decoded_frame.timestamp())
.set_rotation(decoded_frame.rotation())
.set_color_space(color_space)
.build();
// TODO(nisse): Timestamp and rotation are all zero here. Change decoder