diff --git a/api/audio_codecs/audio_decoder.cc b/api/audio_codecs/audio_decoder.cc index 7bf30364bc..97cda27a03 100644 --- a/api/audio_codecs/audio_decoder.cc +++ b/api/audio_codecs/audio_decoder.cc @@ -135,14 +135,6 @@ size_t AudioDecoder::DecodePlc(size_t num_frames, int16_t* decoded) { void AudioDecoder::GeneratePlc(size_t /*requested_samples_per_channel*/, rtc::BufferT* /*concealment_audio*/) {} -int AudioDecoder::IncomingPacket(const uint8_t* payload, - size_t payload_len, - uint16_t rtp_sequence_number, - uint32_t rtp_timestamp, - uint32_t arrival_timestamp) { - return 0; -} - int AudioDecoder::ErrorCode() { return 0; } diff --git a/api/audio_codecs/audio_decoder.h b/api/audio_codecs/audio_decoder.h index a3b6a3165f..557ffe2759 100644 --- a/api/audio_codecs/audio_decoder.h +++ b/api/audio_codecs/audio_decoder.h @@ -143,13 +143,6 @@ class AudioDecoder { // Resets the decoder state (empty buffers etc.). virtual void Reset() = 0; - // Notifies the decoder of an incoming packet to NetEQ. - virtual int IncomingPacket(const uint8_t* payload, - size_t payload_len, - uint16_t rtp_sequence_number, - uint32_t rtp_timestamp, - uint32_t arrival_timestamp); - // Returns the last error code from the decoder. virtual int ErrorCode(); diff --git a/modules/audio_coding/acm2/audio_coding_module_unittest.cc b/modules/audio_coding/acm2/audio_coding_module_unittest.cc index 5b6808534d..a5946f96f9 100644 --- a/modules/audio_coding/acm2/audio_coding_module_unittest.cc +++ b/modules/audio_coding/acm2/audio_coding_module_unittest.cc @@ -973,10 +973,6 @@ TEST_F(AcmReceiverBitExactnessOldApi, 48kHzOutputExternalDecoder) { fact_(CreateBuiltinAudioDecoderFactory()) { // Set expectations on the mock decoder and also delegate the calls to // the real decoder. - EXPECT_CALL(*mock_decoder_, IncomingPacket(_, _, _, _, _)) - .Times(AtLeast(1)) - .WillRepeatedly( - Invoke(&pcmu_decoder_, &AudioDecoderPcmU::IncomingPacket)); EXPECT_CALL(*mock_decoder_, SampleRateHz()) .Times(AtLeast(1)) .WillRepeatedly( diff --git a/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h b/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h index 9af70543e1..23a302018f 100644 --- a/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h +++ b/modules/audio_coding/codecs/isac/audio_decoder_isac_t.h @@ -33,11 +33,6 @@ class AudioDecoderIsacT final : public AudioDecoder { bool HasDecodePlc() const override; size_t DecodePlc(size_t num_frames, int16_t* decoded) override; void Reset() override; - int IncomingPacket(const uint8_t* payload, - size_t payload_len, - uint16_t rtp_sequence_number, - uint32_t rtp_timestamp, - uint32_t arrival_timestamp) override; int ErrorCode() override; int SampleRateHz() const override; size_t Channels() const override; diff --git a/modules/audio_coding/codecs/isac/audio_decoder_isac_t_impl.h b/modules/audio_coding/codecs/isac/audio_decoder_isac_t_impl.h index 90c61b12eb..2e43fd317f 100644 --- a/modules/audio_coding/codecs/isac/audio_decoder_isac_t_impl.h +++ b/modules/audio_coding/codecs/isac/audio_decoder_isac_t_impl.h @@ -64,18 +64,6 @@ void AudioDecoderIsacT::Reset() { T::DecoderInit(isac_state_); } -template -int AudioDecoderIsacT::IncomingPacket(const uint8_t* payload, - size_t payload_len, - uint16_t rtp_sequence_number, - uint32_t rtp_timestamp, - uint32_t arrival_timestamp) { - int ret = T::UpdateBwEstimate(isac_state_, payload, payload_len, - rtp_sequence_number, rtp_timestamp, - arrival_timestamp); - return ret; -} - template int AudioDecoderIsacT::ErrorCode() { return T::GetErrorCode(isac_state_); diff --git a/modules/audio_coding/codecs/isac/fix/source/isac_fix_type.h b/modules/audio_coding/codecs/isac/fix/source/isac_fix_type.h index 076760bf90..512911a8bb 100644 --- a/modules/audio_coding/codecs/isac/fix/source/isac_fix_type.h +++ b/modules/audio_coding/codecs/isac/fix/source/isac_fix_type.h @@ -90,15 +90,6 @@ class IsacFix { int bottleneck_bits_per_second) { WebRtcIsacfix_SetInitialBweBottleneck(inst, bottleneck_bits_per_second); } - static inline int16_t UpdateBwEstimate(instance_type* inst, - const uint8_t* encoded, - size_t packet_size, - uint16_t rtp_seq_number, - uint32_t send_ts, - uint32_t arr_ts) { - return WebRtcIsacfix_UpdateBwEstimate(inst, encoded, packet_size, - rtp_seq_number, send_ts, arr_ts); - } static inline int16_t SetMaxPayloadSize(instance_type* inst, int16_t max_payload_size_bytes) { return WebRtcIsacfix_SetMaxPayloadSize(inst, max_payload_size_bytes); diff --git a/modules/audio_coding/codecs/isac/main/source/isac_float_type.h b/modules/audio_coding/codecs/isac/main/source/isac_float_type.h index 46d277bc00..511bc97ee6 100644 --- a/modules/audio_coding/codecs/isac/main/source/isac_float_type.h +++ b/modules/audio_coding/codecs/isac/main/source/isac_float_type.h @@ -87,15 +87,6 @@ struct IsacFloat { int bottleneck_bits_per_second) { WebRtcIsac_SetInitialBweBottleneck(inst, bottleneck_bits_per_second); } - static inline int16_t UpdateBwEstimate(instance_type* inst, - const uint8_t* encoded, - size_t packet_size, - uint16_t rtp_seq_number, - uint32_t send_ts, - uint32_t arr_ts) { - return WebRtcIsac_UpdateBwEstimate(inst, encoded, packet_size, - rtp_seq_number, send_ts, arr_ts); - } static inline int16_t SetMaxPayloadSize(instance_type* inst, int16_t max_payload_size_bytes) { return WebRtcIsac_SetMaxPayloadSize(inst, max_payload_size_bytes); diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index f17884224d..f1245ccce4 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -594,19 +594,6 @@ int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header, } } - // Update bandwidth estimate, if the packet is not comfort noise. - if (!packet_list.empty() && - !decoder_database_->IsComfortNoise(main_payload_type)) { - // The list can be empty here if we got nothing but DTMF payloads. - AudioDecoder* decoder = decoder_database_->GetDecoder(main_payload_type); - RTC_DCHECK(decoder); // Should always get a valid object, since we have - // already checked that the payload types are known. - decoder->IncomingPacket(packet_list.front().payload.data(), - packet_list.front().payload.size(), - packet_list.front().sequence_number, - packet_list.front().timestamp, receive_timestamp); - } - PacketList parsed_packet_list; while (!packet_list.empty()) { Packet& packet = packet_list.front(); diff --git a/modules/audio_coding/neteq/neteq_impl_unittest.cc b/modules/audio_coding/neteq/neteq_impl_unittest.cc index 39c4e521dd..2f152c9ac0 100644 --- a/modules/audio_coding/neteq/neteq_impl_unittest.cc +++ b/modules/audio_coding/neteq/neteq_impl_unittest.cc @@ -335,15 +335,6 @@ TEST_F(NetEqImplTest, InsertPacket) { std::unique_ptr mock_decoder(new MockAudioDecoder); EXPECT_CALL(*mock_decoder, Channels()).WillRepeatedly(Return(1)); EXPECT_CALL(*mock_decoder, SampleRateHz()).WillRepeatedly(Return(8000)); - // BWE update function called with first packet. - EXPECT_CALL(*mock_decoder, - IncomingPacket(_, kPayloadLength, kFirstSequenceNumber, - kFirstTimestamp, kFirstReceiveTime)); - // BWE update function called with second packet. - EXPECT_CALL( - *mock_decoder, - IncomingPacket(_, kPayloadLength, kFirstSequenceNumber + 1, - kFirstTimestamp + 160, kFirstReceiveTime + 155)); EXPECT_CALL(*mock_decoder, Die()).Times(1); // Called when deleted. *dec = std::move(mock_decoder); @@ -595,8 +586,6 @@ TEST_F(NetEqImplTest, ReorderedPacket) { EXPECT_CALL(mock_decoder, SampleRateHz()) .WillRepeatedly(Return(kSampleRateHz)); EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1)); - EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) - .WillRepeatedly(Return(0)); EXPECT_CALL(mock_decoder, PacketDuration(_, kPayloadLengthBytes)) .WillRepeatedly(Return(rtc::checked_cast(kPayloadLengthSamples))); int16_t dummy_output[kPayloadLengthSamples] = {0}; @@ -837,8 +826,6 @@ TEST_F(NetEqImplTest, CodecInternalCng) { EXPECT_CALL(mock_decoder, SampleRateHz()) .WillRepeatedly(Return(kSampleRateKhz * 1000)); EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1)); - EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) - .WillRepeatedly(Return(0)); EXPECT_CALL(mock_decoder, PacketDuration(_, kPayloadLengthBytes)) .WillRepeatedly(Return(rtc::checked_cast(kPayloadLengthSamples))); // Packed duration when asking the decoder for more CNG data (without a new @@ -1112,8 +1099,6 @@ TEST_F(NetEqImplTest, DecodedPayloadTooShort) { EXPECT_CALL(mock_decoder, SampleRateHz()) .WillRepeatedly(Return(kSampleRateHz)); EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1)); - EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) - .WillRepeatedly(Return(0)); EXPECT_CALL(mock_decoder, PacketDuration(_, _)) .WillRepeatedly(Return(rtc::checked_cast(kPayloadLengthSamples))); int16_t dummy_output[kPayloadLengthSamples] = {0}; @@ -1181,8 +1166,6 @@ TEST_F(NetEqImplTest, DecodingError) { EXPECT_CALL(mock_decoder, SampleRateHz()) .WillRepeatedly(Return(kSampleRateHz)); EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1)); - EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) - .WillRepeatedly(Return(0)); EXPECT_CALL(mock_decoder, PacketDuration(_, _)) .WillRepeatedly(Return(rtc::checked_cast(kFrameLengthSamples))); EXPECT_CALL(mock_decoder, ErrorCode()).WillOnce(Return(kDecoderErrorCode)); @@ -1297,8 +1280,6 @@ TEST_F(NetEqImplTest, DecodingErrorDuringInternalCng) { EXPECT_CALL(mock_decoder, SampleRateHz()) .WillRepeatedly(Return(kSampleRateHz)); EXPECT_CALL(mock_decoder, Channels()).WillRepeatedly(Return(1)); - EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) - .WillRepeatedly(Return(0)); EXPECT_CALL(mock_decoder, PacketDuration(_, _)) .WillRepeatedly(Return(rtc::checked_cast(kFrameLengthSamples))); EXPECT_CALL(mock_decoder, ErrorCode()).WillOnce(Return(kDecoderErrorCode)); diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc index 435c523c38..2c8d6ea6de 100644 --- a/pc/peer_connection_end_to_end_unittest.cc +++ b/pc/peer_connection_end_to_end_unittest.cc @@ -240,15 +240,6 @@ std::unique_ptr CreateForwardingMockDecoder( EXPECT_CALL(*mock_decoder, HasDecodePlc()).WillRepeatedly(Invoke([dec] { return dec->HasDecodePlc(); })); - EXPECT_CALL(*mock_decoder, IncomingPacket(_, _, _, _, _)) - .Times(AtLeast(1)) - .WillRepeatedly(Invoke([dec](const uint8_t* payload, size_t payload_len, - uint16_t rtp_sequence_number, - uint32_t rtp_timestamp, - uint32_t arrival_timestamp) { - return dec->IncomingPacket(payload, payload_len, rtp_sequence_number, - rtp_timestamp, arrival_timestamp); - })); EXPECT_CALL(*mock_decoder, PacketDuration(_, _)) .Times(AtLeast(1)) .WillRepeatedly(Invoke([dec](const uint8_t* encoded, size_t encoded_len) { diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 0703a8961f..2b272aa368 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -296,16 +296,6 @@ webrtc_fuzzer_test("audio_decoder_isac_fuzzer") { ] } -webrtc_fuzzer_test("audio_decoder_isac_incoming_packet_fuzzer") { - sources = [ - "audio_decoder_isac_incoming_packet_fuzzer.cc", - ] - deps = [ - ":audio_decoder_fuzzer", - "../../modules/audio_coding:isac", - ] -} - webrtc_fuzzer_test("audio_decoder_isacfix_fuzzer") { sources = [ "audio_decoder_isacfix_fuzzer.cc", diff --git a/test/fuzzers/audio_decoder_fuzzer.cc b/test/fuzzers/audio_decoder_fuzzer.cc index 2b4003b5e1..9c9bbf69d5 100644 --- a/test/fuzzers/audio_decoder_fuzzer.cc +++ b/test/fuzzers/audio_decoder_fuzzer.cc @@ -74,31 +74,4 @@ void FuzzAudioDecoder(DecoderFunctionType decode_type, } } -// This function is similar to FuzzAudioDecoder, but also reads fuzzed data into -// RTP header values. The fuzzed data and values are sent to the decoder's -// IncomingPacket method. -void FuzzAudioDecoderIncomingPacket(const uint8_t* data, - size_t size, - AudioDecoder* decoder) { - const uint8_t* data_ptr = data; - size_t remaining_size = size; - size_t packet_len; - while (ParseInt(&data_ptr, &remaining_size, &packet_len)) { - uint16_t rtp_sequence_number; - if (!ParseInt(&data_ptr, &remaining_size, &rtp_sequence_number)) - break; - uint32_t rtp_timestamp; - if (!ParseInt(&data_ptr, &remaining_size, &rtp_timestamp)) - break; - uint32_t arrival_timestamp; - if (!ParseInt(&data_ptr, &remaining_size, &arrival_timestamp)) - break; - if (remaining_size < packet_len) - break; - decoder->IncomingPacket(data_ptr, packet_len, rtp_sequence_number, - rtp_timestamp, arrival_timestamp); - data_ptr += packet_len; - remaining_size -= packet_len; - } -} } // namespace webrtc diff --git a/test/fuzzers/audio_decoder_fuzzer.h b/test/fuzzers/audio_decoder_fuzzer.h index b935004220..8c5246bb5e 100644 --- a/test/fuzzers/audio_decoder_fuzzer.h +++ b/test/fuzzers/audio_decoder_fuzzer.h @@ -31,9 +31,6 @@ void FuzzAudioDecoder(DecoderFunctionType decode_type, size_t max_decoded_bytes, int16_t* decoded); -void FuzzAudioDecoderIncomingPacket(const uint8_t* data, - size_t size, - AudioDecoder* decoder); } // namespace webrtc #endif // TEST_FUZZERS_AUDIO_DECODER_FUZZER_H_ diff --git a/test/fuzzers/audio_decoder_isac_incoming_packet_fuzzer.cc b/test/fuzzers/audio_decoder_isac_incoming_packet_fuzzer.cc deleted file mode 100644 index a67ac59abd..0000000000 --- a/test/fuzzers/audio_decoder_isac_incoming_packet_fuzzer.cc +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "modules/audio_coding/codecs/isac/main/include/audio_decoder_isac.h" -#include "test/fuzzers/audio_decoder_fuzzer.h" - -namespace webrtc { -void FuzzOneInput(const uint8_t* data, size_t size) { - if (size > 20000) { - return; - } - AudioDecoderIsacFloatImpl::Config c; - c.sample_rate_hz = 16000; - AudioDecoderIsacFloatImpl dec(c); - FuzzAudioDecoderIncomingPacket(data, size, &dec); -} -} // namespace webrtc diff --git a/test/mock_audio_decoder.h b/test/mock_audio_decoder.h index 67cd0f775c..7c6db5acc2 100644 --- a/test/mock_audio_decoder.h +++ b/test/mock_audio_decoder.h @@ -26,8 +26,6 @@ class MockAudioDecoder : public AudioDecoder { MOCK_CONST_METHOD0(HasDecodePlc, bool()); MOCK_METHOD2(DecodePlc, size_t(size_t, int16_t*)); MOCK_METHOD0(Reset, void()); - MOCK_METHOD5(IncomingPacket, - int(const uint8_t*, size_t, uint16_t, uint32_t, uint32_t)); MOCK_METHOD0(ErrorCode, int()); MOCK_CONST_METHOD2(PacketDuration, int(const uint8_t*, size_t)); MOCK_CONST_METHOD0(Channels, size_t());