Revert "Delete CodecSpecificInfo argument from VideoDecoder::Decode"

This reverts commit 39d3a7de02d63894d12e7332322e1d80cd7c0d40.

Reason for revert: This change broke an internal project

Original change's description:
> Delete CodecSpecificInfo argument from VideoDecoder::Decode
> 
> Bug: webrtc:10379
> Change-Id: I079b419604bf4e9c1994fe203d7db131a0ccddb6
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125920
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27022}

TBR=brandtr@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org

Change-Id: I2c730cc1834a3b23203fae3d7881f0890802c37b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10379
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126320
Reviewed-by: Jeroen de Borst <jeroendb@webrtc.org>
Commit-Queue: Jeroen de Borst <jeroendb@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27026}
This commit is contained in:
Jeroen de Borst
2019-03-07 19:40:07 +00:00
committed by Commit Bot
parent 7e70291bb7
commit 2c7b9825bc
35 changed files with 105 additions and 72 deletions

View File

@ -153,6 +153,7 @@ int LibvpxVp8Decoder::InitDecode(const VideoCodec* inst, int number_of_cores) {
int LibvpxVp8Decoder::Decode(const EncodedImage& input_image,
bool missing_frames,
const CodecSpecificInfo* codec_specific_info,
int64_t /*render_time_ms*/) {
if (!inited_) {
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;

View File

@ -34,6 +34,7 @@ class LibvpxVp8Decoder : public VideoDecoder {
int Decode(const EncodedImage& input_image,
bool missing_frames,
const CodecSpecificInfo* codec_specific_info,
int64_t /*render_time_ms*/) override;
int RegisterDecodeCompleteCallback(DecodedImageCallback* callback) override;

View File

@ -210,7 +210,8 @@ TEST_F(TestVp8Impl, DecodedQpEqualsEncodedQp) {
// First frame should be a key frame.
encoded_frame._frameType = kVideoFrameKey;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->Decode(encoded_frame, false, -1));
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr, -1));
std::unique_ptr<VideoFrame> decoded_frame;
absl::optional<uint8_t> decoded_qp;
ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));
@ -229,7 +230,8 @@ TEST_F(TestVp8Impl, DecodedColorSpaceEqualsEncodedColorSpace) {
// Encoded frame with explicit color space information.
ColorSpace color_space = CreateTestColorSpace(/*with_hdr_metadata=*/false);
encoded_frame.SetColorSpace(color_space);
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->Decode(encoded_frame, false, -1));
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr, -1));
std::unique_ptr<VideoFrame> decoded_frame;
absl::optional<uint8_t> decoded_qp;
ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));
@ -323,7 +325,8 @@ TEST_F(TestVp8Impl, MAYBE_AlignedStrideEncodeDecode) {
// First frame should be a key frame.
encoded_frame._frameType = kVideoFrameKey;
encoded_frame.ntp_time_ms_ = kTestNtpTimeMs;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->Decode(encoded_frame, false, -1));
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr, -1));
std::unique_ptr<VideoFrame> decoded_frame;
absl::optional<uint8_t> decoded_qp;
@ -349,15 +352,16 @@ TEST_F(TestVp8Impl, MAYBE_DecodeWithACompleteKeyFrame) {
// Setting complete to false -> should return an error.
encoded_frame._completeFrame = false;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR,
decoder_->Decode(encoded_frame, false, -1));
decoder_->Decode(encoded_frame, false, nullptr, -1));
// Setting complete back to true. Forcing a delta frame.
encoded_frame._frameType = kVideoFrameDelta;
encoded_frame._completeFrame = true;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR,
decoder_->Decode(encoded_frame, false, -1));
decoder_->Decode(encoded_frame, false, nullptr, -1));
// Now setting a key frame.
encoded_frame._frameType = kVideoFrameKey;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->Decode(encoded_frame, false, -1));
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr, -1));
std::unique_ptr<VideoFrame> decoded_frame;
absl::optional<uint8_t> decoded_qp;
ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));