 Chromium Code Reviews
 Chromium Code Reviews Issue 2665693002:
  Moves channel-dependent audio input processing to separate encoder task queue  (Closed)
    
  
    Issue 2665693002:
  Moves channel-dependent audio input processing to separate encoder task queue  (Closed) 
  | 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 | 
| 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 
| 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 
| 13 | 13 | 
| 14 #include <memory> | 14 #include <memory> | 
| 15 | 15 | 
| 16 #include "webrtc/api/audio/audio_mixer.h" | 16 #include "webrtc/api/audio/audio_mixer.h" | 
| 17 #include "webrtc/api/call/audio_sink.h" | 17 #include "webrtc/api/call/audio_sink.h" | 
| 18 #include "webrtc/base/criticalsection.h" | 18 #include "webrtc/base/criticalsection.h" | 
| 19 #include "webrtc/base/event.h" | |
| 19 #include "webrtc/base/optional.h" | 20 #include "webrtc/base/optional.h" | 
| 20 #include "webrtc/base/thread_checker.h" | 21 #include "webrtc/base/thread_checker.h" | 
| 21 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 22 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 
| 22 #include "webrtc/common_types.h" | 23 #include "webrtc/common_types.h" | 
| 23 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" | 24 #include "webrtc/modules/audio_coding/acm2/codec_manager.h" | 
| 24 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 25 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 
| 25 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 26 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 
| 26 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d efines.h" | 27 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d efines.h" | 
| 27 #include "webrtc/modules/audio_processing/rms_level.h" | 28 #include "webrtc/modules/audio_processing/rms_level.h" | 
| 28 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 29 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 public AudioPacketizationCallback, // receive encoded packets from the | 137 public AudioPacketizationCallback, // receive encoded packets from the | 
| 137 // ACM | 138 // ACM | 
| 138 public MixerParticipant, // supplies output mixer with audio frames | 139 public MixerParticipant, // supplies output mixer with audio frames | 
| 139 public OverheadObserver { | 140 public OverheadObserver { | 
| 140 public: | 141 public: | 
| 141 friend class VoERtcpObserver; | 142 friend class VoERtcpObserver; | 
| 142 | 143 | 
| 143 enum { KNumSocketThreads = 1 }; | 144 enum { KNumSocketThreads = 1 }; | 
| 144 enum { KNumberOfSocketBuffers = 8 }; | 145 enum { KNumberOfSocketBuffers = 8 }; | 
| 145 virtual ~Channel(); | 146 virtual ~Channel(); | 
| 146 static int32_t CreateChannel( | 147 static int32_t CreateChannel(Channel*& channel, | 
| 147 Channel*& channel, | 148 int32_t channelId, | 
| 148 int32_t channelId, | 149 uint32_t instanceId, | 
| 149 uint32_t instanceId, | 150 const VoEBase::ChannelConfig& config); | 
| 150 const VoEBase::ChannelConfig& config); | |
| 151 Channel(int32_t channelId, | 151 Channel(int32_t channelId, | 
| 152 uint32_t instanceId, | 152 uint32_t instanceId, | 
| 153 const VoEBase::ChannelConfig& config); | 153 const VoEBase::ChannelConfig& config); | 
| 154 int32_t Init(); | 154 int32_t Init(); | 
| 155 void RegisterLegacyReceiveCodecs(); | 155 void RegisterLegacyReceiveCodecs(); | 
| 156 void Terminate(); | 156 void Terminate(); | 
| 157 int32_t SetEngineInformation(Statistics& engineStatistics, | 157 int32_t SetEngineInformation(Statistics& engineStatistics, | 
| 158 OutputMixer& outputMixer, | 158 OutputMixer& outputMixer, | 
| 159 ProcessThread& moduleProcessThread, | 159 ProcessThread& moduleProcessThread, | 
| 160 AudioDeviceModule& audioDeviceModule, | 160 AudioDeviceModule& audioDeviceModule, | 
| 161 VoiceEngineObserver* voiceEngineObserver, | 161 VoiceEngineObserver* voiceEngineObserver, | 
| 162 rtc::CriticalSection* callbackCritSect); | 162 rtc::CriticalSection* callbackCritSect, | 
| 163 int32_t UpdateLocalTimeStamp(); | 163 rtc::TaskQueue* encoder_queue); | 
| 164 | 164 | 
| 165 void SetSink(std::unique_ptr<AudioSinkInterface> sink); | 165 void SetSink(std::unique_ptr<AudioSinkInterface> sink); | 
| 166 | 166 | 
| 167 // TODO(ossu): Don't use! It's only here to confirm that the decoder factory | 167 // TODO(ossu): Don't use! It's only here to confirm that the decoder factory | 
| 168 // passed into AudioReceiveStream is the same as the one set when creating the | 168 // passed into AudioReceiveStream is the same as the one set when creating the | 
| 169 // ADM. Once Channel creation is moved into Audio{Send,Receive}Stream this can | 169 // ADM. Once Channel creation is moved into Audio{Send,Receive}Stream this can | 
| 170 // go. | 170 // go. | 
| 171 const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const; | 171 const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const; | 
| 172 | 172 | 
| 173 void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); | 173 void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs); | 
| 174 | 174 | 
| 175 // API methods | 175 // API methods | 
| 176 | 176 | 
| 177 // VoEBase | 177 // VoEBase | 
| 178 int32_t StartPlayout(); | 178 int32_t StartPlayout(); | 
| 179 int32_t StopPlayout(); | 179 int32_t StopPlayout(); | 
| 180 int32_t StartSend(); | 180 int32_t StartSend(); | 
| 181 int32_t StopSend(); | 181 void StopSend(); | 
| 182 int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); | 182 int32_t RegisterVoiceEngineObserver(VoiceEngineObserver& observer); | 
| 183 int32_t DeRegisterVoiceEngineObserver(); | 183 int32_t DeRegisterVoiceEngineObserver(); | 
| 184 | 184 | 
| 185 // VoECodec | 185 // VoECodec | 
| 186 int32_t GetSendCodec(CodecInst& codec); | 186 int32_t GetSendCodec(CodecInst& codec); | 
| 187 int32_t GetRecCodec(CodecInst& codec); | 187 int32_t GetRecCodec(CodecInst& codec); | 
| 188 int32_t SetSendCodec(const CodecInst& codec); | 188 int32_t SetSendCodec(const CodecInst& codec); | 
| 189 void SetBitRate(int bitrate_bps, int64_t probing_interval_ms); | 189 void SetBitRate(int bitrate_bps, int64_t probing_interval_ms); | 
| 190 int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX); | 190 int32_t SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX); | 
| 191 int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX); | 191 int32_t GetVADStatus(bool& enabledVAD, ACMVADMode& mode, bool& disabledDTX); | 
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 347 uint32_t InstanceId() const { return _instanceId; } | 347 uint32_t InstanceId() const { return _instanceId; } | 
| 348 int32_t ChannelId() const { return _channelId; } | 348 int32_t ChannelId() const { return _channelId; } | 
| 349 bool Playing() const { return channel_state_.Get().playing; } | 349 bool Playing() const { return channel_state_.Get().playing; } | 
| 350 bool Sending() const { return channel_state_.Get().sending; } | 350 bool Sending() const { return channel_state_.Get().sending; } | 
| 351 bool ExternalTransport() const { | 351 bool ExternalTransport() const { | 
| 352 rtc::CritScope cs(&_callbackCritSect); | 352 rtc::CritScope cs(&_callbackCritSect); | 
| 353 return _externalTransport; | 353 return _externalTransport; | 
| 354 } | 354 } | 
| 355 RtpRtcp* RtpRtcpModulePtr() const { return _rtpRtcpModule.get(); } | 355 RtpRtcp* RtpRtcpModulePtr() const { return _rtpRtcpModule.get(); } | 
| 356 int8_t OutputEnergyLevel() const { return _outputAudioLevel.Level(); } | 356 int8_t OutputEnergyLevel() const { return _outputAudioLevel.Level(); } | 
| 357 uint32_t Demultiplex(const AudioFrame& audioFrame); | 357 | 
| 358 // Demultiplex the data to the channel's |_audioFrame|. The difference | 358 // ProcessAndEncodeAudio() creates an audio frame copy and posts a task | 
| 359 // between this method and the overloaded method above is that |audio_data| | 359 // on the shared encoder task queue, wich in turn calls (on the queue) | 
| 360 // does not go through transmit_mixer and APM. | 360 // ProcessAndEncodeAudioOnTaskQueue() where the actual processing of the | 
| 361 void Demultiplex(const int16_t* audio_data, | 361 // audio takes place. The processing mainly consists of encoding and preparing | 
| 362 int sample_rate, | 362 // the result for sending by adding it to a send queue. | 
| 363 size_t number_of_frames, | 363 // The main reason for using a task queue here is to release the native, | 
| 364 size_t number_of_channels); | 364 // OS-specific, audio capture thread as soon as possible to ensure that it | 
| 365 uint32_t PrepareEncodeAndSend(int mixingFrequency); | 365 // can go back to sleep and be prepared to deliver an new captured audio | 
| 366 uint32_t EncodeAndSend(); | 366 // packet. | 
| 367 void ProcessAndEncodeAudio(const AudioFrame& audio_input); | |
| 368 | |
| 369 // This version of ProcessAndEncodeAudio() is used by PushCaptureData() in | |
| 370 // VoEBase and the audio in |audio_data| has not been subject to any APM | |
| 371 // processing. Some extra steps are therfore needed when building up the | |
| 372 // audio frame copy before using the same task as in the default call to | |
| 373 // ProcessAndEncodeAudio(const AudioFrame& audio_input). | |
| 374 void ProcessAndEncodeAudio(const int16_t* audio_data, | |
| 375 int sample_rate, | |
| 376 size_t number_of_frames, | |
| 377 size_t number_of_channels); | |
| 378 | |
| 379 // Called on the encoder task queue when a new input audio frame is ready | |
| 380 // for encoding. | |
| 381 void ProcessAndEncodeAudioOnTaskQueue(AudioFrame* audio_input); | |
| 
the sun
2017/03/30 10:13:33
Move to private:
 
