Make AudioFrameType an enum class, and move to audio_coding_module_typedefs.h
Bug: webrtc:5876
Change-Id: I0c92f9410fcf0832bfa321229b3437134255dba6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128085
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27190}
diff --git a/modules/audio_coding/acm2/acm_receiver_unittest.cc b/modules/audio_coding/acm2/acm_receiver_unittest.cc
index 7667b71..747d4a3 100644
--- a/modules/audio_coding/acm2/acm_receiver_unittest.cc
+++ b/modules/audio_coding/acm2/acm_receiver_unittest.cc
@@ -36,7 +36,7 @@
: timestamp_(0),
packet_sent_(false),
last_packet_send_timestamp_(timestamp_),
- last_frame_type_(kEmptyFrame) {
+ last_frame_type_(AudioFrameType::kEmptyFrame) {
config_.decoder_factory = decoder_factory_;
}
@@ -109,7 +109,7 @@
const uint8_t* payload_data,
size_t payload_len_bytes,
const RTPFragmentationHeader* fragmentation) override {
- if (frame_type == kEmptyFrame)
+ if (frame_type == AudioFrameType::kEmptyFrame)
return 0;
rtp_header_.payloadType = payload_type;
@@ -336,7 +336,7 @@
SetEncoder(0, codecs.at(0), cng_payload_types)); // Enough to test
// with one codec.
ASSERT_TRUE(packet_sent_);
- EXPECT_EQ(kAudioFrameCN, last_frame_type_);
+ EXPECT_EQ(AudioFrameType::kAudioFrameCN, last_frame_type_);
// Has received, only, DTX. Last Audio codec is undefined.
EXPECT_EQ(absl::nullopt, receiver_->LastDecoder());
@@ -353,7 +353,7 @@
// Sanity check if Actually an audio payload received, and it should be
// of type "speech."
ASSERT_TRUE(packet_sent_);
- ASSERT_EQ(kAudioFrameSpeech, last_frame_type_);
+ ASSERT_EQ(AudioFrameType::kAudioFrameSpeech, last_frame_type_);
EXPECT_EQ(info_without_cng.sample_rate_hz,
receiver_->last_packet_sample_rate_hz());
@@ -361,7 +361,7 @@
// the expected codec. Encode repeatedly until a DTX is sent.
const AudioCodecInfo info_with_cng =
SetEncoder(payload_type, codecs.at(i), cng_payload_types);
- while (last_frame_type_ != kAudioFrameCN) {
+ while (last_frame_type_ != AudioFrameType::kAudioFrameCN) {
packet_sent_ = false;
InsertOnePacketOfSilence(info_with_cng);
ASSERT_TRUE(packet_sent_);