Remove various IDs:
- AudioFrame
- AudioCodingModule
BUG=webrtc:4690
TBR=kwiberg@webrtc.org
Review-Url: https://codereview.webrtc.org/3019543002
Cr-Original-Commit-Position: refs/heads/master@{#20005}
Committed: https://webrtc.googlesource.com/src/+/2d0f77585d556d8b11d6269d35149ae9ca14c472
Review-Url: https://codereview.webrtc.org/3019543002
Cr-Commit-Position: refs/heads/master@{#20019}
diff --git a/modules/audio_coding/acm2/acm_receive_test.cc b/modules/audio_coding/acm2/acm_receive_test.cc
index 6cfe464..082506a 100644
--- a/modules/audio_coding/acm2/acm_receive_test.cc
+++ b/modules/audio_coding/acm2/acm_receive_test.cc
@@ -110,7 +110,6 @@
Clock* clock,
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory) {
AudioCodingModule::Config config;
- config.id = 0;
config.clock = clock;
config.decoder_factory = std::move(decoder_factory);
return config;
diff --git a/modules/audio_coding/acm2/acm_send_test.cc b/modules/audio_coding/acm2/acm_send_test.cc
index d5f196b..307c906 100644
--- a/modules/audio_coding/acm2/acm_send_test.cc
+++ b/modules/audio_coding/acm2/acm_send_test.cc
@@ -28,7 +28,7 @@
int source_rate_hz,
int test_duration_ms)
: clock_(0),
- acm_(webrtc::AudioCodingModule::Create(0, &clock_)),
+ acm_(webrtc::AudioCodingModule::Create(&clock_)),
audio_source_(audio_source),
source_rate_hz_(source_rate_hz),
input_block_size_samples_(
diff --git a/modules/audio_coding/acm2/audio_coding_module.cc b/modules/audio_coding/acm2/audio_coding_module.cc
index 5997d12..2778610 100644
--- a/modules/audio_coding/acm2/audio_coding_module.cc
+++ b/modules/audio_coding/acm2/audio_coding_module.cc
@@ -269,7 +269,6 @@
rtc::CriticalSection acm_crit_sect_;
rtc::Buffer encode_buffer_ RTC_GUARDED_BY(acm_crit_sect_);
- int id_; // TODO(henrik.lundin) Make const.
uint32_t expected_codec_ts_ RTC_GUARDED_BY(acm_crit_sect_);
uint32_t expected_in_ts_ RTC_GUARDED_BY(acm_crit_sect_);
acm2::ACMResampler resampler_ RTC_GUARDED_BY(acm_crit_sect_);
@@ -456,8 +455,7 @@
AudioCodingModuleImpl::AudioCodingModuleImpl(
const AudioCodingModule::Config& config)
- : id_(config.id),
- expected_codec_ts_(0xD87F3F9F),
+ : expected_codec_ts_(0xD87F3F9F),
expected_in_ts_(0xD87F3F9F),
receiver_(config),
bitrate_logger_("WebRTC.Audio.TargetBitrateInKbps"),
@@ -1120,7 +1118,6 @@
LOG(LS_ERROR) << "PlayoutData failed, RecOut Failed";
return -1;
}
- audio_frame->id_ = id_;
return 0;
}
@@ -1286,7 +1283,7 @@
} // namespace
AudioCodingModule::Config::Config()
- : id(0), neteq_config(), clock(Clock::GetRealTimeClock()) {
+ : neteq_config(), clock(Clock::GetRealTimeClock()) {
// Post-decode VAD is disabled by default in NetEq, however, Audio
// Conference Mixer relies on VAD decisions and fails without them.
neteq_config.enable_post_decode_vad = true;
@@ -1295,18 +1292,21 @@
AudioCodingModule::Config::Config(const Config&) = default;
AudioCodingModule::Config::~Config() = default;
-// Create module
AudioCodingModule* AudioCodingModule::Create(int id) {
+ RTC_UNUSED(id);
+ return Create();
+}
+
+// Create module
+AudioCodingModule* AudioCodingModule::Create() {
Config config;
- config.id = id;
config.clock = Clock::GetRealTimeClock();
config.decoder_factory = CreateBuiltinAudioDecoderFactory();
return Create(config);
}
-AudioCodingModule* AudioCodingModule::Create(int id, Clock* clock) {
+AudioCodingModule* AudioCodingModule::Create(Clock* clock) {
Config config;
- config.id = id;
config.clock = clock;
config.decoder_factory = CreateBuiltinAudioDecoderFactory();
return Create(config);
diff --git a/modules/audio_coding/acm2/audio_coding_module_unittest.cc b/modules/audio_coding/acm2/audio_coding_module_unittest.cc
index 80fc4d8..a010619 100644
--- a/modules/audio_coding/acm2/audio_coding_module_unittest.cc
+++ b/modules/audio_coding/acm2/audio_coding_module_unittest.cc
@@ -157,8 +157,7 @@
class AudioCodingModuleTestOldApi : public ::testing::Test {
protected:
AudioCodingModuleTestOldApi()
- : id_(1),
- rtp_utility_(new RtpUtility(kFrameSizeSamples, kPayloadType)),
+ : rtp_utility_(new RtpUtility(kFrameSizeSamples, kPayloadType)),
clock_(Clock::GetRealTimeClock()) {}
~AudioCodingModuleTestOldApi() {}
@@ -166,7 +165,7 @@
void TearDown() {}
void SetUp() {
- acm_.reset(AudioCodingModule::Create(id_, clock_));
+ acm_.reset(AudioCodingModule::Create(clock_));
rtp_utility_->Populate(&rtp_header_);
@@ -230,7 +229,6 @@
VerifyEncoding();
}
- const int id_;
std::unique_ptr<RtpUtility> rtp_utility_;
std::unique_ptr<AudioCodingModule> acm_;
PacketizationCallbackStubOldApi packet_cb_;
@@ -314,7 +312,6 @@
bool muted;
EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame, &muted));
ASSERT_FALSE(muted);
- EXPECT_EQ(id_, audio_frame.id_);
EXPECT_EQ(0u, audio_frame.timestamp_);
EXPECT_GT(audio_frame.num_channels_, 0u);
EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100),
diff --git a/modules/audio_coding/include/audio_coding_module.h b/modules/audio_coding/include/audio_coding_module.h
index 944ad60..2013cd7 100644
--- a/modules/audio_coding/include/audio_coding_module.h
+++ b/modules/audio_coding/include/audio_coding_module.h
@@ -70,7 +70,6 @@
Config(const Config&);
~Config();
- int id;
NetEq::Config neteq_config;
Clock* clock;
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory;
@@ -83,8 +82,10 @@
// injected into ACM. ACM will take the ownership of the object clock and
// delete it when destroyed.
//
- static AudioCodingModule* Create(int id);
- static AudioCodingModule* Create(int id, Clock* clock);
+ // TODO(solenberg): Remove once downstream projects are updated.
+ RTC_DEPRECATED static AudioCodingModule* Create(int id);
+ static AudioCodingModule* Create();
+ static AudioCodingModule* Create(Clock* clock);
static AudioCodingModule* Create(const Config& config);
virtual ~AudioCodingModule() = default;
diff --git a/modules/audio_coding/test/APITest.cc b/modules/audio_coding/test/APITest.cc
index 5418342..b29e84e 100644
--- a/modules/audio_coding/test/APITest.cc
+++ b/modules/audio_coding/test/APITest.cc
@@ -48,8 +48,8 @@
}
APITest::APITest()
- : _acmA(AudioCodingModule::Create(1)),
- _acmB(AudioCodingModule::Create(2)),
+ : _acmA(AudioCodingModule::Create()),
+ _acmB(AudioCodingModule::Create()),
_channel_A2B(NULL),
_channel_B2A(NULL),
_writeToFile(true),
diff --git a/modules/audio_coding/test/EncodeDecodeTest.cc b/modules/audio_coding/test/EncodeDecodeTest.cc
index 8257ed9..2b6b4ac 100644
--- a/modules/audio_coding/test/EncodeDecodeTest.cc
+++ b/modules/audio_coding/test/EncodeDecodeTest.cc
@@ -281,7 +281,7 @@
codePars[1] = 0;
codePars[2] = 0;
- std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(0));
+ std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create());
struct CodecInst sendCodecTmp;
numCodecs = acm->NumberOfCodecs();
@@ -337,7 +337,7 @@
int codeId,
int* codePars,
int testMode) {
- std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(1));
+ std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create());
RTPFile rtpFile;
std::string fileName = webrtc::test::TempFilename(webrtc::test::OutputPath(),
"encode_decode_rtp");
diff --git a/modules/audio_coding/test/PacketLossTest.cc b/modules/audio_coding/test/PacketLossTest.cc
index c80615a..a6c56fa7 100644
--- a/modules/audio_coding/test/PacketLossTest.cc
+++ b/modules/audio_coding/test/PacketLossTest.cc
@@ -127,7 +127,7 @@
#ifndef WEBRTC_CODEC_OPUS
return;
#else
- std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create(0));
+ std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create());
int codec_id = acm->Codec("opus", 48000, channels_);
diff --git a/modules/audio_coding/test/TestAllCodecs.cc b/modules/audio_coding/test/TestAllCodecs.cc
index 74319c2..ff28a28 100644
--- a/modules/audio_coding/test/TestAllCodecs.cc
+++ b/modules/audio_coding/test/TestAllCodecs.cc
@@ -104,8 +104,8 @@
}
TestAllCodecs::TestAllCodecs(int test_mode)
- : acm_a_(AudioCodingModule::Create(0)),
- acm_b_(AudioCodingModule::Create(1)),
+ : acm_a_(AudioCodingModule::Create()),
+ acm_b_(AudioCodingModule::Create()),
channel_a_to_b_(NULL),
test_count_(0),
packet_size_samples_(0),
diff --git a/modules/audio_coding/test/TestRedFec.cc b/modules/audio_coding/test/TestRedFec.cc
index 3e88290..58561c6 100644
--- a/modules/audio_coding/test/TestRedFec.cc
+++ b/modules/audio_coding/test/TestRedFec.cc
@@ -48,8 +48,8 @@
}
TestRedFec::TestRedFec()
- : _acmA(AudioCodingModule::Create(0)),
- _acmB(AudioCodingModule::Create(1)),
+ : _acmA(AudioCodingModule::Create()),
+ _acmB(AudioCodingModule::Create()),
_channelA2B(NULL),
_testCntr(0) {
}
diff --git a/modules/audio_coding/test/TestStereo.cc b/modules/audio_coding/test/TestStereo.cc
index d598191..eca81f8 100644
--- a/modules/audio_coding/test/TestStereo.cc
+++ b/modules/audio_coding/test/TestStereo.cc
@@ -108,8 +108,8 @@
}
TestStereo::TestStereo(int test_mode)
- : acm_a_(AudioCodingModule::Create(0)),
- acm_b_(AudioCodingModule::Create(1)),
+ : acm_a_(AudioCodingModule::Create()),
+ acm_b_(AudioCodingModule::Create()),
channel_a2b_(NULL),
test_cntr_(0),
pack_size_samp_(0),
diff --git a/modules/audio_coding/test/TestVADDTX.cc b/modules/audio_coding/test/TestVADDTX.cc
index 1aa00b5..628582d 100644
--- a/modules/audio_coding/test/TestVADDTX.cc
+++ b/modules/audio_coding/test/TestVADDTX.cc
@@ -62,8 +62,8 @@
}
TestVadDtx::TestVadDtx()
- : acm_send_(AudioCodingModule::Create(0)),
- acm_receive_(AudioCodingModule::Create(1)),
+ : acm_send_(AudioCodingModule::Create()),
+ acm_receive_(AudioCodingModule::Create()),
channel_(new Channel),
monitor_(new ActivityMonitor) {
EXPECT_EQ(0, acm_send_->RegisterTransportCallback(channel_.get()));
diff --git a/modules/audio_coding/test/TwoWayCommunication.cc b/modules/audio_coding/test/TwoWayCommunication.cc
index addb717..8049436 100644
--- a/modules/audio_coding/test/TwoWayCommunication.cc
+++ b/modules/audio_coding/test/TwoWayCommunication.cc
@@ -34,16 +34,14 @@
#define MAX_FILE_NAME_LENGTH_BYTE 500
TwoWayCommunication::TwoWayCommunication(int testMode)
- : _acmA(AudioCodingModule::Create(1)),
- _acmRefA(AudioCodingModule::Create(3)),
+ : _acmA(AudioCodingModule::Create()),
+ _acmRefA(AudioCodingModule::Create()),
_testMode(testMode) {
AudioCodingModule::Config config;
// The clicks will be more obvious in FAX mode. TODO(henrik.lundin) Really?
config.neteq_config.playout_mode = kPlayoutFax;
- config.id = 2;
config.decoder_factory = CreateBuiltinAudioDecoderFactory();
_acmB.reset(AudioCodingModule::Create(config));
- config.id = 4;
_acmRefB.reset(AudioCodingModule::Create(config));
}
@@ -62,7 +60,7 @@
void TwoWayCommunication::ChooseCodec(uint8_t* codecID_A,
uint8_t* codecID_B) {
- std::unique_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create(0));
+ std::unique_ptr<AudioCodingModule> tmpACM(AudioCodingModule::Create());
uint8_t noCodec = tmpACM->NumberOfCodecs();
CodecInst codecInst;
printf("List of Supported Codecs\n");
diff --git a/modules/audio_coding/test/delay_test.cc b/modules/audio_coding/test/delay_test.cc
index 3f78ea6..407f709 100644
--- a/modules/audio_coding/test/delay_test.cc
+++ b/modules/audio_coding/test/delay_test.cc
@@ -64,8 +64,8 @@
class DelayTest {
public:
DelayTest()
- : acm_a_(AudioCodingModule::Create(0)),
- acm_b_(AudioCodingModule::Create(1)),
+ : acm_a_(AudioCodingModule::Create()),
+ acm_b_(AudioCodingModule::Create()),
channel_a2b_(new Channel),
test_cntr_(0),
encoding_sample_rate_hz_(8000) {}
diff --git a/modules/audio_coding/test/iSACTest.cc b/modules/audio_coding/test/iSACTest.cc
index a14f795..a44259f 100644
--- a/modules/audio_coding/test/iSACTest.cc
+++ b/modules/audio_coding/test/iSACTest.cc
@@ -67,8 +67,8 @@
}
ISACTest::ISACTest(int testMode)
- : _acmA(AudioCodingModule::Create(1)),
- _acmB(AudioCodingModule::Create(2)),
+ : _acmA(AudioCodingModule::Create()),
+ _acmB(AudioCodingModule::Create()),
_testMode(testMode) {}
ISACTest::~ISACTest() {}
diff --git a/modules/audio_coding/test/insert_packet_with_timing.cc b/modules/audio_coding/test/insert_packet_with_timing.cc
index 500375c..2c0e54b 100644
--- a/modules/audio_coding/test/insert_packet_with_timing.cc
+++ b/modules/audio_coding/test/insert_packet_with_timing.cc
@@ -61,8 +61,8 @@
InsertPacketWithTiming()
: sender_clock_(new SimulatedClock(0)),
receiver_clock_(new SimulatedClock(0)),
- send_acm_(AudioCodingModule::Create(0, sender_clock_)),
- receive_acm_(AudioCodingModule::Create(0, receiver_clock_)),
+ send_acm_(AudioCodingModule::Create(sender_clock_)),
+ receive_acm_(AudioCodingModule::Create(receiver_clock_)),
channel_(new Channel),
seq_num_fid_(fopen(FLAG_seq_num, "rt")),
send_ts_fid_(fopen(FLAG_send_ts, "rt")),
diff --git a/modules/audio_coding/test/opus_test.cc b/modules/audio_coding/test/opus_test.cc
index 7b54668..b7acc0f 100644
--- a/modules/audio_coding/test/opus_test.cc
+++ b/modules/audio_coding/test/opus_test.cc
@@ -27,7 +27,7 @@
namespace webrtc {
OpusTest::OpusTest()
- : acm_receiver_(AudioCodingModule::Create(0)),
+ : acm_receiver_(AudioCodingModule::Create()),
channel_a2b_(NULL),
counter_(0),
payload_type_(255),
diff --git a/modules/audio_coding/test/target_delay_unittest.cc b/modules/audio_coding/test/target_delay_unittest.cc
index 2a75706..03135da 100644
--- a/modules/audio_coding/test/target_delay_unittest.cc
+++ b/modules/audio_coding/test/target_delay_unittest.cc
@@ -22,7 +22,7 @@
class TargetDelayTest : public ::testing::Test {
protected:
- TargetDelayTest() : acm_(AudioCodingModule::Create(0)) {}
+ TargetDelayTest() : acm_(AudioCodingModule::Create()) {}
~TargetDelayTest() {}
diff --git a/modules/audio_mixer/audio_mixer_impl_unittest.cc b/modules/audio_mixer/audio_mixer_impl_unittest.cc
index 678f625..4461e6e 100644
--- a/modules/audio_mixer/audio_mixer_impl_unittest.cc
+++ b/modules/audio_mixer/audio_mixer_impl_unittest.cc
@@ -35,12 +35,10 @@
namespace {
constexpr int kDefaultSampleRateHz = 48000;
-constexpr int kId = 1;
// Utility function that resets the frame member variables with
// sensible defaults.
void ResetFrame(AudioFrame* frame) {
- frame->id_ = kId;
frame->sample_rate_hz_ = kDefaultSampleRateHz;
frame->num_channels_ = 1;
diff --git a/modules/audio_mixer/frame_combiner.cc b/modules/audio_mixer/frame_combiner.cc
index 9e9bcfa..8000904 100644
--- a/modules/audio_mixer/frame_combiner.cc
+++ b/modules/audio_mixer/frame_combiner.cc
@@ -193,7 +193,7 @@
// value '0', because it is only supported in the one channel case and
// is then updated in the helper functions.
audio_frame_for_mixing->UpdateFrame(
- -1, 0, nullptr, samples_per_channel, sample_rate, AudioFrame::kUndefined,
+ 0, nullptr, samples_per_channel, sample_rate, AudioFrame::kUndefined,
AudioFrame::kVadUnknown, number_of_channels);
const bool use_limiter_this_round = use_apm_limiter_ && number_of_streams > 1;
diff --git a/modules/audio_mixer/frame_combiner_unittest.cc b/modules/audio_mixer/frame_combiner_unittest.cc
index 5681436..490e99e 100644
--- a/modules/audio_mixer/frame_combiner_unittest.cc
+++ b/modules/audio_mixer/frame_combiner_unittest.cc
@@ -53,8 +53,7 @@
void SetUpFrames(int sample_rate_hz, int number_of_channels) {
for (auto* frame : {&frame1, &frame2}) {
- frame->UpdateFrame(-1, 0, nullptr,
- rtc::CheckedDivExact(sample_rate_hz, 100),
+ frame->UpdateFrame(0, nullptr, rtc::CheckedDivExact(sample_rate_hz, 100),
sample_rate_hz, AudioFrame::kNormalSpeech,
AudioFrame::kVadActive, number_of_channels);
}
diff --git a/modules/include/module_common_types.h b/modules/include/module_common_types.h
index bc5c347..c3ad993 100644
--- a/modules/include/module_common_types.h
+++ b/modules/include/module_common_types.h
@@ -330,7 +330,18 @@
// ResetWithoutMuting() to skip this wasteful zeroing.
void ResetWithoutMuting();
- void UpdateFrame(int id, uint32_t timestamp, const int16_t* data,
+ // TODO(solenberg): Remove once downstream users of AudioFrame have updated.
+ RTC_DEPRECATED
+ void UpdateFrame(int id, uint32_t timestamp, const int16_t* data,
+ size_t samples_per_channel, int sample_rate_hz,
+ SpeechType speech_type, VADActivity vad_activity,
+ size_t num_channels = 1) {
+ RTC_UNUSED(id);
+ UpdateFrame(timestamp, data, samples_per_channel, sample_rate_hz,
+ speech_type, vad_activity, num_channels);
+ }
+
+ void UpdateFrame(uint32_t timestamp, const int16_t* data,
size_t samples_per_channel, int sample_rate_hz,
SpeechType speech_type, VADActivity vad_activity,
size_t num_channels = 1);
@@ -366,7 +377,6 @@
RTC_DEPRECATED AudioFrame& operator>>=(const int rhs);
RTC_DEPRECATED AudioFrame& operator+=(const AudioFrame& rhs);
- int id_;
// RTP timestamp of the first sample in the AudioFrame.
uint32_t timestamp_ = 0;
// Time since the first frame in milliseconds.
@@ -414,7 +424,6 @@
}
inline void AudioFrame::ResetWithoutMuting() {
- id_ = -1;
// TODO(wu): Zero is a valid value for |timestamp_|. We should initialize
// to an invalid value, or add a new member to indicate invalidity.
timestamp_ = 0;
@@ -428,15 +437,13 @@
profile_timestamp_ms_ = 0;
}
-inline void AudioFrame::UpdateFrame(int id,
- uint32_t timestamp,
+inline void AudioFrame::UpdateFrame(uint32_t timestamp,
const int16_t* data,
size_t samples_per_channel,
int sample_rate_hz,
SpeechType speech_type,
VADActivity vad_activity,
size_t num_channels) {
- id_ = id;
timestamp_ = timestamp;
samples_per_channel_ = samples_per_channel;
sample_rate_hz_ = sample_rate_hz;
@@ -457,7 +464,6 @@
inline void AudioFrame::CopyFrom(const AudioFrame& src) {
if (this == &src) return;
- id_ = src.id_;
timestamp_ = src.timestamp_;
elapsed_time_ms_ = src.elapsed_time_ms_;
ntp_time_ms_ = src.ntp_time_ms_;
diff --git a/modules/module_common_types_unittest.cc b/modules/module_common_types_unittest.cc
index f601a59..c8bb5f9 100644
--- a/modules/module_common_types_unittest.cc
+++ b/modules/module_common_types_unittest.cc
@@ -28,7 +28,6 @@
return true;
}
-constexpr int kId = 16;
constexpr uint32_t kTimestamp = 27;
constexpr int kSampleRateHz = 16000;
constexpr size_t kNumChannels = 1;
@@ -64,10 +63,9 @@
TEST(AudioFrameTest, UpdateFrame) {
AudioFrame frame;
int16_t samples[kNumChannels * kSamplesPerChannel] = {17};
- frame.UpdateFrame(kId, kTimestamp, samples, kSamplesPerChannel, kSampleRateHz,
+ frame.UpdateFrame(kTimestamp, samples, kSamplesPerChannel, kSampleRateHz,
AudioFrame::kPLC, AudioFrame::kVadActive, kNumChannels);
- EXPECT_EQ(kId, frame.id_);
EXPECT_EQ(kTimestamp, frame.timestamp_);
EXPECT_EQ(kSamplesPerChannel, frame.samples_per_channel_);
EXPECT_EQ(kSampleRateHz, frame.sample_rate_hz_);
@@ -78,7 +76,7 @@
EXPECT_FALSE(frame.muted());
EXPECT_EQ(0, memcmp(samples, frame.data(), sizeof(samples)));
- frame.UpdateFrame(kId, kTimestamp, nullptr /* data*/, kSamplesPerChannel,
+ frame.UpdateFrame(kTimestamp, nullptr /* data*/, kSamplesPerChannel,
kSampleRateHz, AudioFrame::kPLC, AudioFrame::kVadActive,
kNumChannels);
EXPECT_TRUE(frame.muted());
@@ -90,12 +88,11 @@
AudioFrame frame2;
int16_t samples[kNumChannels * kSamplesPerChannel] = {17};
- frame2.UpdateFrame(kId, kTimestamp, samples, kSamplesPerChannel,
+ frame2.UpdateFrame(kTimestamp, samples, kSamplesPerChannel,
kSampleRateHz, AudioFrame::kPLC, AudioFrame::kVadActive,
kNumChannels);
frame1.CopyFrom(frame2);
- EXPECT_EQ(frame2.id_, frame1.id_);
EXPECT_EQ(frame2.timestamp_, frame1.timestamp_);
EXPECT_EQ(frame2.samples_per_channel_, frame1.samples_per_channel_);
EXPECT_EQ(frame2.sample_rate_hz_, frame1.sample_rate_hz_);
@@ -106,7 +103,7 @@
EXPECT_EQ(frame2.muted(), frame1.muted());
EXPECT_EQ(0, memcmp(frame2.data(), frame1.data(), sizeof(samples)));
- frame2.UpdateFrame(kId, kTimestamp, nullptr /* data */, kSamplesPerChannel,
+ frame2.UpdateFrame(kTimestamp, nullptr /* data */, kSamplesPerChannel,
kSampleRateHz, AudioFrame::kPLC, AudioFrame::kVadActive,
kNumChannels);
frame1.CopyFrom(frame2);
diff --git a/voice_engine/channel.cc b/voice_engine/channel.cc
index e3ba1ee..43088b6 100644
--- a/voice_engine/channel.cc
+++ b/voice_engine/channel.cc
@@ -647,8 +647,6 @@
AudioFrameOperations::Mute(audio_frame);
}
- // Convert module ID to internal VoE channel ID
- audio_frame->id_ = VoEChannelId(audio_frame->id_);
// Store speech type for dead-or-alive detection
_outputSpeechType = audio_frame->speech_type_;
@@ -797,7 +795,6 @@
WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::Channel() - ctor");
AudioCodingModule::Config acm_config(config.acm_config);
- acm_config.id = VoEModuleId(instanceId, channelId);
acm_config.neteq_config.enable_muted_state = true;
audio_coding_.reset(AudioCodingModule::Create(acm_config));
@@ -1643,7 +1640,6 @@
// TODO(henrika): try to avoid copying by moving ownership of audio frame
// either into pool of frames or into the task itself.
audio_frame->CopyFrom(audio_input);
- audio_frame->id_ = ChannelId();
// Profile time between when the audio frame is added to the task queue and
// when the task is actually executed.
audio_frame->UpdateProfileTimeStamp();
@@ -1663,7 +1659,6 @@
CodecInst codec;
const int result = GetSendCodec(codec);
std::unique_ptr<AudioFrame> audio_frame(new AudioFrame());
- audio_frame->id_ = ChannelId();
// TODO(ossu): Investigate how this could happen. b/62909493
if (result == 0) {
audio_frame->sample_rate_hz_ = std::min(codec.plfreq, sample_rate);
@@ -1684,7 +1679,6 @@
RTC_DCHECK_RUN_ON(encoder_queue_);
RTC_DCHECK_GT(audio_input->samples_per_channel_, 0);
RTC_DCHECK_LE(audio_input->num_channels_, 2);
- RTC_DCHECK_EQ(audio_input->id_, ChannelId());
// Measure time between when the audio frame is added to the task queue and
// when the task is actually executed. Goal is to keep track of unwanted
diff --git a/voice_engine/voice_engine_defines.h b/voice_engine/voice_engine_defines.h
index bc5eb1b..4397662 100644
--- a/voice_engine/voice_engine_defines.h
+++ b/voice_engine/voice_engine_defines.h
@@ -16,23 +16,13 @@
#ifndef VOICE_ENGINE_VOICE_ENGINE_DEFINES_H_
#define VOICE_ENGINE_VOICE_ENGINE_DEFINES_H_
-#include "common_types.h" // NOLINT(build/include)
#include "modules/audio_processing/include/audio_processing.h"
-#include "typedefs.h" // NOLINT(build/include)
namespace webrtc {
// VolumeControl
enum { kMinVolumeLevel = 0 };
enum { kMaxVolumeLevel = 255 };
-// Min scale factor for per-channel volume scaling
-const float kMinOutputVolumeScaling = 0.0f;
-// Max scale factor for per-channel volume scaling
-const float kMaxOutputVolumeScaling = 10.0f;
-// Min scale factor for output volume panning
-const float kMinOutputVolumePanning = 0.0f;
-// Max scale factor for output volume panning
-const float kMaxOutputVolumePanning = 1.0f;
// Audio processing
const NoiseSuppression::Level kDefaultNsMode = NoiseSuppression::kModerate;
@@ -48,7 +38,6 @@
#else
true;
#endif
-const GainControl::Mode kDefaultRxAgcMode = GainControl::kAdaptiveDigital;
// VideoSync
// Lowest minimum playout delay
@@ -68,15 +57,6 @@
return (int)((veId << 16) + chId);
}
-inline int VoEModuleId(int veId, int chId) {
- return (int)((veId << 16) + chId);
-}
-
-// Convert module ID to internal VoE channel ID
-inline int VoEChannelId(int moduleId) {
- return (int)(moduleId & 0xffff);
-}
-
} // namespace webrtc
#if defined(_WIN32)