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