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

Side by Side Diff: webrtc/api/dtmfsenderinterface.h

Issue 2680273002: Adding more comments to every header file in api/ subdirectory. (Closed)
Patch Set: Merge with master 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/api/datachannelinterface.h ('k') | webrtc/api/jsep.h » ('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
11 #ifndef WEBRTC_API_DTMFSENDERINTERFACE_H_ 11 #ifndef WEBRTC_API_DTMFSENDERINTERFACE_H_
12 #define WEBRTC_API_DTMFSENDERINTERFACE_H_ 12 #define WEBRTC_API_DTMFSENDERINTERFACE_H_
13 13
14 #include <string> 14 #include <string>
15 15
16 #include "webrtc/api/mediastreaminterface.h" 16 #include "webrtc/api/mediastreaminterface.h"
17 #include "webrtc/base/refcount.h" 17 #include "webrtc/base/refcount.h"
18 18
19 // This file contains interfaces for DtmfSender.
20
21 namespace webrtc { 19 namespace webrtc {
22 20
23 // DtmfSender callback interface. Application should implement this interface 21 // DtmfSender callback interface, used to implement RTCDtmfSender events.
24 // to get notifications from the DtmfSender. 22 // Applications should implement this interface to get notifications from the
23 // DtmfSender.
25 class DtmfSenderObserverInterface { 24 class DtmfSenderObserverInterface {
26 public: 25 public:
27 // Triggered when DTMF |tone| is sent. 26 // Triggered when DTMF |tone| is sent.
28 // If |tone| is empty that means the DtmfSender has sent out all the given 27 // If |tone| is empty that means the DtmfSender has sent out all the given
29 // tones. 28 // tones.
30 virtual void OnToneChange(const std::string& tone) = 0; 29 virtual void OnToneChange(const std::string& tone) = 0;
31 30
32 protected: 31 protected:
33 virtual ~DtmfSenderObserverInterface() {} 32 virtual ~DtmfSenderObserverInterface() {}
34 }; 33 };
35 34
36 // The interface of native implementation of the RTCDTMFSender defined by the 35 // The interface of native implementation of the RTCDTMFSender defined by the
37 // WebRTC W3C Editor's Draft. 36 // WebRTC W3C Editor's Draft.
37 // See: https://www.w3.org/TR/webrtc/#peer-to-peer-dtmf
38 class DtmfSenderInterface : public rtc::RefCountInterface { 38 class DtmfSenderInterface : public rtc::RefCountInterface {
39 public: 39 public:
40 // Used to receive events from the DTMF sender. Only one observer can be
41 // registered at a time. UnregisterObserver should be called before the
42 // observer object is destroyed.
40 virtual void RegisterObserver(DtmfSenderObserverInterface* observer) = 0; 43 virtual void RegisterObserver(DtmfSenderObserverInterface* observer) = 0;
41 virtual void UnregisterObserver() = 0; 44 virtual void UnregisterObserver() = 0;
42 45
43 // Returns true if this DtmfSender is capable of sending DTMF. 46 // Returns true if this DtmfSender is capable of sending DTMF. Otherwise
44 // Otherwise returns false. 47 // returns false. To be able to send DTMF, the associated RtpSender must be
48 // able to send packets, and a "telephone-event" codec must be negotiated.
45 virtual bool CanInsertDtmf() = 0; 49 virtual bool CanInsertDtmf() = 0;
46 50
47 // Queues a task that sends the DTMF |tones|. The |tones| parameter is treated 51 // Queues a task that sends the DTMF |tones|. The |tones| parameter is treated
48 // as a series of characters. The characters 0 through 9, A through D, #, and 52 // as a series of characters. The characters 0 through 9, A through D, #, and
49 // * generate the associated DTMF tones. The characters a to d are equivalent 53 // * generate the associated DTMF tones. The characters a to d are equivalent
50 // to A to D. The character ',' indicates a delay of 2 seconds before 54 // to A to D. The character ',' indicates a delay of 2 seconds before
51 // processing the next character in the tones parameter. 55 // processing the next character in the tones parameter.
56 //
52 // Unrecognized characters are ignored. 57 // Unrecognized characters are ignored.
58 //
53 // The |duration| parameter indicates the duration in ms to use for each 59 // The |duration| parameter indicates the duration in ms to use for each
54 // character passed in the |tones| parameter. 60 // character passed in the |tones| parameter. The duration cannot be more
55 // The duration cannot be more than 6000 or less than 70. 61 // than 6000 or less than 70.
56 // The |inter_tone_gap| parameter indicates the gap between tones in ms. 62 //
57 // The |inter_tone_gap| must be at least 50 ms but should be as short as 63 // The |inter_tone_gap| parameter indicates the gap between tones in ms. The
64 // |inter_tone_gap| must be at least 50 ms but should be as short as
58 // possible. 65 // possible.
66 //
59 // If InsertDtmf is called on the same object while an existing task for this 67 // If InsertDtmf is called on the same object while an existing task for this
60 // object to generate DTMF is still running, the previous task is canceled. 68 // object to generate DTMF is still running, the previous task is canceled.
61 // Returns true on success and false on failure. 69 // Returns true on success and false on failure.
62 virtual bool InsertDtmf(const std::string& tones, int duration, 70 virtual bool InsertDtmf(const std::string& tones, int duration,
63 int inter_tone_gap) = 0; 71 int inter_tone_gap) = 0;
64 72
65 // Returns the track given as argument to the constructor. 73 // Returns the track given as argument to the constructor. Only exists for
74 // backwards compatibilty; now that DtmfSenders are tied to RtpSenders, it's
75 // no longer relevant.
66 virtual const AudioTrackInterface* track() const = 0; 76 virtual const AudioTrackInterface* track() const = 0;
67 77
68 // Returns the tones remaining to be played out. 78 // Returns the tones remaining to be played out.
69 virtual std::string tones() const = 0; 79 virtual std::string tones() const = 0;
70 80
71 // Returns the current tone duration value in ms. 81 // Returns the current tone duration value in ms.
72 // This value will be the value last set via the InsertDtmf() method, or the 82 // This value will be the value last set via the InsertDtmf() method, or the
73 // default value of 100 ms if InsertDtmf() was never called. 83 // default value of 100 ms if InsertDtmf() was never called.
74 virtual int duration() const = 0; 84 virtual int duration() const = 0;
75 85
76 // Returns the current value of the between-tone gap in ms. 86 // Returns the current value of the between-tone gap in ms.
77 // This value will be the value last set via the InsertDtmf() method, or the 87 // This value will be the value last set via the InsertDtmf() method, or the
78 // default value of 50 ms if InsertDtmf() was never called. 88 // default value of 50 ms if InsertDtmf() was never called.
79 virtual int inter_tone_gap() const = 0; 89 virtual int inter_tone_gap() const = 0;
80 90
81 protected: 91 protected:
82 virtual ~DtmfSenderInterface() {} 92 virtual ~DtmfSenderInterface() {}
83 }; 93 };
84 94
85 } // namespace webrtc 95 } // namespace webrtc
86 96
87 #endif // WEBRTC_API_DTMFSENDERINTERFACE_H_ 97 #endif // WEBRTC_API_DTMFSENDERINTERFACE_H_
OLDNEW
« no previous file with comments | « webrtc/api/datachannelinterface.h ('k') | webrtc/api/jsep.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698