OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ |
13 | 13 |
14 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 14 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
15 #include "webrtc/typedefs.h" | 15 #include "webrtc/typedefs.h" |
16 | 16 |
17 namespace webrtc { | 17 namespace webrtc { |
18 | 18 |
19 class RTPPayloadRegistry; | 19 class RTPPayloadRegistry; |
20 | 20 |
| 21 class TelephoneEventHandler { |
| 22 public: |
| 23 virtual ~TelephoneEventHandler() {} |
| 24 |
| 25 // The following three methods implement the TelephoneEventHandler interface. |
| 26 // Forward DTMFs to decoder for playout. |
| 27 virtual void SetTelephoneEventForwardToDecoder(bool forward_to_decoder) = 0; |
| 28 |
| 29 // Is forwarding of outband telephone events turned on/off? |
| 30 virtual bool TelephoneEventForwardToDecoder() const = 0; |
| 31 |
| 32 // Is TelephoneEvent configured with payload type payload_type |
| 33 virtual bool TelephoneEventPayloadType(const int8_t payload_type) const = 0; |
| 34 }; |
| 35 |
21 class RtpReceiver { | 36 class RtpReceiver { |
22 public: | 37 public: |
23 // Creates a video-enabled RTP receiver. | 38 // Creates a video-enabled RTP receiver. |
24 static RtpReceiver* CreateVideoReceiver( | 39 static RtpReceiver* CreateVideoReceiver( |
25 Clock* clock, | 40 Clock* clock, |
26 RtpData* incoming_payload_callback, | 41 RtpData* incoming_payload_callback, |
27 RtpFeedback* incoming_messages_callback, | 42 RtpFeedback* incoming_messages_callback, |
28 RTPPayloadRegistry* rtp_payload_registry); | 43 RTPPayloadRegistry* rtp_payload_registry); |
29 | 44 |
30 // Creates an audio-enabled RTP receiver. | 45 // Creates an audio-enabled RTP receiver. |
31 static RtpReceiver* CreateAudioReceiver( | 46 static RtpReceiver* CreateAudioReceiver( |
32 Clock* clock, | 47 Clock* clock, |
33 RtpData* incoming_payload_callback, | 48 RtpData* incoming_payload_callback, |
34 RtpFeedback* incoming_messages_callback, | 49 RtpFeedback* incoming_messages_callback, |
35 RTPPayloadRegistry* rtp_payload_registry); | 50 RTPPayloadRegistry* rtp_payload_registry); |
36 | 51 |
37 virtual ~RtpReceiver() {} | 52 virtual ~RtpReceiver() {} |
38 | 53 |
| 54 // Returns a TelephoneEventHandler if available. |
| 55 virtual TelephoneEventHandler* GetTelephoneEventHandler() = 0; |
| 56 |
39 // Registers a receive payload in the payload registry and notifies the media | 57 // Registers a receive payload in the payload registry and notifies the media |
40 // receiver strategy. | 58 // receiver strategy. |
41 virtual int32_t RegisterReceivePayload( | 59 virtual int32_t RegisterReceivePayload( |
42 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 60 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
43 const int8_t payload_type, | 61 const int8_t payload_type, |
44 const uint32_t frequency, | 62 const uint32_t frequency, |
45 const size_t channels, | 63 const size_t channels, |
46 const uint32_t rate) = 0; | 64 const uint32_t rate) = 0; |
47 | 65 |
48 // De-registers |payload_type| from the payload registry. | 66 // De-registers |payload_type| from the payload registry. |
(...skipping 20 matching lines...) Expand all Loading... |
69 | 87 |
70 // Returns the current remote CSRCs. | 88 // Returns the current remote CSRCs. |
71 virtual int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const = 0; | 89 virtual int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const = 0; |
72 | 90 |
73 // Returns the current energy of the RTP stream received. | 91 // Returns the current energy of the RTP stream received. |
74 virtual int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const = 0; | 92 virtual int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const = 0; |
75 }; | 93 }; |
76 } // namespace webrtc | 94 } // namespace webrtc |
77 | 95 |
78 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ | 96 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ |
OLD | NEW |