| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // losses when Video NACK is enabled but Audio NACK is not. Clients of NetEq | 110 // losses when Video NACK is enabled but Audio NACK is not. Clients of NetEq |
| 111 // might insert sync-packet when they observe that buffer level of NetEq is | 111 // might insert sync-packet when they observe that buffer level of NetEq is |
| 112 // decreasing below a certain threshold, defined by the application. | 112 // decreasing below a certain threshold, defined by the application. |
| 113 // Sync-packets should have the same payload type as the last audio payload | 113 // Sync-packets should have the same payload type as the last audio payload |
| 114 // type, i.e. they cannot have DTMF or CNG payload type, nor a codec change | 114 // type, i.e. they cannot have DTMF or CNG payload type, nor a codec change |
| 115 // can be implied by inserting a sync-packet. | 115 // can be implied by inserting a sync-packet. |
| 116 // Returns kOk on success, kFail on failure. | 116 // Returns kOk on success, kFail on failure. |
| 117 int InsertSyncPacket(const WebRtcRTPHeader& rtp_header, | 117 int InsertSyncPacket(const WebRtcRTPHeader& rtp_header, |
| 118 uint32_t receive_timestamp) override; | 118 uint32_t receive_timestamp) override; |
| 119 | 119 |
| 120 int GetAudio(AudioFrame* audio_frame) override; | 120 int GetAudio(AudioFrame* audio_frame, bool* muted) override; |
| 121 | 121 |
| 122 int RegisterPayloadType(NetEqDecoder codec, | 122 int RegisterPayloadType(NetEqDecoder codec, |
| 123 const std::string& codec_name, | 123 const std::string& codec_name, |
| 124 uint8_t rtp_payload_type) override; | 124 uint8_t rtp_payload_type) override; |
| 125 | 125 |
| 126 int RegisterExternalDecoder(AudioDecoder* decoder, | 126 int RegisterExternalDecoder(AudioDecoder* decoder, |
| 127 NetEqDecoder codec, | 127 NetEqDecoder codec, |
| 128 const std::string& codec_name, | 128 const std::string& codec_name, |
| 129 uint8_t rtp_payload_type, | 129 uint8_t rtp_payload_type, |
| 130 int sample_rate_hz) override; | 130 int sample_rate_hz) override; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // above. Returns 0 on success, otherwise an error code. | 218 // above. Returns 0 on success, otherwise an error code. |
| 219 // TODO(hlundin): Merge this with InsertPacket above? | 219 // TODO(hlundin): Merge this with InsertPacket above? |
| 220 int InsertPacketInternal(const WebRtcRTPHeader& rtp_header, | 220 int InsertPacketInternal(const WebRtcRTPHeader& rtp_header, |
| 221 rtc::ArrayView<const uint8_t> payload, | 221 rtc::ArrayView<const uint8_t> payload, |
| 222 uint32_t receive_timestamp, | 222 uint32_t receive_timestamp, |
| 223 bool is_sync_packet) | 223 bool is_sync_packet) |
| 224 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 224 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 225 | 225 |
| 226 // Delivers 10 ms of audio data. The data is written to |audio_frame|. | 226 // Delivers 10 ms of audio data. The data is written to |audio_frame|. |
| 227 // Returns 0 on success, otherwise an error code. | 227 // Returns 0 on success, otherwise an error code. |
| 228 int GetAudioInternal(AudioFrame* audio_frame) | 228 int GetAudioInternal(AudioFrame* audio_frame, bool* muted) |
| 229 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 229 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 230 | 230 |
| 231 // Provides a decision to the GetAudioInternal method. The decision what to | 231 // Provides a decision to the GetAudioInternal method. The decision what to |
| 232 // do is written to |operation|. Packets to decode are written to | 232 // do is written to |operation|. Packets to decode are written to |
| 233 // |packet_list|, and a DTMF event to play is written to |dtmf_event|. When | 233 // |packet_list|, and a DTMF event to play is written to |dtmf_event|. When |
| 234 // DTMF should be played, |play_dtmf| is set to true by the method. | 234 // DTMF should be played, |play_dtmf| is set to true by the method. |
| 235 // Returns 0 on success, otherwise an error code. | 235 // Returns 0 on success, otherwise an error code. |
| 236 int GetDecision(Operations* operation, | 236 int GetDecision(Operations* operation, |
| 237 PacketList* packet_list, | 237 PacketList* packet_list, |
| 238 DtmfEvent* dtmf_event, | 238 DtmfEvent* dtmf_event, |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 uint8_t current_cng_rtp_payload_type_ GUARDED_BY(crit_sect_); | 398 uint8_t current_cng_rtp_payload_type_ GUARDED_BY(crit_sect_); |
| 399 uint32_t ssrc_ GUARDED_BY(crit_sect_); | 399 uint32_t ssrc_ GUARDED_BY(crit_sect_); |
| 400 bool first_packet_ GUARDED_BY(crit_sect_); | 400 bool first_packet_ GUARDED_BY(crit_sect_); |
| 401 int error_code_ GUARDED_BY(crit_sect_); // Store last error code. | 401 int error_code_ GUARDED_BY(crit_sect_); // Store last error code. |
| 402 int decoder_error_code_ GUARDED_BY(crit_sect_); | 402 int decoder_error_code_ GUARDED_BY(crit_sect_); |
| 403 const BackgroundNoiseMode background_noise_mode_ GUARDED_BY(crit_sect_); | 403 const BackgroundNoiseMode background_noise_mode_ GUARDED_BY(crit_sect_); |
| 404 NetEqPlayoutMode playout_mode_ GUARDED_BY(crit_sect_); | 404 NetEqPlayoutMode playout_mode_ GUARDED_BY(crit_sect_); |
| 405 bool enable_fast_accelerate_ GUARDED_BY(crit_sect_); | 405 bool enable_fast_accelerate_ GUARDED_BY(crit_sect_); |
| 406 std::unique_ptr<Nack> nack_ GUARDED_BY(crit_sect_); | 406 std::unique_ptr<Nack> nack_ GUARDED_BY(crit_sect_); |
| 407 bool nack_enabled_ GUARDED_BY(crit_sect_); | 407 bool nack_enabled_ GUARDED_BY(crit_sect_); |
| 408 const bool enable_muted_state_ GUARDED_BY(crit_sect_); |
| 408 AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = | 409 AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = |
| 409 AudioFrame::kVadPassive; | 410 AudioFrame::kVadPassive; |
| 410 std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_ | 411 std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_ |
| 411 GUARDED_BY(crit_sect_); | 412 GUARDED_BY(crit_sect_); |
| 412 | 413 |
| 413 private: | 414 private: |
| 414 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); | 415 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); |
| 415 }; | 416 }; |
| 416 | 417 |
| 417 } // namespace webrtc | 418 } // namespace webrtc |
| 418 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ | 419 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ |
| OLD | NEW |