Unify FrameType and VideoFrameType.
Prevents some heap allocation and frame-type conversion since interfaces
mismatch. Also it's less confusing to have one type for this.
BUG=webrtc:5042
R=magjed@webrtc.org, mflodman@webrtc.org, henrik.lundin@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1371043003
Cr-Commit-Position: refs/heads/master@{#10320}
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest.cc
index 9b5c17b..c6cd6de 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest.cc
@@ -46,7 +46,7 @@
: timestamp_(0),
packet_sent_(false),
last_packet_send_timestamp_(timestamp_),
- last_frame_type_(kFrameEmpty) {
+ last_frame_type_(kEmptyFrame) {
AudioCoding::Config config;
config.transport = this;
acm_.reset(new AudioCodingImpl(config));
@@ -121,7 +121,7 @@
const uint8_t* payload_data,
size_t payload_len_bytes,
const RTPFragmentationHeader* fragmentation) override {
- if (frame_type == kFrameEmpty)
+ if (frame_type == kEmptyFrame)
return 0;
rtp_header_.header.payloadType = payload_type;
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc
index 0142275..12ea300 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc
@@ -46,7 +46,7 @@
: timestamp_(0),
packet_sent_(false),
last_packet_send_timestamp_(timestamp_),
- last_frame_type_(kFrameEmpty) {
+ last_frame_type_(kEmptyFrame) {
AudioCodingModule::Config config;
acm_.reset(new AudioCodingModuleImpl(config));
receiver_.reset(new AcmReceiver(config));
@@ -120,7 +120,7 @@
const uint8_t* payload_data,
size_t payload_len_bytes,
const RTPFragmentationHeader* fragmentation) override {
- if (frame_type == kFrameEmpty)
+ if (frame_type == kEmptyFrame)
return 0;
rtp_header_.header.payloadType = payload_type;
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
index a652278..879af49 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
@@ -171,7 +171,7 @@
ConvertEncodedInfoToFragmentationHeader(encoded_info, &my_fragmentation);
FrameType frame_type;
if (encode_buffer_.size() == 0 && encoded_info.send_even_if_empty) {
- frame_type = kFrameEmpty;
+ frame_type = kEmptyFrame;
encoded_info.payload_type = previous_pltype;
} else {
RTC_DCHECK_GT(encode_buffer_.size(), 0u);
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc
index 01c8bb8..e36d4e6 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc
@@ -92,7 +92,7 @@
public:
PacketizationCallbackStubOldApi()
: num_calls_(0),
- last_frame_type_(kFrameEmpty),
+ last_frame_type_(kEmptyFrame),
last_payload_type_(-1),
last_timestamp_(0),
crit_sect_(CriticalSectionWrapper::CreateCriticalSection()) {}
@@ -416,18 +416,18 @@
int ix;
FrameType type;
} expectation[] = {{2, kAudioFrameCN},
- {5, kFrameEmpty},
- {8, kFrameEmpty},
+ {5, kEmptyFrame},
+ {8, kEmptyFrame},
{11, kAudioFrameCN},
- {14, kFrameEmpty},
- {17, kFrameEmpty},
+ {14, kEmptyFrame},
+ {17, kEmptyFrame},
{20, kAudioFrameCN},
- {23, kFrameEmpty},
- {26, kFrameEmpty},
- {29, kFrameEmpty},
+ {23, kEmptyFrame},
+ {26, kEmptyFrame},
+ {29, kEmptyFrame},
{32, kAudioFrameCN},
- {35, kFrameEmpty},
- {38, kFrameEmpty}};
+ {35, kEmptyFrame},
+ {38, kEmptyFrame}};
for (int i = 0; i < kLoops; ++i) {
int num_calls_before = packet_cb_.num_calls();
EXPECT_EQ(i / blocks_per_packet, num_calls_before);
@@ -447,7 +447,7 @@
// Checks that the transport callback is invoked once per frame period of the
// underlying speech encoder, even when comfort noise is produced.
-// Also checks that the frame type is kAudioFrameCN or kFrameEmpty.
+// Also checks that the frame type is kAudioFrameCN or kEmptyFrame.
// This test and the next check the same thing, but differ in the order of
// speech codec and CNG registration.
TEST_F(AudioCodingModuleTestWithComfortNoiseOldApi,
diff --git a/webrtc/modules/audio_coding/main/test/Channel.cc b/webrtc/modules/audio_coding/main/test/Channel.cc
index 779718d..1b0a610 100644
--- a/webrtc/modules/audio_coding/main/test/Channel.cc
+++ b/webrtc/modules/audio_coding/main/test/Channel.cc
@@ -42,7 +42,7 @@
} else {
rtpInfo.type.Audio.isCNG = false;
}
- if (frameType == kFrameEmpty) {
+ if (frameType == kEmptyFrame) {
// When frame is empty, we should not transmit it. The frame size of the
// next non-empty frame will be based on the previous frame size.
_useLastFrameSize = _lastFrameSizeSample > 0;
diff --git a/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc b/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc
index 21d97f1..85c2579 100644
--- a/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc
+++ b/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc
@@ -74,7 +74,7 @@
} else {
rtp_info.type.Audio.isCNG = false;
}
- if (frame_type == kFrameEmpty) {
+ if (frame_type == kEmptyFrame) {
// Skip this frame.
return 0;
}
diff --git a/webrtc/modules/audio_coding/main/test/TestStereo.cc b/webrtc/modules/audio_coding/main/test/TestStereo.cc
index 32ecadf..b0786be 100644
--- a/webrtc/modules/audio_coding/main/test/TestStereo.cc
+++ b/webrtc/modules/audio_coding/main/test/TestStereo.cc
@@ -58,7 +58,7 @@
rtp_info.header.sequenceNumber = seq_no_++;
rtp_info.header.payloadType = payload_type;
rtp_info.header.timestamp = timestamp;
- if (frame_type == kFrameEmpty) {
+ if (frame_type == kEmptyFrame) {
// Skip this frame
return 0;
}
diff --git a/webrtc/modules/audio_coding/main/test/TestVADDTX.cc b/webrtc/modules/audio_coding/main/test/TestVADDTX.cc
index 0e42b9f..bd0335a 100644
--- a/webrtc/modules/audio_coding/main/test/TestVADDTX.cc
+++ b/webrtc/modules/audio_coding/main/test/TestVADDTX.cc
@@ -44,7 +44,7 @@
void ActivityMonitor::PrintStatistics() {
printf("\n");
- printf("kFrameEmpty %u\n", counter_[kFrameEmpty]);
+ printf("kEmptyFrame %u\n", counter_[kEmptyFrame]);
printf("kAudioFrameSpeech %u\n", counter_[kAudioFrameSpeech]);
printf("kAudioFrameCN %u\n", counter_[kAudioFrameCN]);
printf("kVideoFrameKey %u\n", counter_[kVideoFrameKey]);
@@ -248,7 +248,7 @@
32000, 1, out_filename, false, expects);
EXPECT_EQ(0, acm_send_->EnableOpusDtx());
- expects[kFrameEmpty] = 1;
+ expects[kEmptyFrame] = 1;
Run(webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"),
32000, 1, out_filename, true, expects);
@@ -256,13 +256,13 @@
out_filename = webrtc::test::OutputPath() + "testOpusDtx_outFile_stereo.pcm";
RegisterCodec(kOpusStereo);
EXPECT_EQ(0, acm_send_->DisableOpusDtx());
- expects[kFrameEmpty] = 0;
+ expects[kEmptyFrame] = 0;
Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"),
32000, 2, out_filename, false, expects);
EXPECT_EQ(0, acm_send_->EnableOpusDtx());
- expects[kFrameEmpty] = 1;
+ expects[kEmptyFrame] = 1;
Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"),
32000, 2, out_filename, true, expects);
#endif
diff --git a/webrtc/modules/audio_coding/main/test/TestVADDTX.h b/webrtc/modules/audio_coding/main/test/TestVADDTX.h
index 8ef4228..d34b99f 100644
--- a/webrtc/modules/audio_coding/main/test/TestVADDTX.h
+++ b/webrtc/modules/audio_coding/main/test/TestVADDTX.h
@@ -29,7 +29,7 @@
void ResetStatistics();
void GetStatistics(uint32_t* stats);
private:
- // 0 - kFrameEmpty
+ // 0 - kEmptyFrame
// 1 - kAudioFrameSpeech
// 2 - kAudioFrameCN
// 3 - kVideoFrameKey (not used by audio)
@@ -60,7 +60,7 @@
// 0 : there have been no packets of type |x|,
// 1 : there have been packets of type |x|,
// with |x| indicates the following packet types
- // 0 - kFrameEmpty
+ // 0 - kEmptyFrame
// 1 - kAudioFrameSpeech
// 2 - kAudioFrameCN
// 3 - kVideoFrameKey (not used by audio)
diff --git a/webrtc/modules/audio_coding/main/test/utility.cc b/webrtc/modules/audio_coding/main/test/utility.cc
index 949ca61..86e49f1 100644
--- a/webrtc/modules/audio_coding/main/test/utility.cc
+++ b/webrtc/modules/audio_coding/main/test/utility.cc
@@ -288,7 +288,7 @@
}
void VADCallback::PrintFrameTypes() {
- printf("kFrameEmpty......... %d\n", _numFrameTypes[kFrameEmpty]);
+ printf("kEmptyFrame......... %d\n", _numFrameTypes[kEmptyFrame]);
printf("kAudioFrameSpeech... %d\n", _numFrameTypes[kAudioFrameSpeech]);
printf("kAudioFrameCN....... %d\n", _numFrameTypes[kAudioFrameCN]);
printf("kVideoFrameKey...... %d\n", _numFrameTypes[kVideoFrameKey]);