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

Side by Side Diff: webrtc/pc/dtmfsender.cc

Issue 2699503002: Change minimum DTMF event duration to be 40 milliseconds (Closed)
Patch Set: Change minimum DTMF event duration to be 40 milliseconds Created 3 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/pc/dtmfsender_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 21 matching lines...) Expand all
32 // | * | 10 | tone | yes | 32 // | * | 10 | tone | yes |
33 // | # | 11 | tone | yes | 33 // | # | 11 | tone | yes |
34 // | A--D | 12--15 | tone | yes | 34 // | A--D | 12--15 | tone | yes |
35 // +-------+--------+------+---------+ 35 // +-------+--------+------+---------+
36 // The "," is a special event defined by the WebRTC spec. It means to delay for 36 // The "," is a special event defined by the WebRTC spec. It means to delay for
37 // 2 seconds before processing the next tone. We use -1 as its code. 37 // 2 seconds before processing the next tone. We use -1 as its code.
38 static const int kDtmfCodeTwoSecondDelay = -1; 38 static const int kDtmfCodeTwoSecondDelay = -1;
39 static const int kDtmfTwoSecondInMs = 2000; 39 static const int kDtmfTwoSecondInMs = 2000;
40 static const char kDtmfValidTones[] = ",0123456789*#ABCDabcd"; 40 static const char kDtmfValidTones[] = ",0123456789*#ABCDabcd";
41 static const char kDtmfTonesTable[] = ",0123456789*#ABCD"; 41 static const char kDtmfTonesTable[] = ",0123456789*#ABCD";
42 // The duration cannot be more than 6000ms or less than 70ms. The gap between 42 // The duration cannot be more than 6000ms or less than 40ms. The gap between
43 // tones must be at least 50 ms. 43 // tones must be at least 50 ms.
44 static const int kDtmfDefaultDurationMs = 100; 44 static const int kDtmfDefaultDurationMs = 100;
45 static const int kDtmfMinDurationMs = 70; 45 static const int kDtmfMinDurationMs = 40;
46 static const int kDtmfMaxDurationMs = 6000; 46 static const int kDtmfMaxDurationMs = 6000;
47 static const int kDtmfDefaultGapMs = 50; 47 static const int kDtmfDefaultGapMs = 50;
48 static const int kDtmfMinGapMs = 50; 48 static const int kDtmfMinGapMs = 50;
49 49
50 // Get DTMF code from the DTMF event character. 50 // Get DTMF code from the DTMF event character.
51 bool GetDtmfCode(char tone, int* code) { 51 bool GetDtmfCode(char tone, int* code) {
52 // Convert a-d to A-D. 52 // Convert a-d to A-D.
53 char event = toupper(tone); 53 char event = toupper(tone);
54 const char* p = strchr(kDtmfTonesTable, event); 54 const char* p = strchr(kDtmfTonesTable, event);
55 if (!p) { 55 if (!p) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 LOG(LS_INFO) << "The Dtmf provider is deleted. Clear the sending queue."; 230 LOG(LS_INFO) << "The Dtmf provider is deleted. Clear the sending queue.";
231 StopSending(); 231 StopSending();
232 provider_ = NULL; 232 provider_ = NULL;
233 } 233 }
234 234
235 void DtmfSender::StopSending() { 235 void DtmfSender::StopSending() {
236 signaling_thread_->Clear(this); 236 signaling_thread_->Clear(this);
237 } 237 }
238 238
239 } // namespace webrtc 239 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/pc/dtmfsender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698