Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc

Issue 2392883002: Multi frequency DTMF support - sender side (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc ('k') | webrtc/test/mock_voe_channel_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
index c86d92b307a8609aa3d17cf4cc056ef5b1406054..d8f0baf9a607af6b984808e16c50295707c15521 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
@@ -1299,37 +1299,38 @@ TEST_F(RtpSenderAudioTest, SendAudioWithAudioLevelExtension) {
// packets of the same telephone event. Since it is specifically for DTMF
// events, ignoring audio packets and sending kEmptyFrame instead of those.
TEST_F(RtpSenderAudioTest, CheckMarkerBitForTelephoneEvents) {
- char payload_name[RTP_PAYLOAD_NAME_SIZE] = "telephone-event";
- uint8_t payload_type = 126;
- ASSERT_EQ(0,
- rtp_sender_->RegisterPayload(payload_name, payload_type, 0, 0, 0));
+ const char* kDtmfPayloadName = "telephone-event";
+ const uint32_t kPayloadFrequency = 8000;
+ const uint8_t kPayloadType = 126;
+ ASSERT_EQ(0, rtp_sender_->RegisterPayload(kDtmfPayloadName, kPayloadType,
+ kPayloadFrequency, 0, 0));
// For Telephone events, payload is not added to the registered payload list,
// it will register only the payload used for audio stream.
// Registering the payload again for audio stream with different payload name.
- const char kPayloadName[] = "payload_name";
- ASSERT_EQ(
- 0, rtp_sender_->RegisterPayload(kPayloadName, payload_type, 8000, 1, 0));
+ const char* kPayloadName = "payload_name";
+ ASSERT_EQ(0, rtp_sender_->RegisterPayload(kPayloadName, kPayloadType,
+ kPayloadFrequency, 1, 0));
int64_t capture_time_ms = fake_clock_.TimeInMilliseconds();
// DTMF event key=9, duration=500 and attenuationdB=10
rtp_sender_->SendTelephoneEvent(9, 500, 10);
// During start, it takes the starting timestamp as last sent timestamp.
// The duration is calculated as the difference of current and last sent
// timestamp. So for first call it will skip since the duration is zero.
- ASSERT_TRUE(rtp_sender_->SendOutgoingData(kEmptyFrame, payload_type,
- capture_time_ms, 0, nullptr, 0,
- nullptr, nullptr, nullptr));
+ ASSERT_TRUE(rtp_sender_->SendOutgoingData(kEmptyFrame, kPayloadType,
+ capture_time_ms, 0, nullptr, 0,
+ nullptr, nullptr, nullptr));
// DTMF Sample Length is (Frequency/1000) * Duration.
// So in this case, it is (8000/1000) * 500 = 4000.
// Sending it as two packets.
ASSERT_TRUE(rtp_sender_->SendOutgoingData(
- kEmptyFrame, payload_type, capture_time_ms + 2000, 0,
+ kEmptyFrame, kPayloadType, capture_time_ms + 2000, 0,
nullptr, 0, nullptr, nullptr, nullptr));
// Marker Bit should be set to 1 for first packet.
EXPECT_TRUE(transport_.last_sent_packet().Marker());
ASSERT_TRUE(rtp_sender_->SendOutgoingData(
- kEmptyFrame, payload_type, capture_time_ms + 4000, 0,
+ kEmptyFrame, kPayloadType, capture_time_ms + 4000, 0,
nullptr, 0, nullptr, nullptr, nullptr));
// Marker Bit should be set to 0 for rest of the packets.
EXPECT_FALSE(transport_.last_sent_packet().Marker());
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc ('k') | webrtc/test/mock_voe_channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698