| 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 class RandomVector; | 50 class RandomVector; |
| 51 class SyncBuffer; | 51 class SyncBuffer; |
| 52 class TimestampScaler; | 52 class TimestampScaler; |
| 53 struct AccelerateFactory; | 53 struct AccelerateFactory; |
| 54 struct DtmfEvent; | 54 struct DtmfEvent; |
| 55 struct ExpandFactory; | 55 struct ExpandFactory; |
| 56 struct PreemptiveExpandFactory; | 56 struct PreemptiveExpandFactory; |
| 57 | 57 |
| 58 class NetEqImpl : public webrtc::NetEq { | 58 class NetEqImpl : public webrtc::NetEq { |
| 59 public: | 59 public: |
| 60 enum class OutputType { |
| 61 kNormalSpeech, |
| 62 kPLC, |
| 63 kCNG, |
| 64 kPLCCNG, |
| 65 kVadPassive |
| 66 }; |
| 67 |
| 60 // Creates a new NetEqImpl object. The object will assume ownership of all | 68 // Creates a new NetEqImpl object. The object will assume ownership of all |
| 61 // injected dependencies, and will delete them when done. | 69 // injected dependencies, and will delete them when done. |
| 62 NetEqImpl(const NetEq::Config& config, | 70 NetEqImpl(const NetEq::Config& config, |
| 63 BufferLevelFilter* buffer_level_filter, | 71 BufferLevelFilter* buffer_level_filter, |
| 64 DecoderDatabase* decoder_database, | 72 DecoderDatabase* decoder_database, |
| 65 DelayManager* delay_manager, | 73 DelayManager* delay_manager, |
| 66 DelayPeakDetector* delay_peak_detector, | 74 DelayPeakDetector* delay_peak_detector, |
| 67 DtmfBuffer* dtmf_buffer, | 75 DtmfBuffer* dtmf_buffer, |
| 68 DtmfToneGenerator* dtmf_tone_generator, | 76 DtmfToneGenerator* dtmf_tone_generator, |
| 69 PacketBuffer* packet_buffer, | 77 PacketBuffer* packet_buffer, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 89 // losses when Video NACK is enabled but Audio NACK is not. Clients of NetEq | 97 // losses when Video NACK is enabled but Audio NACK is not. Clients of NetEq |
| 90 // might insert sync-packet when they observe that buffer level of NetEq is | 98 // might insert sync-packet when they observe that buffer level of NetEq is |
| 91 // decreasing below a certain threshold, defined by the application. | 99 // decreasing below a certain threshold, defined by the application. |
| 92 // Sync-packets should have the same payload type as the last audio payload | 100 // Sync-packets should have the same payload type as the last audio payload |
| 93 // type, i.e. they cannot have DTMF or CNG payload type, nor a codec change | 101 // type, i.e. they cannot have DTMF or CNG payload type, nor a codec change |
| 94 // can be implied by inserting a sync-packet. | 102 // can be implied by inserting a sync-packet. |
| 95 // Returns kOk on success, kFail on failure. | 103 // Returns kOk on success, kFail on failure. |
| 96 int InsertSyncPacket(const WebRtcRTPHeader& rtp_header, | 104 int InsertSyncPacket(const WebRtcRTPHeader& rtp_header, |
| 97 uint32_t receive_timestamp) override; | 105 uint32_t receive_timestamp) override; |
| 98 | 106 |
| 99 int GetAudio(AudioFrame* audio_frame, NetEqOutputType* type) override; | 107 int GetAudio(AudioFrame* audio_frame) override; |
| 100 | 108 |
| 101 int RegisterPayloadType(NetEqDecoder codec, | 109 int RegisterPayloadType(NetEqDecoder codec, |
| 102 const std::string& codec_name, | 110 const std::string& codec_name, |
| 103 uint8_t rtp_payload_type) override; | 111 uint8_t rtp_payload_type) override; |
| 104 | 112 |
| 105 int RegisterExternalDecoder(AudioDecoder* decoder, | 113 int RegisterExternalDecoder(AudioDecoder* decoder, |
| 106 NetEqDecoder codec, | 114 NetEqDecoder codec, |
| 107 const std::string& codec_name, | 115 const std::string& codec_name, |
| 108 uint8_t rtp_payload_type, | 116 uint8_t rtp_payload_type, |
| 109 int sample_rate_hz) override; | 117 int sample_rate_hz) override; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 int ExtractPackets(size_t required_samples, PacketList* packet_list) | 311 int ExtractPackets(size_t required_samples, PacketList* packet_list) |
| 304 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 312 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 305 | 313 |
| 306 // Resets various variables and objects to new values based on the sample rate | 314 // Resets various variables and objects to new values based on the sample rate |
| 307 // |fs_hz| and |channels| number audio channels. | 315 // |fs_hz| and |channels| number audio channels. |
| 308 void SetSampleRateAndChannels(int fs_hz, size_t channels) | 316 void SetSampleRateAndChannels(int fs_hz, size_t channels) |
| 309 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 317 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 310 | 318 |
| 311 // Returns the output type for the audio produced by the latest call to | 319 // Returns the output type for the audio produced by the latest call to |
| 312 // GetAudio(). | 320 // GetAudio(). |
| 313 NetEqOutputType LastOutputType() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 321 OutputType LastOutputType() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 314 | 322 |
| 315 // Updates Expand and Merge. | 323 // Updates Expand and Merge. |
| 316 virtual void UpdatePlcComponents(int fs_hz, size_t channels) | 324 virtual void UpdatePlcComponents(int fs_hz, size_t channels) |
| 317 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 325 EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 318 | 326 |
| 319 // Creates DecisionLogic object with the mode given by |playout_mode_|. | 327 // Creates DecisionLogic object with the mode given by |playout_mode_|. |
| 320 virtual void CreateDecisionLogic() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); | 328 virtual void CreateDecisionLogic() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| 321 | 329 |
| 322 rtc::CriticalSection crit_sect_; | 330 rtc::CriticalSection crit_sect_; |
| 323 const std::unique_ptr<BufferLevelFilter> buffer_level_filter_ | 331 const std::unique_ptr<BufferLevelFilter> buffer_level_filter_ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 bool nack_enabled_ GUARDED_BY(crit_sect_); | 389 bool nack_enabled_ GUARDED_BY(crit_sect_); |
| 382 AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = | 390 AudioFrame::VADActivity last_vad_activity_ GUARDED_BY(crit_sect_) = |
| 383 AudioFrame::kVadPassive; | 391 AudioFrame::kVadPassive; |
| 384 | 392 |
| 385 private: | 393 private: |
| 386 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); | 394 RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl); |
| 387 }; | 395 }; |
| 388 | 396 |
| 389 } // namespace webrtc | 397 } // namespace webrtc |
| 390 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ | 398 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NETEQ_IMPL_H_ |
| OLD | NEW |