| 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 | |
| 36 class RtpReceiver { | 21 class RtpReceiver { |
| 37 public: | 22 public: |
| 38 // Creates a video-enabled RTP receiver. | 23 // Creates a video-enabled RTP receiver. |
| 39 static RtpReceiver* CreateVideoReceiver( | 24 static RtpReceiver* CreateVideoReceiver( |
| 40 Clock* clock, | 25 Clock* clock, |
| 41 RtpData* incoming_payload_callback, | 26 RtpData* incoming_payload_callback, |
| 42 RtpFeedback* incoming_messages_callback, | 27 RtpFeedback* incoming_messages_callback, |
| 43 RTPPayloadRegistry* rtp_payload_registry); | 28 RTPPayloadRegistry* rtp_payload_registry); |
| 44 | 29 |
| 45 // Creates an audio-enabled RTP receiver. | 30 // Creates an audio-enabled RTP receiver. |
| 46 static RtpReceiver* CreateAudioReceiver( | 31 static RtpReceiver* CreateAudioReceiver( |
| 47 Clock* clock, | 32 Clock* clock, |
| 48 RtpData* incoming_payload_callback, | 33 RtpData* incoming_payload_callback, |
| 49 RtpFeedback* incoming_messages_callback, | 34 RtpFeedback* incoming_messages_callback, |
| 50 RTPPayloadRegistry* rtp_payload_registry); | 35 RTPPayloadRegistry* rtp_payload_registry); |
| 51 | 36 |
| 52 virtual ~RtpReceiver() {} | 37 virtual ~RtpReceiver() {} |
| 53 | 38 |
| 54 // Returns a TelephoneEventHandler if available. | |
| 55 virtual TelephoneEventHandler* GetTelephoneEventHandler() = 0; | |
| 56 | |
| 57 // Registers a receive payload in the payload registry and notifies the media | 39 // Registers a receive payload in the payload registry and notifies the media |
| 58 // receiver strategy. | 40 // receiver strategy. |
| 59 virtual int32_t RegisterReceivePayload( | 41 virtual int32_t RegisterReceivePayload( |
| 60 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 42 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
| 61 const int8_t payload_type, | 43 const int8_t payload_type, |
| 62 const uint32_t frequency, | 44 const uint32_t frequency, |
| 63 const size_t channels, | 45 const size_t channels, |
| 64 const uint32_t rate) = 0; | 46 const uint32_t rate) = 0; |
| 65 | 47 |
| 66 // De-registers |payload_type| from the payload registry. | 48 // De-registers |payload_type| from the payload registry. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 87 | 69 |
| 88 // Returns the current remote CSRCs. | 70 // Returns the current remote CSRCs. |
| 89 virtual int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const = 0; | 71 virtual int32_t CSRCs(uint32_t array_of_csrc[kRtpCsrcSize]) const = 0; |
| 90 | 72 |
| 91 // Returns the current energy of the RTP stream received. | 73 // Returns the current energy of the RTP stream received. |
| 92 virtual int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const = 0; | 74 virtual int32_t Energy(uint8_t array_of_energy[kRtpCsrcSize]) const = 0; |
| 93 }; | 75 }; |
| 94 } // namespace webrtc | 76 } // namespace webrtc |
| 95 | 77 |
| 96 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ | 78 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_RECEIVER_H_ |
| OLD | NEW |