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 |
(...skipping 24 matching lines...) Loading... |
35 // The following three methods implement the TelephoneEventHandler interface. | 35 // The following three methods implement the TelephoneEventHandler interface. |
36 // Forward DTMFs to decoder for playout. | 36 // Forward DTMFs to decoder for playout. |
37 void SetTelephoneEventForwardToDecoder(bool forward_to_decoder); | 37 void SetTelephoneEventForwardToDecoder(bool forward_to_decoder); |
38 | 38 |
39 // Is forwarding of outband telephone events turned on/off? | 39 // Is forwarding of outband telephone events turned on/off? |
40 bool TelephoneEventForwardToDecoder() const; | 40 bool TelephoneEventForwardToDecoder() const; |
41 | 41 |
42 // Is TelephoneEvent configured with payload type payload_type | 42 // Is TelephoneEvent configured with payload type payload_type |
43 bool TelephoneEventPayloadType(const int8_t payload_type) const; | 43 bool TelephoneEventPayloadType(const int8_t payload_type) const; |
44 | 44 |
45 TelephoneEventHandler* GetTelephoneEventHandler() { | 45 TelephoneEventHandler* GetTelephoneEventHandler() { return this; } |
46 return this; | |
47 } | |
48 | 46 |
49 // Returns true if CNG is configured with payload type payload_type. If so, | 47 // Returns true if CNG is configured with payload type payload_type. If so, |
50 // the frequency and cng_payload_type_has_changed are filled in. | 48 // the frequency and cng_payload_type_has_changed are filled in. |
51 bool CNGPayloadType(const int8_t payload_type, | 49 bool CNGPayloadType(const int8_t payload_type, |
52 uint32_t* frequency, | 50 uint32_t* frequency, |
53 bool* cng_payload_type_has_changed); | 51 bool* cng_payload_type_has_changed); |
54 | 52 |
55 int32_t ParseRtpPacket(WebRtcRTPHeader* rtp_header, | 53 int32_t ParseRtpPacket(WebRtcRTPHeader* rtp_header, |
56 const PayloadUnion& specific_payload, | 54 const PayloadUnion& specific_payload, |
57 bool is_red, | 55 bool is_red, |
(...skipping 31 matching lines...) Loading... |
89 | 87 |
90 // We need to look out for special payload types here and sometimes reset | 88 // We need to look out for special payload types here and sometimes reset |
91 // statistics. In addition we sometimes need to tweak the frequency. | 89 // statistics. In addition we sometimes need to tweak the frequency. |
92 void CheckPayloadChanged(int8_t payload_type, | 90 void CheckPayloadChanged(int8_t payload_type, |
93 PayloadUnion* specific_payload, | 91 PayloadUnion* specific_payload, |
94 bool* should_discard_changes) override; | 92 bool* should_discard_changes) override; |
95 | 93 |
96 int Energy(uint8_t array_of_energy[kRtpCsrcSize]) const override; | 94 int Energy(uint8_t array_of_energy[kRtpCsrcSize]) const override; |
97 | 95 |
98 private: | 96 private: |
99 | 97 int32_t ParseAudioCodecSpecific(WebRtcRTPHeader* rtp_header, |
100 int32_t ParseAudioCodecSpecific( | 98 const uint8_t* payload_data, |
101 WebRtcRTPHeader* rtp_header, | 99 size_t payload_length, |
102 const uint8_t* payload_data, | 100 const AudioPayload& audio_specific, |
103 size_t payload_length, | 101 bool is_red); |
104 const AudioPayload& audio_specific, | |
105 bool is_red); | |
106 | 102 |
107 uint32_t last_received_frequency_; | 103 uint32_t last_received_frequency_; |
108 | 104 |
109 bool telephone_event_forward_to_decoder_; | 105 bool telephone_event_forward_to_decoder_; |
110 int8_t telephone_event_payload_type_; | 106 int8_t telephone_event_payload_type_; |
111 std::set<uint8_t> telephone_event_reported_; | 107 std::set<uint8_t> telephone_event_reported_; |
112 | 108 |
113 int8_t cng_nb_payload_type_; | 109 int8_t cng_nb_payload_type_; |
114 int8_t cng_wb_payload_type_; | 110 int8_t cng_wb_payload_type_; |
115 int8_t cng_swb_payload_type_; | 111 int8_t cng_swb_payload_type_; |
116 int8_t cng_fb_payload_type_; | 112 int8_t cng_fb_payload_type_; |
117 int8_t cng_payload_type_; | 113 int8_t cng_payload_type_; |
118 | 114 |
119 // G722 is special since it use the wrong number of RTP samples in timestamp | 115 // G722 is special since it use the wrong number of RTP samples in timestamp |
120 // VS. number of samples in the frame | 116 // VS. number of samples in the frame |
121 int8_t g722_payload_type_; | 117 int8_t g722_payload_type_; |
122 bool last_received_g722_; | 118 bool last_received_g722_; |
123 | 119 |
124 uint8_t num_energy_; | 120 uint8_t num_energy_; |
125 uint8_t current_remote_energy_[kRtpCsrcSize]; | 121 uint8_t current_remote_energy_[kRtpCsrcSize]; |
126 | 122 |
127 RtpAudioFeedback* cb_audio_feedback_; | 123 RtpAudioFeedback* cb_audio_feedback_; |
128 }; | 124 }; |
129 } // namespace webrtc | 125 } // namespace webrtc |
130 | 126 |
131 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_AUDIO_H_ | 127 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_AUDIO_H_ |
OLD | NEW |