henrika_webrtc
2017/03/30 11:16:31
Done.
 | |
| 367 | 382 | 
| 368 // Associate to a send channel. | 383 // Associate to a send channel. | 
| 369 // Used for obtaining RTT for a receive-only channel. | 384 // Used for obtaining RTT for a receive-only channel. | 
| 370 void set_associate_send_channel(const ChannelOwner& channel); | 385 void set_associate_send_channel(const ChannelOwner& channel); | 
| 371 // Disassociate a send channel if it was associated. | 386 // Disassociate a send channel if it was associated. | 
| 372 void DisassociateSendChannel(int channel_id); | 387 void DisassociateSendChannel(int channel_id); | 
| 373 | 388 | 
| 374 // Set a RtcEventLog logging object. | 389 // Set a RtcEventLog logging object. | 
| 375 void SetRtcEventLog(RtcEventLog* event_log); | 390 void SetRtcEventLog(RtcEventLog* event_log); | 
| 376 | 391 | 
| 377 void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats); | 392 void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats); | 
| 378 void SetTransportOverhead(size_t transport_overhead_per_packet); | 393 void SetTransportOverhead(size_t transport_overhead_per_packet); | 
| 379 | 394 | 
| 380 // From OverheadObserver in the RTP/RTCP module | 395 // From OverheadObserver in the RTP/RTCP module | 
| 381 void OnOverheadChanged(size_t overhead_bytes_per_packet) override; | 396 void OnOverheadChanged(size_t overhead_bytes_per_packet) override; | 
| 382 | 397 | 
| 383 // The existence of this function alongside OnUplinkPacketLossRate is | 398 // The existence of this function alongside OnUplinkPacketLossRate is | 
| 384 // a compromise. We want the encoder to be agnostic of the PLR source, but | 399 // a compromise. We want the encoder to be agnostic of the PLR source, but | 
| 385 // we also don't want it to receive conflicting information from TWCC and | 400 // we also don't want it to receive conflicting information from TWCC and | 
| 386 // from RTCP-XR. | 401 // from RTCP-XR. | 
| 387 void OnTwccBasedUplinkPacketLossRate(float packet_loss_rate); | 402 void OnTwccBasedUplinkPacketLossRate(float packet_loss_rate); | 
| 388 | 403 | 
| 389 void OnRecoverableUplinkPacketLossRate(float recoverable_packet_loss_rate); | 404 void OnRecoverableUplinkPacketLossRate(float recoverable_packet_loss_rate); | 
| 390 | 405 | 
| 391 private: | 406 private: | 
| 407 class ProcessAndEncodeAudioTask; | |
| 408 | |
| 392 void OnUplinkPacketLossRate(float packet_loss_rate); | 409 void OnUplinkPacketLossRate(float packet_loss_rate); | 
| 393 | |
| 394 bool InputMute() const; | 410 bool InputMute() const; | 
| 395 bool OnRtpPacketWithHeader(const uint8_t* received_packet, | 411 bool OnRtpPacketWithHeader(const uint8_t* received_packet, | 
| 396 size_t length, | 412 size_t length, | 
| 397 RTPHeader *header); | 413 RTPHeader *header); | 
| 398 bool ReceivePacket(const uint8_t* packet, | 414 bool ReceivePacket(const uint8_t* packet, | 
| 399 size_t packet_length, | 415 size_t packet_length, | 
| 400 const RTPHeader& header, | 416 const RTPHeader& header, | 
| 401 bool in_order); | 417 bool in_order); | 
| 402 bool HandleRtxPacket(const uint8_t* packet, | 418 bool HandleRtxPacket(const uint8_t* packet, | 
| 403 size_t packet_length, | 419 size_t packet_length, | 
| 404 const RTPHeader& header); | 420 const RTPHeader& header); | 
| 405 bool IsPacketInOrder(const RTPHeader& header) const; | 421 bool IsPacketInOrder(const RTPHeader& header) const; | 
| 406 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; | 422 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; | 
| 407 int ResendPackets(const uint16_t* sequence_numbers, int length); | 423 int ResendPackets(const uint16_t* sequence_numbers, int length); | 
| 408 int32_t MixOrReplaceAudioWithFile(int mixingFrequency); | 424 int32_t MixOrReplaceAudioWithFile(AudioFrame* audio_frame); | 
| 409 int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency); | 425 int32_t MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency); | 
| 410 void UpdatePlayoutTimestamp(bool rtcp); | 426 void UpdatePlayoutTimestamp(bool rtcp); | 
| 411 void RegisterReceiveCodecsToRTPModule(); | 427 void RegisterReceiveCodecsToRTPModule(); | 
| 412 | 428 | 
| 413 int SetSendRtpHeaderExtension(bool enable, | 429 int SetSendRtpHeaderExtension(bool enable, | 
| 414 RTPExtensionType type, | 430 RTPExtensionType type, | 
| 415 unsigned char id); | 431 unsigned char id); | 
| 416 | 432 | 
| 417 void UpdateOverheadForEncoder() | 433 void UpdateOverheadForEncoder() | 
| 418 EXCLUSIVE_LOCKS_REQUIRED(overhead_per_packet_lock_); | 434 EXCLUSIVE_LOCKS_REQUIRED(overhead_per_packet_lock_); | 
| 419 | 435 | 
| 420 int GetRtpTimestampRateHz() const; | 436 int GetRtpTimestampRateHz() const; | 
| 421 int64_t GetRTT(bool allow_associate_channel) const; | 437 int64_t GetRTT(bool allow_associate_channel) const; | 
| 422 | 438 | 
| 439 uint32_t _instanceId; | |
| 440 int32_t _channelId; | |
| 441 | |
| 423 rtc::CriticalSection _fileCritSect; | 442 rtc::CriticalSection _fileCritSect; | 
| 424 rtc::CriticalSection _callbackCritSect; | 443 rtc::CriticalSection _callbackCritSect; | 
| 425 rtc::CriticalSection volume_settings_critsect_; | 444 rtc::CriticalSection volume_settings_critsect_; | 
| 426 uint32_t _instanceId; | |
| 427 int32_t _channelId; | |
| 428 | 445 | 
| 429 ChannelState channel_state_; | 446 ChannelState channel_state_; | 
| 430 | 447 | 
| 431 std::unique_ptr<voe::RtcEventLogProxy> event_log_proxy_; | 448 std::unique_ptr<voe::RtcEventLogProxy> event_log_proxy_; | 
| 432 std::unique_ptr<voe::RtcpRttStatsProxy> rtcp_rtt_stats_proxy_; | 449 std::unique_ptr<voe::RtcpRttStatsProxy> rtcp_rtt_stats_proxy_; | 
| 433 | 450 | 
| 434 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 451 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 
| 435 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; | 452 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; | 
| 436 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; | 453 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; | 
| 437 std::unique_ptr<RtpReceiver> rtp_receiver_; | 454 std::unique_ptr<RtpReceiver> rtp_receiver_; | 
| 438 TelephoneEventHandler* telephone_event_handler_; | 455 TelephoneEventHandler* telephone_event_handler_; | 
| 439 std::unique_ptr<RtpRtcp> _rtpRtcpModule; | 456 std::unique_ptr<RtpRtcp> _rtpRtcpModule; | 
| 440 std::unique_ptr<AudioCodingModule> audio_coding_; | 457 std::unique_ptr<AudioCodingModule> audio_coding_; | 
| 441 acm2::CodecManager codec_manager_; | 458 acm2::CodecManager codec_manager_; | 
| 442 acm2::RentACodec rent_a_codec_; | 459 acm2::RentACodec rent_a_codec_; | 
| 443 std::unique_ptr<AudioSinkInterface> audio_sink_; | 460 std::unique_ptr<AudioSinkInterface> audio_sink_; | 
| 444 AudioLevel _outputAudioLevel; | 461 AudioLevel _outputAudioLevel; | 
| 445 bool _externalTransport; | 462 bool _externalTransport; | 
| 446 AudioFrame _audioFrame; | |
| 447 // Downsamples to the codec rate if necessary. | 463 // Downsamples to the codec rate if necessary. | 
| 448 PushResampler<int16_t> input_resampler_; | 464 PushResampler<int16_t> input_resampler_; | 
| 449 std::unique_ptr<FilePlayer> input_file_player_; | 465 std::unique_ptr<FilePlayer> input_file_player_; | 
| 450 std::unique_ptr<FilePlayer> output_file_player_; | 466 std::unique_ptr<FilePlayer> output_file_player_; | 
| 451 std::unique_ptr<FileRecorder> output_file_recorder_; | 467 std::unique_ptr<FileRecorder> output_file_recorder_; | 
| 452 int _inputFilePlayerId; | 468 int _inputFilePlayerId; | 
| 453 int _outputFilePlayerId; | 469 int _outputFilePlayerId; | 
| 454 int _outputFileRecorderId; | 470 int _outputFileRecorderId; | 
| 455 bool _outputFileRecording; | 471 bool _outputFileRecording; | 
| 456 uint32_t _timeStamp; | 472 uint32_t _timeStamp ACCESS_ON(encoder_queue_); | 
| 457 | 473 | 
| 458 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); | 474 RemoteNtpTimeEstimator ntp_estimator_ GUARDED_BY(ts_stats_lock_); | 
| 459 | 475 | 
| 460 // Timestamp of the audio pulled from NetEq. | 476 // Timestamp of the audio pulled from NetEq. | 
| 461 rtc::Optional<uint32_t> jitter_buffer_playout_timestamp_; | 477 rtc::Optional<uint32_t> jitter_buffer_playout_timestamp_; | 
| 462 | 478 | 
| 463 rtc::CriticalSection video_sync_lock_; | 479 rtc::CriticalSection video_sync_lock_; | 
| 464 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_); | 480 uint32_t playout_timestamp_rtp_ GUARDED_BY(video_sync_lock_); | 
| 465 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_); | 481 uint32_t playout_delay_ms_ GUARDED_BY(video_sync_lock_); | 
| 466 uint16_t send_sequence_number_; | 482 uint16_t send_sequence_number_; | 
| 467 uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes]; | 483 uint8_t restored_packet_[kVoiceEngineMaxIpPacketSizeBytes]; | 
| 468 | 484 | 
| 469 rtc::CriticalSection ts_stats_lock_; | 485 rtc::CriticalSection ts_stats_lock_; | 
| 470 | 486 | 
| 471 std::unique_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_; | 487 std::unique_ptr<rtc::TimestampWrapAroundHandler> rtp_ts_wraparound_handler_; | 
| 472 // The rtp timestamp of the first played out audio frame. | 488 // The rtp timestamp of the first played out audio frame. | 
| 473 int64_t capture_start_rtp_time_stamp_; | 489 int64_t capture_start_rtp_time_stamp_; | 
| 474 // The capture ntp time (in local timebase) of the first played out audio | 490 // The capture ntp time (in local timebase) of the first played out audio | 
| 475 // frame. | 491 // frame. | 
| 476 int64_t capture_start_ntp_time_ms_ GUARDED_BY(ts_stats_lock_); | 492 int64_t capture_start_ntp_time_ms_ GUARDED_BY(ts_stats_lock_); | 
| 477 | 493 | 
| 478 // uses | 494 // uses | 
| 479 Statistics* _engineStatisticsPtr; | 495 Statistics* _engineStatisticsPtr; | 
| 480 OutputMixer* _outputMixerPtr; | 496 OutputMixer* _outputMixerPtr; | 
| 481 ProcessThread* _moduleProcessThreadPtr; | 497 ProcessThread* _moduleProcessThreadPtr; | 
| 482 AudioDeviceModule* _audioDeviceModulePtr; | 498 AudioDeviceModule* _audioDeviceModulePtr; | 
| 483 VoiceEngineObserver* _voiceEngineObserverPtr; // owned by base | 499 VoiceEngineObserver* _voiceEngineObserverPtr; // owned by base | 
| 484 rtc::CriticalSection* _callbackCritSectPtr; // owned by base | 500 rtc::CriticalSection* _callbackCritSectPtr; // owned by base | 
| 485 Transport* _transportPtr; // WebRtc socket or external transport | 501 Transport* _transportPtr; // WebRtc socket or external transport | 
| 486 RmsLevel rms_level_; | 502 RmsLevel rms_level_ ACCESS_ON(encoder_queue_); | 
| 487 bool input_mute_ GUARDED_BY(volume_settings_critsect_); | 503 bool input_mute_ GUARDED_BY(volume_settings_critsect_); | 
| 488 bool previous_frame_muted_; // Only accessed from PrepareEncodeAndSend(). | 504 bool previous_frame_muted_ ACCESS_ON(encoder_queue_); | 
| 489 float _outputGain GUARDED_BY(volume_settings_critsect_); | 505 float _outputGain GUARDED_BY(volume_settings_critsect_); | 
| 490 // VoEBase | 506 // VoEBase | 
| 491 bool _mixFileWithMicrophone; | 507 bool _mixFileWithMicrophone; | 
| 492 // VoeRTP_RTCP | 508 // VoeRTP_RTCP | 
| 493 uint32_t _lastLocalTimeStamp; | 509 // TODO(henrika): can today be accessed on the main thread and on the | 
| 494 int8_t _lastPayloadType; | 510 // task queue; hence potential race. | 
| 495 bool _includeAudioLevelIndication; | 511 bool _includeAudioLevelIndication; | 
| 496 size_t transport_overhead_per_packet_ GUARDED_BY(overhead_per_packet_lock_); | 512 size_t transport_overhead_per_packet_ GUARDED_BY(overhead_per_packet_lock_); | 
| 497 size_t rtp_overhead_per_packet_ GUARDED_BY(overhead_per_packet_lock_); | 513 size_t rtp_overhead_per_packet_ GUARDED_BY(overhead_per_packet_lock_); | 
| 498 rtc::CriticalSection overhead_per_packet_lock_; | 514 rtc::CriticalSection overhead_per_packet_lock_; | 
| 499 // VoENetwork | 515 // VoENetwork | 
| 500 AudioFrame::SpeechType _outputSpeechType; | 516 AudioFrame::SpeechType _outputSpeechType; | 
| 501 // DTX. | 517 // DTX. | 
| 502 bool restored_packet_in_use_; | 518 bool restored_packet_in_use_; | 
| 503 // RtcpBandwidthObserver | 519 // RtcpBandwidthObserver | 
| 504 std::unique_ptr<VoERtcpObserver> rtcp_observer_; | 520 std::unique_ptr<VoERtcpObserver> rtcp_observer_; | 
| 505 // An associated send channel. | 521 // An associated send channel. | 
| 506 rtc::CriticalSection assoc_send_channel_lock_; | 522 rtc::CriticalSection assoc_send_channel_lock_; | 
| 507 ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_); | 523 ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_); | 
| 508 | 524 | 
| 509 bool pacing_enabled_; | 525 bool pacing_enabled_; | 
| 510 PacketRouter* packet_router_ = nullptr; | 526 PacketRouter* packet_router_ = nullptr; | 
| 511 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; | 527 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; | 
| 512 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; | 528 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; | 
| 513 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; | 529 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; | 
| 514 std::unique_ptr<RateLimiter> retransmission_rate_limiter_; | 530 std::unique_ptr<RateLimiter> retransmission_rate_limiter_; | 
| 515 | 531 | 
| 516 // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. | 532 // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. | 
| 517 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; | 533 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; | 
| 518 | 534 | 
| 519 rtc::ThreadChecker construction_thread_; | 535 rtc::ThreadChecker construction_thread_; | 
| 520 | 536 | 
| 521 const bool use_twcc_plr_for_ana_; | 537 const bool use_twcc_plr_for_ana_; | 
| 538 | |
| 539 rtc::TaskQueue* encoder_queue_ = nullptr; | |
| 522 }; | 540 }; | 
| 523 | 541 | 
| 524 } // namespace voe | 542 } // namespace voe | 
| 525 } // namespace webrtc | 543 } // namespace webrtc | 
| 526 | 544 | 
| 527 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 545 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 
| OLD | NEW |