Chromium Code Reviews| Index: webrtc/voice_engine/channel.cc |
| diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc |
| index 8992425b537b0e32d329a470d58fe50d2619171d..eeecc64acc20b131c960ada57e02f7573e1ce7eb 100644 |
| --- a/webrtc/voice_engine/channel.cc |
| +++ b/webrtc/voice_engine/channel.cc |
| @@ -628,17 +628,16 @@ Channel::NeededFrequency(int32_t id) |
| return(highestNeeded); |
| } |
| -int32_t |
| -Channel::CreateChannel(Channel*& channel, |
| - int32_t channelId, |
| - uint32_t instanceId, |
| - const Config& config) |
| -{ |
| +int32_t Channel::CreateChannel(Channel*& channel, |
| + int32_t channelId, |
| + uint32_t instanceId, |
| + RtcEventLog* const event_log, |
| + const Config& config) { |
| WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId,channelId), |
| "Channel::CreateChannel(channelId=%d, instanceId=%d)", |
| channelId, instanceId); |
| - channel = new Channel(channelId, instanceId, config); |
| + channel = new Channel(channelId, instanceId, event_log, config); |
| if (channel == NULL) |
| { |
| WEBRTC_TRACE(kTraceMemory, kTraceVoice, |
| @@ -713,86 +712,92 @@ Channel::RecordFileEnded(int32_t id) |
| Channel::Channel(int32_t channelId, |
| uint32_t instanceId, |
| - const Config& config) : |
| - _fileCritSect(*CriticalSectionWrapper::CreateCriticalSection()), |
| - _callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()), |
| - volume_settings_critsect_(*CriticalSectionWrapper::CreateCriticalSection()), |
| - _instanceId(instanceId), |
| - _channelId(channelId), |
| - rtp_header_parser_(RtpHeaderParser::Create()), |
| - rtp_payload_registry_( |
| - new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), |
| - rtp_receive_statistics_(ReceiveStatistics::Create( |
| - Clock::GetRealTimeClock())), |
| - rtp_receiver_(RtpReceiver::CreateAudioReceiver( |
| - VoEModuleId(instanceId, channelId), Clock::GetRealTimeClock(), this, |
| - this, this, rtp_payload_registry_.get())), |
| - telephone_event_handler_(rtp_receiver_->GetTelephoneEventHandler()), |
| - _outputAudioLevel(), |
| - _externalTransport(false), |
| - _inputFilePlayerPtr(NULL), |
| - _outputFilePlayerPtr(NULL), |
| - _outputFileRecorderPtr(NULL), |
| - // Avoid conflict with other channels by adding 1024 - 1026, |
| - // won't use as much as 1024 channels. |
| - _inputFilePlayerId(VoEModuleId(instanceId, channelId) + 1024), |
| - _outputFilePlayerId(VoEModuleId(instanceId, channelId) + 1025), |
| - _outputFileRecorderId(VoEModuleId(instanceId, channelId) + 1026), |
| - _outputFileRecording(false), |
| - _inbandDtmfQueue(VoEModuleId(instanceId, channelId)), |
| - _inbandDtmfGenerator(VoEModuleId(instanceId, channelId)), |
| - _outputExternalMedia(false), |
| - _inputExternalMediaCallbackPtr(NULL), |
| - _outputExternalMediaCallbackPtr(NULL), |
| - _timeStamp(0), // This is just an offset, RTP module will add it's own random offset |
| - _sendTelephoneEventPayloadType(106), |
| - ntp_estimator_(Clock::GetRealTimeClock()), |
| - jitter_buffer_playout_timestamp_(0), |
| - playout_timestamp_rtp_(0), |
| - playout_timestamp_rtcp_(0), |
| - playout_delay_ms_(0), |
| - _numberOfDiscardedPackets(0), |
| - send_sequence_number_(0), |
| - ts_stats_lock_(CriticalSectionWrapper::CreateCriticalSection()), |
| - rtp_ts_wraparound_handler_(new rtc::TimestampWrapAroundHandler()), |
| - capture_start_rtp_time_stamp_(-1), |
| - capture_start_ntp_time_ms_(-1), |
| - _engineStatisticsPtr(NULL), |
| - _outputMixerPtr(NULL), |
| - _transmitMixerPtr(NULL), |
| - _moduleProcessThreadPtr(NULL), |
| - _audioDeviceModulePtr(NULL), |
| - _voiceEngineObserverPtr(NULL), |
| - _callbackCritSectPtr(NULL), |
| - _transportPtr(NULL), |
| - _rxVadObserverPtr(NULL), |
| - _oldVadDecision(-1), |
| - _sendFrameType(0), |
| - _externalMixing(false), |
| - _mixFileWithMicrophone(false), |
| - _mute(false), |
| - _panLeft(1.0f), |
| - _panRight(1.0f), |
| - _outputGain(1.0f), |
| - _playOutbandDtmfEvent(false), |
| - _playInbandDtmfEvent(false), |
| - _lastLocalTimeStamp(0), |
| - _lastPayloadType(0), |
| - _includeAudioLevelIndication(false), |
| - _outputSpeechType(AudioFrame::kNormalSpeech), |
| - _average_jitter_buffer_delay_us(0), |
| - least_required_delay_ms_(0), |
| - _previousTimestamp(0), |
| - _recPacketDelayMs(20), |
| - _RxVadDetection(false), |
| - _rxAgcIsEnabled(false), |
| - _rxNsIsEnabled(false), |
| - restored_packet_in_use_(false), |
| - rtcp_observer_(new VoERtcpObserver(this)), |
| - network_predictor_(new NetworkPredictor(Clock::GetRealTimeClock())), |
| - assoc_send_channel_lock_(CriticalSectionWrapper::CreateCriticalSection()), |
| - associate_send_channel_(ChannelOwner(nullptr)) |
| -{ |
| + RtcEventLog* const event_log, |
| + const Config& config) |
| + : _fileCritSect(*CriticalSectionWrapper::CreateCriticalSection()), |
| + _callbackCritSect(*CriticalSectionWrapper::CreateCriticalSection()), |
| + volume_settings_critsect_( |
| + *CriticalSectionWrapper::CreateCriticalSection()), |
| + _instanceId(instanceId), |
| + _channelId(channelId), |
| + rtp_header_parser_(RtpHeaderParser::Create()), |
| + rtp_payload_registry_( |
| + new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), |
| + rtp_receive_statistics_( |
| + ReceiveStatistics::Create(Clock::GetRealTimeClock())), |
| + rtp_receiver_( |
| + RtpReceiver::CreateAudioReceiver(VoEModuleId(instanceId, channelId), |
| + Clock::GetRealTimeClock(), |
| + this, |
| + this, |
| + this, |
| + rtp_payload_registry_.get())), |
| + telephone_event_handler_(rtp_receiver_->GetTelephoneEventHandler()), |
| + _outputAudioLevel(), |
| + _externalTransport(false), |
| + _inputFilePlayerPtr(NULL), |
| + _outputFilePlayerPtr(NULL), |
| + _outputFileRecorderPtr(NULL), |
| + // Avoid conflict with other channels by adding 1024 - 1026, |
| + // won't use as much as 1024 channels. |
| + _inputFilePlayerId(VoEModuleId(instanceId, channelId) + 1024), |
| + _outputFilePlayerId(VoEModuleId(instanceId, channelId) + 1025), |
| + _outputFileRecorderId(VoEModuleId(instanceId, channelId) + 1026), |
| + _outputFileRecording(false), |
| + _inbandDtmfQueue(VoEModuleId(instanceId, channelId)), |
| + _inbandDtmfGenerator(VoEModuleId(instanceId, channelId)), |
| + _outputExternalMedia(false), |
| + _inputExternalMediaCallbackPtr(NULL), |
| + _outputExternalMediaCallbackPtr(NULL), |
| + _timeStamp(0), // This is just an offset, RTP module will add it's own |
|
Henrik Grunell WebRTC
2015/08/12 15:29:53
Nit: Put the comment above, follows the style abov
|
| + // random offset |
| + _sendTelephoneEventPayloadType(106), |
| + ntp_estimator_(Clock::GetRealTimeClock()), |
| + jitter_buffer_playout_timestamp_(0), |
| + playout_timestamp_rtp_(0), |
| + playout_timestamp_rtcp_(0), |
| + playout_delay_ms_(0), |
| + _numberOfDiscardedPackets(0), |
| + send_sequence_number_(0), |
| + ts_stats_lock_(CriticalSectionWrapper::CreateCriticalSection()), |
| + rtp_ts_wraparound_handler_(new rtc::TimestampWrapAroundHandler()), |
| + capture_start_rtp_time_stamp_(-1), |
| + capture_start_ntp_time_ms_(-1), |
| + _engineStatisticsPtr(NULL), |
| + _outputMixerPtr(NULL), |
| + _transmitMixerPtr(NULL), |
| + _moduleProcessThreadPtr(NULL), |
| + _audioDeviceModulePtr(NULL), |
| + _voiceEngineObserverPtr(NULL), |
| + _callbackCritSectPtr(NULL), |
| + _transportPtr(NULL), |
| + _rxVadObserverPtr(NULL), |
| + _oldVadDecision(-1), |
| + _sendFrameType(0), |
| + _externalMixing(false), |
| + _mixFileWithMicrophone(false), |
| + _mute(false), |
| + _panLeft(1.0f), |
| + _panRight(1.0f), |
| + _outputGain(1.0f), |
| + _playOutbandDtmfEvent(false), |
| + _playInbandDtmfEvent(false), |
| + _lastLocalTimeStamp(0), |
| + _lastPayloadType(0), |
| + _includeAudioLevelIndication(false), |
| + _outputSpeechType(AudioFrame::kNormalSpeech), |
| + _average_jitter_buffer_delay_us(0), |
| + least_required_delay_ms_(0), |
| + _previousTimestamp(0), |
| + _recPacketDelayMs(20), |
| + _RxVadDetection(false), |
| + _rxAgcIsEnabled(false), |
| + _rxNsIsEnabled(false), |
| + restored_packet_in_use_(false), |
| + rtcp_observer_(new VoERtcpObserver(this)), |
| + network_predictor_(new NetworkPredictor(Clock::GetRealTimeClock())), |
| + assoc_send_channel_lock_(CriticalSectionWrapper::CreateCriticalSection()), |
| + associate_send_channel_(ChannelOwner(nullptr)) { |
| WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId,_channelId), |
| "Channel::Channel() - ctor"); |
| AudioCodingModule::Config acm_config; |
| @@ -805,6 +810,7 @@ Channel::Channel(int32_t channelId, |
| } |
| acm_config.neteq_config.enable_fast_accelerate = |
| config.Get<NetEqFastAccelerate>().enabled; |
| + acm_config.event_log = event_log; |
| audio_coding_.reset(AudioCodingModule::Create(acm_config)); |
| _inbandDtmfQueue.ResetDtmf(); |