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

@ -265,7 +265,8 @@ int LibvpxVp8Decoder::Decode(const EncodedImage& input_image,
vpx_codec_err_t vpx_ret =
vpx_codec_control(decoder_, VPXD_GET_LAST_QUANTIZER, &qp);
RTC_DCHECK_EQ(vpx_ret, VPX_CODEC_OK);
ret = ReturnFrame(img, input_image.Timestamp(), qp);
ret = ReturnFrame(img, input_image.Timestamp(), input_image.ntp_time_ms_, qp,
input_image.ColorSpace());
if (ret != 0) {
// Reset to avoid requesting key frames too often.
if (ret < 0 && propagation_cnt_ > 0)
@ -281,9 +282,12 @@ int LibvpxVp8Decoder::Decode(const EncodedImage& input_image,
return WEBRTC_VIDEO_CODEC_OK;
}
int LibvpxVp8Decoder::ReturnFrame(const vpx_image_t* img,
uint32_t timestamp,
int qp) {
int LibvpxVp8Decoder::ReturnFrame(
const vpx_image_t* img,
uint32_t timestamp,
int64_t ntp_time_ms,
int qp,
const webrtc::ColorSpace* explicit_color_space) {
if (img == NULL) {
// Decoder OK and NULL image => No show frame
return WEBRTC_VIDEO_CODEC_NO_OUTPUT;
@ -318,6 +322,8 @@ int LibvpxVp8Decoder::ReturnFrame(const vpx_image_t* img,
VideoFrame decoded_image = VideoFrame::Builder()
.set_video_frame_buffer(buffer)
.set_timestamp_rtp(timestamp)
.set_ntp_time_ms(ntp_time_ms)
.set_color_space(explicit_color_space)
.build();
decode_complete_callback_->Decoded(decoded_image, absl::nullopt, qp);