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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // Store the audio level in dBov for | 48 // Store the audio level in dBov for |
49 // header-extension-for-audio-level-indication. | 49 // header-extension-for-audio-level-indication. |
50 // Valid range is [0,100]. Actual value is negative. | 50 // Valid range is [0,100]. Actual value is negative. |
51 int32_t SetAudioLevel(uint8_t level_dbov); | 51 int32_t SetAudioLevel(uint8_t level_dbov); |
52 | 52 |
53 // Send a DTMF tone using RFC 2833 (4733) | 53 // Send a DTMF tone using RFC 2833 (4733) |
54 int32_t SendTelephoneEvent(uint8_t key, uint16_t time_ms, uint8_t level); | 54 int32_t SendTelephoneEvent(uint8_t key, uint16_t time_ms, uint8_t level); |
55 | 55 |
56 int AudioFrequency() const; | 56 int AudioFrequency() const; |
57 | 57 |
58 // Set payload type for Redundant Audio Data RFC 2198 | |
59 int32_t SetRED(int8_t payload_type); | |
60 | |
61 // Get payload type for Redundant Audio Data RFC 2198 | |
62 int32_t RED(int8_t* payload_type) const; | |
63 | |
64 protected: | 58 protected: |
65 bool SendTelephoneEventPacket( | 59 bool SendTelephoneEventPacket( |
66 bool ended, | 60 bool ended, |
67 int8_t dtmf_payload_type, | 61 int8_t dtmf_payload_type, |
68 uint32_t dtmf_timestamp, | 62 uint32_t dtmf_timestamp, |
69 uint16_t duration, | 63 uint16_t duration, |
70 bool marker_bit); // set on first packet in talk burst | 64 bool marker_bit); // set on first packet in talk burst |
71 | 65 |
72 bool MarkerBit(FrameType frame_type, int8_t payload_type); | 66 bool MarkerBit(FrameType frame_type, int8_t payload_type); |
73 | 67 |
74 private: | 68 private: |
75 Clock* const clock_; | 69 Clock* const clock_; |
76 RTPSender* const rtp_sender_; | 70 RTPSender* const rtp_sender_; |
77 | 71 |
78 rtc::CriticalSection send_audio_critsect_; | 72 rtc::CriticalSection send_audio_critsect_; |
79 | 73 |
80 uint16_t packet_size_samples_ GUARDED_BY(send_audio_critsect_); | 74 uint16_t packet_size_samples_ GUARDED_BY(send_audio_critsect_); |
81 | 75 |
82 // DTMF. | 76 // DTMF. |
83 bool dtmf_event_is_on_; | 77 bool dtmf_event_is_on_; |
84 bool dtmf_event_first_packet_sent_; | 78 bool dtmf_event_first_packet_sent_; |
85 int8_t dtmf_payload_type_ GUARDED_BY(send_audio_critsect_); | 79 int8_t dtmf_payload_type_ GUARDED_BY(send_audio_critsect_); |
86 uint32_t dtmf_timestamp_; | 80 uint32_t dtmf_timestamp_; |
87 uint8_t dtmf_key_; | 81 uint8_t dtmf_key_; |
88 uint32_t dtmf_length_samples_; | 82 uint32_t dtmf_length_samples_; |
89 uint8_t dtmf_level_; | 83 uint8_t dtmf_level_; |
90 int64_t dtmf_time_last_sent_; | 84 int64_t dtmf_time_last_sent_; |
91 uint32_t dtmf_timestamp_last_sent_; | 85 uint32_t dtmf_timestamp_last_sent_; |
92 | 86 |
93 int8_t red_payload_type_ GUARDED_BY(send_audio_critsect_); | |
94 | |
95 // VAD detection, used for marker bit. | 87 // VAD detection, used for marker bit. |
96 bool inband_vad_active_ GUARDED_BY(send_audio_critsect_); | 88 bool inband_vad_active_ GUARDED_BY(send_audio_critsect_); |
97 int8_t cngnb_payload_type_ GUARDED_BY(send_audio_critsect_); | 89 int8_t cngnb_payload_type_ GUARDED_BY(send_audio_critsect_); |
98 int8_t cngwb_payload_type_ GUARDED_BY(send_audio_critsect_); | 90 int8_t cngwb_payload_type_ GUARDED_BY(send_audio_critsect_); |
99 int8_t cngswb_payload_type_ GUARDED_BY(send_audio_critsect_); | 91 int8_t cngswb_payload_type_ GUARDED_BY(send_audio_critsect_); |
100 int8_t cngfb_payload_type_ GUARDED_BY(send_audio_critsect_); | 92 int8_t cngfb_payload_type_ GUARDED_BY(send_audio_critsect_); |
101 int8_t last_payload_type_ GUARDED_BY(send_audio_critsect_); | 93 int8_t last_payload_type_ GUARDED_BY(send_audio_critsect_); |
102 | 94 |
103 // Audio level indication. | 95 // Audio level indication. |
104 // (https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/) | 96 // (https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/) |
105 uint8_t audio_level_dbov_ GUARDED_BY(send_audio_critsect_); | 97 uint8_t audio_level_dbov_ GUARDED_BY(send_audio_critsect_); |
106 OneTimeEvent first_packet_sent_; | 98 OneTimeEvent first_packet_sent_; |
107 }; | 99 }; |
108 | 100 |
109 } // namespace webrtc | 101 } // namespace webrtc |
110 | 102 |
111 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_AUDIO_H_ | 103 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_AUDIO_H_ |
OLD | NEW |