Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl.h

Issue 1334303005: Returning correct duration estimate on Opus DTX packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fixing a silly mistake in unittest Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // elements. The length of the decoded data is written to |decoded_length|. 236 // elements. The length of the decoded data is written to |decoded_length|.
237 // The speech type -- speech or (codec-internal) comfort noise -- is written 237 // The speech type -- speech or (codec-internal) comfort noise -- is written
238 // to |speech_type|. If |packet_list| contains any SID frames for RFC 3389 238 // to |speech_type|. If |packet_list| contains any SID frames for RFC 3389
239 // comfort noise, those are not decoded. 239 // comfort noise, those are not decoded.
240 int Decode(PacketList* packet_list, 240 int Decode(PacketList* packet_list,
241 Operations* operation, 241 Operations* operation,
242 int* decoded_length, 242 int* decoded_length,
243 AudioDecoder::SpeechType* speech_type) 243 AudioDecoder::SpeechType* speech_type)
244 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); 244 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
245 245
246 // Sub-method to Decode(). Performs codec internal CNG.
247 int DecodeCng(AudioDecoder* decoder, int* decoded_length,
248 AudioDecoder::SpeechType* speech_type)
249 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
250
246 // Sub-method to Decode(). Performs the actual decoding. 251 // Sub-method to Decode(). Performs the actual decoding.
247 int DecodeLoop(PacketList* packet_list, 252 int DecodeLoop(PacketList* packet_list,
248 Operations* operation, 253 const Operations& operation,
249 AudioDecoder* decoder, 254 AudioDecoder* decoder,
250 int* decoded_length, 255 int* decoded_length,
251 AudioDecoder::SpeechType* speech_type) 256 AudioDecoder::SpeechType* speech_type)
252 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); 257 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
253 258
254 // Sub-method which calls the Normal class to perform the normal operation. 259 // Sub-method which calls the Normal class to perform the normal operation.
255 void DoNormal(const int16_t* decoded_buffer, 260 void DoNormal(const int16_t* decoded_buffer,
256 size_t decoded_length, 261 size_t decoded_length,
257 AudioDecoder::SpeechType speech_type, 262 AudioDecoder::SpeechType speech_type,
258 bool play_dtmf) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); 263 bool play_dtmf) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
(...skipping 24 matching lines...) Expand all
283 288
284 // Sub-method which calls the ComfortNoise class to generate RFC 3389 comfort 289 // Sub-method which calls the ComfortNoise class to generate RFC 3389 comfort
285 // noise. |packet_list| can either contain one SID frame to update the 290 // noise. |packet_list| can either contain one SID frame to update the
286 // noise parameters, or no payload at all, in which case the previously 291 // noise parameters, or no payload at all, in which case the previously
287 // received parameters are used. 292 // received parameters are used.
288 int DoRfc3389Cng(PacketList* packet_list, bool play_dtmf) 293 int DoRfc3389Cng(PacketList* packet_list, bool play_dtmf)
289 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); 294 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
290 295
291 // Calls the audio decoder to generate codec-internal comfort noise when 296 // Calls the audio decoder to generate codec-internal comfort noise when
292 // no packet was received. 297 // no packet was received.
293 void DoCodecInternalCng() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); 298 void DoCodecInternalCng(const int16_t* decoded_buffer, size_t decoded_length)
299 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
294 300
295 // Calls the DtmfToneGenerator class to generate DTMF tones. 301 // Calls the DtmfToneGenerator class to generate DTMF tones.
296 int DoDtmf(const DtmfEvent& dtmf_event, bool* play_dtmf) 302 int DoDtmf(const DtmfEvent& dtmf_event, bool* play_dtmf)
297 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); 303 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
298 304
299 // Produces packet-loss concealment using alternative methods. If the codec 305 // Produces packet-loss concealment using alternative methods. If the codec
300 // has an internal PLC, it is called to generate samples. Otherwise, the 306 // has an internal PLC, it is called to generate samples. Otherwise, the
301 // method performs zero-stuffing. 307 // method performs zero-stuffing.
302 void DoAlternativePlc(bool increase_timestamp) 308 void DoAlternativePlc(bool increase_timestamp)
303 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); 309 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // module is designed to compensate for this. 403 // module is designed to compensate for this.
398 int decoded_packet_sequence_number_ GUARDED_BY(crit_sect_); 404 int decoded_packet_sequence_number_ GUARDED_BY(crit_sect_);
399 uint32_t decoded_packet_timestamp_ GUARDED_BY(crit_sect_); 405 uint32_t decoded_packet_timestamp_ GUARDED_BY(crit_sect_);
400 406
401 private: 407 private:
402 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); 408 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl);
403 }; 409 };
404 410
405 } // namespace webrtc 411 } // namespace webrtc
406 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ 412 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/opus/opus_unittest.cc ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698