From 401d07690b2086dfffad24dda1799ff207b34c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Tue, 8 May 2018 11:54:29 +0200 Subject: [PATCH] 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 Reviewed-by: Rasmus Brandt Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#23339} --- api/video_codecs/video_decoder.cc | 19 ------------------- api/video_codecs/video_decoder.h | 12 +----------- .../codecs/h264/test/h264_impl_unittest.cc | 4 ++-- .../test/multiplex_adapter_unittest.cc | 2 +- .../codecs/test/videoprocessor.cc | 2 +- .../codecs/vp8/simulcast_test_utility.h | 4 ++-- .../codecs/vp9/test/vp9_impl_unittest.cc | 4 ++-- 7 files changed, 9 insertions(+), 38 deletions(-) diff --git a/api/video_codecs/video_decoder.cc b/api/video_codecs/video_decoder.cc index 7117a101f8..4e8db88370 100644 --- a/api/video_codecs/video_decoder.cc +++ b/api/video_codecs/video_decoder.cc @@ -41,23 +41,4 @@ const char* VideoDecoder::ImplementationName() const { 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 diff --git a/api/video_codecs/video_decoder.h b/api/video_codecs/video_decoder.h index ee72736f8b..c4350948ce 100644 --- a/api/video_codecs/video_decoder.h +++ b/api/video_codecs/video_decoder.h @@ -58,17 +58,7 @@ class VideoDecoder { virtual int32_t Decode(const EncodedImage& input_image, bool missing_frames, const CodecSpecificInfo* codec_specific_info, - int64_t render_time_ms); - - // 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); + int64_t render_time_ms) = 0; virtual int32_t RegisterDecodeCompleteCallback( DecodedImageCallback* callback) = 0; diff --git a/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc b/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc index 04a0f1f403..a9d790e169 100644 --- a/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc +++ b/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc @@ -48,7 +48,7 @@ TEST_F(TestH264Impl, MAYBE_EncodeDecode) { // First frame should be a key frame. encoded_frame._frameType = kVideoFrameKey; EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, - decoder_->Decode(encoded_frame, false, nullptr)); + decoder_->Decode(encoded_frame, false, nullptr, 0)); std::unique_ptr decoded_frame; rtc::Optional 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. encoded_frame._frameType = kVideoFrameKey; EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, - decoder_->Decode(encoded_frame, false, nullptr)); + decoder_->Decode(encoded_frame, false, nullptr, 0)); std::unique_ptr decoded_frame; rtc::Optional decoded_qp; ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); diff --git a/modules/video_coding/codecs/multiplex/test/multiplex_adapter_unittest.cc b/modules/video_coding/codecs/multiplex/test/multiplex_adapter_unittest.cc index ca5df06993..1e141d7dc0 100644 --- a/modules/video_coding/codecs/multiplex/test/multiplex_adapter_unittest.cc +++ b/modules/video_coding/codecs/multiplex/test/multiplex_adapter_unittest.cc @@ -148,7 +148,7 @@ TEST_F(TestMultiplexAdapter, EncodeDecodeI420AFrame) { EXPECT_EQ(kVideoCodecMultiplex, codec_specific_info.codecType); EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, - decoder_->Decode(encoded_frame, false, nullptr)); + decoder_->Decode(encoded_frame, false, nullptr, 0)); std::unique_ptr decoded_frame; rtc::Optional decoded_qp; ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); diff --git a/modules/video_coding/codecs/test/videoprocessor.cc b/modules/video_coding/codecs/test/videoprocessor.cc index f6d27389e6..50322f8ccf 100644 --- a/modules/video_coding/codecs/test/videoprocessor.cc +++ b/modules/video_coding/codecs/test/videoprocessor.cc @@ -497,7 +497,7 @@ void VideoProcessor::DecodeFrame(const EncodedImage& encoded_image, frame_stat->decode_start_ns = rtc::TimeNanos(); 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( diff --git a/modules/video_coding/codecs/vp8/simulcast_test_utility.h b/modules/video_coding/codecs/vp8/simulcast_test_utility.h index f0b1cccdc8..2ef28429f8 100644 --- a/modules/video_coding/codecs/vp8/simulcast_test_utility.h +++ b/modules/video_coding/codecs/vp8/simulcast_test_utility.h @@ -791,9 +791,9 @@ class TestVp8Simulcast : public ::testing::Test { EncodedImage encoded_frame; // Only encoding one frame - so will be a key 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); - decoder_->Decode(encoded_frame, false, NULL); + decoder_->Decode(encoded_frame, false, NULL, 0); EXPECT_EQ(2, decoder_callback.DecodedFrames()); } diff --git a/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc b/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc index be6b451776..639ff7c558 100644 --- a/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc +++ b/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc @@ -78,7 +78,7 @@ TEST_F(TestVp9Impl, EncodeDecode) { // First frame should be a key frame. encoded_frame._frameType = kVideoFrameKey; EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, - decoder_->Decode(encoded_frame, false, nullptr)); + decoder_->Decode(encoded_frame, false, nullptr, 0)); std::unique_ptr decoded_frame; rtc::Optional decoded_qp; ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp)); @@ -116,7 +116,7 @@ TEST_F(TestVp9Impl, DecodedQpEqualsEncodedQp) { // First frame should be a key frame. encoded_frame._frameType = kVideoFrameKey; EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, - decoder_->Decode(encoded_frame, false, nullptr)); + decoder_->Decode(encoded_frame, false, nullptr, 0)); std::unique_ptr decoded_frame; rtc::Optional decoded_qp; ASSERT_TRUE(WaitForDecodedFrame(&decoded_frame, &decoded_qp));