Delete deprecated VideoDecoder::Decode method

Follow up to https://webrtc-review.googlesource.com/c/src/+/39511,
which introduced a new Decode method, without the
RTPFragmentationHeader argument, and deprecated the old method.

Bug: webrtc:6471
Change-Id: Icd3c536ebedd4e3c2d57fdb4d6e078d6ff1de5b6
Reviewed-on: https://webrtc-review.googlesource.com/75180
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23339}
This commit is contained in:
Niels Möller 2018-05-08 11:54:29 +02:00 committed by Commit Bot
parent 41c11e4cad
commit 401d07690b
7 changed files with 9 additions and 38 deletions

View File

@ -41,23 +41,4 @@ const char* VideoDecoder::ImplementationName() const {
return "unknown"; return "unknown";
} }
int32_t VideoDecoder::Decode(
const EncodedImage& input_image,
bool missing_frames,
const CodecSpecificInfo* codec_specific_info,
int64_t render_time_ms) {
return Decode(input_image, missing_frames, nullptr, codec_specific_info,
render_time_ms);
}
int32_t VideoDecoder::Decode(
const EncodedImage& input_image,
bool missing_frames,
const RTPFragmentationHeader* fragmentation,
const CodecSpecificInfo* codec_specific_info /* = NULL */,
int64_t render_time_ms /* = -1 */) {
return Decode(input_image, missing_frames, codec_specific_info,
render_time_ms);
}
} // namespace webrtc } // namespace webrtc

View File

@ -58,17 +58,7 @@ class VideoDecoder {
virtual int32_t Decode(const EncodedImage& input_image, virtual int32_t Decode(const EncodedImage& input_image,
bool missing_frames, bool missing_frames,
const CodecSpecificInfo* codec_specific_info, const CodecSpecificInfo* codec_specific_info,
int64_t render_time_ms); int64_t render_time_ms) = 0;
// TODO(nisse): Deprecated. Delete this method, and make the above pure
// virtual, after downstream projects are updated. The default implementations
// of this method and the above ensures that during the transition, subclasses
// can choose to implement one or the other.
virtual int32_t Decode(const EncodedImage& input_image,
bool missing_frames,
const RTPFragmentationHeader* fragmentation,
const CodecSpecificInfo* codec_specific_info = NULL,
int64_t render_time_ms = -1);
virtual int32_t RegisterDecodeCompleteCallback( virtual int32_t RegisterDecodeCompleteCallback(
DecodedImageCallback* callback) = 0; DecodedImageCallback* callback) = 0;

View File

@ -48,7 +48,7 @@ TEST_F(TestH264Impl, MAYBE_EncodeDecode) {
// First frame should be a key frame. // First frame should be a key frame.
encoded_frame._frameType = kVideoFrameKey; encoded_frame._frameType = kVideoFrameKey;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr)); decoder_->Decode(encoded_frame, false, nullptr, 0));
std::unique_ptr<VideoFrame> decoded_frame; std::unique_ptr<VideoFrame> decoded_frame;
rtc::Optional<uint8_t> decoded_qp; rtc::Optional<uint8_t> decoded_qp;
ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));
@ -65,7 +65,7 @@ TEST_F(TestH264Impl, MAYBE_DecodedQpEqualsEncodedQp) {
// First frame should be a key frame. // First frame should be a key frame.
encoded_frame._frameType = kVideoFrameKey; encoded_frame._frameType = kVideoFrameKey;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr)); decoder_->Decode(encoded_frame, false, nullptr, 0));
std::unique_ptr<VideoFrame> decoded_frame; std::unique_ptr<VideoFrame> decoded_frame;
rtc::Optional<uint8_t> decoded_qp; rtc::Optional<uint8_t> decoded_qp;
ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));

View File

@ -148,7 +148,7 @@ TEST_F(TestMultiplexAdapter, EncodeDecodeI420AFrame) {
EXPECT_EQ(kVideoCodecMultiplex, codec_specific_info.codecType); EXPECT_EQ(kVideoCodecMultiplex, codec_specific_info.codecType);
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr)); decoder_->Decode(encoded_frame, false, nullptr, 0));
std::unique_ptr<VideoFrame> decoded_frame; std::unique_ptr<VideoFrame> decoded_frame;
rtc::Optional<uint8_t> decoded_qp; rtc::Optional<uint8_t> decoded_qp;
ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));

View File

@ -497,7 +497,7 @@ void VideoProcessor::DecodeFrame(const EncodedImage& encoded_image,
frame_stat->decode_start_ns = rtc::TimeNanos(); frame_stat->decode_start_ns = rtc::TimeNanos();
frame_stat->decode_return_code = frame_stat->decode_return_code =
decoders_->at(spatial_idx)->Decode(encoded_image, false, nullptr); decoders_->at(spatial_idx)->Decode(encoded_image, false, nullptr, 0);
} }
const webrtc::EncodedImage* VideoProcessor::BuildAndStoreSuperframe( const webrtc::EncodedImage* VideoProcessor::BuildAndStoreSuperframe(

View File

@ -791,9 +791,9 @@ class TestVp8Simulcast : public ::testing::Test {
EncodedImage encoded_frame; EncodedImage encoded_frame;
// Only encoding one frame - so will be a key frame. // Only encoding one frame - so will be a key frame.
encoder_callback.GetLastEncodedKeyFrame(&encoded_frame); encoder_callback.GetLastEncodedKeyFrame(&encoded_frame);
EXPECT_EQ(0, decoder_->Decode(encoded_frame, false, NULL)); EXPECT_EQ(0, decoder_->Decode(encoded_frame, false, NULL, 0));
encoder_callback.GetLastEncodedFrame(&encoded_frame); encoder_callback.GetLastEncodedFrame(&encoded_frame);
decoder_->Decode(encoded_frame, false, NULL); decoder_->Decode(encoded_frame, false, NULL, 0);
EXPECT_EQ(2, decoder_callback.DecodedFrames()); EXPECT_EQ(2, decoder_callback.DecodedFrames());
} }

View File

@ -78,7 +78,7 @@ TEST_F(TestVp9Impl, EncodeDecode) {
// First frame should be a key frame. // First frame should be a key frame.
encoded_frame._frameType = kVideoFrameKey; encoded_frame._frameType = kVideoFrameKey;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr)); decoder_->Decode(encoded_frame, false, nullptr, 0));
std::unique_ptr<VideoFrame> decoded_frame; std::unique_ptr<VideoFrame> decoded_frame;
rtc::Optional<uint8_t> decoded_qp; rtc::Optional<uint8_t> decoded_qp;
ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));
@ -116,7 +116,7 @@ TEST_F(TestVp9Impl, DecodedQpEqualsEncodedQp) {
// First frame should be a key frame. // First frame should be a key frame.
encoded_frame._frameType = kVideoFrameKey; encoded_frame._frameType = kVideoFrameKey;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
decoder_->Decode(encoded_frame, false, nullptr)); decoder_->Decode(encoded_frame, false, nullptr, 0));
std::unique_ptr<VideoFrame> decoded_frame; std::unique_ptr<VideoFrame> decoded_frame;
rtc::Optional<uint8_t> decoded_qp; rtc::Optional<uint8_t> decoded_qp;
ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));