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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 kOtherDecoderError, | 121 kOtherDecoderError, |
122 kInvalidOperation, | 122 kInvalidOperation, |
123 kDtmfParameterError, | 123 kDtmfParameterError, |
124 kDtmfParsingError, | 124 kDtmfParsingError, |
125 kDtmfInsertError, | 125 kDtmfInsertError, |
126 kStereoNotSupported, | 126 kStereoNotSupported, |
127 kSampleUnderrun, | 127 kSampleUnderrun, |
128 kDecodedTooMuch, | 128 kDecodedTooMuch, |
129 kFrameSplitError, | 129 kFrameSplitError, |
130 kRedundancySplitError, | 130 kRedundancySplitError, |
131 kPacketBufferCorruption, | 131 kPacketBufferCorruption |
132 kSyncPacketNotAccepted | |
133 }; | 132 }; |
134 | 133 |
135 // Creates a new NetEq object, with parameters set in |config|. The |config| | 134 // Creates a new NetEq object, with parameters set in |config|. The |config| |
136 // object will only have to be valid for the duration of the call to this | 135 // object will only have to be valid for the duration of the call to this |
137 // method. | 136 // method. |
138 static NetEq* Create( | 137 static NetEq* Create( |
139 const NetEq::Config& config, | 138 const NetEq::Config& config, |
140 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory); | 139 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory); |
141 | 140 |
142 virtual ~NetEq() {} | 141 virtual ~NetEq() {} |
143 | 142 |
144 // Inserts a new packet into NetEq. The |receive_timestamp| is an indication | 143 // Inserts a new packet into NetEq. The |receive_timestamp| is an indication |
145 // of the time when the packet was received, and should be measured with | 144 // of the time when the packet was received, and should be measured with |
146 // the same tick rate as the RTP timestamp of the current payload. | 145 // the same tick rate as the RTP timestamp of the current payload. |
147 // Returns 0 on success, -1 on failure. | 146 // Returns 0 on success, -1 on failure. |
148 virtual int InsertPacket(const WebRtcRTPHeader& rtp_header, | 147 virtual int InsertPacket(const WebRtcRTPHeader& rtp_header, |
149 rtc::ArrayView<const uint8_t> payload, | 148 rtc::ArrayView<const uint8_t> payload, |
150 uint32_t receive_timestamp) = 0; | 149 uint32_t receive_timestamp) = 0; |
151 | 150 |
152 // Inserts a sync-packet into packet queue. Sync-packets are decoded to | |
153 // silence and are intended to keep AV-sync intact in an event of long packet | |
154 // losses when Video NACK is enabled but Audio NACK is not. Clients of NetEq | |
155 // might insert sync-packet when they observe that buffer level of NetEq is | |
156 // decreasing below a certain threshold, defined by the application. | |
157 // Sync-packets should have the same payload type as the last audio payload | |
158 // type, i.e. they cannot have DTMF or CNG payload type, nor a codec change | |
159 // can be implied by inserting a sync-packet. | |
160 // Returns kOk on success, kFail on failure. | |
161 virtual int InsertSyncPacket(const WebRtcRTPHeader& rtp_header, | |
162 uint32_t receive_timestamp) = 0; | |
163 | |
164 // Instructs NetEq to deliver 10 ms of audio data. The data is written to | 151 // Instructs NetEq to deliver 10 ms of audio data. The data is written to |
165 // |audio_frame|. All data in |audio_frame| is wiped; |data_|, |speech_type_|, | 152 // |audio_frame|. All data in |audio_frame| is wiped; |data_|, |speech_type_|, |
166 // |num_channels_|, |sample_rate_hz_|, |samples_per_channel_|, and | 153 // |num_channels_|, |sample_rate_hz_|, |samples_per_channel_|, and |
167 // |vad_activity_| are updated upon success. If an error is returned, some | 154 // |vad_activity_| are updated upon success. If an error is returned, some |
168 // fields may not have been updated, or may contain inconsistent values. | 155 // fields may not have been updated, or may contain inconsistent values. |
169 // If muted state is enabled (through Config::enable_muted_state), |muted| | 156 // If muted state is enabled (through Config::enable_muted_state), |muted| |
170 // may be set to true after a prolonged expand period. When this happens, the | 157 // may be set to true after a prolonged expand period. When this happens, the |
171 // |data_| in |audio_frame| is not written, but should be interpreted as being | 158 // |data_| in |audio_frame| is not written, but should be interpreted as being |
172 // all zeros. | 159 // all zeros. |
173 // Returns kOK on success, or kFail in case of an error. | 160 // Returns kOK on success, or kFail in case of an error. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 288 |
302 protected: | 289 protected: |
303 NetEq() {} | 290 NetEq() {} |
304 | 291 |
305 private: | 292 private: |
306 RTC_DISALLOW_COPY_AND_ASSIGN(NetEq); | 293 RTC_DISALLOW_COPY_AND_ASSIGN(NetEq); |
307 }; | 294 }; |
308 | 295 |
309 } // namespace webrtc | 296 } // namespace webrtc |
310 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ | 297 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_INCLUDE_NETEQ_H_ |
OLD | NEW |