Chromium Code Reviews| Index: webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc |
| diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc |
| index 9c3183271b75bcbdaca46d20cd915d8ecee05323..4535c868e8ac47d31720e954ac0e2208332558a9 100644 |
| --- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc |
| +++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc |
| @@ -27,6 +27,7 @@ |
| #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" |
| #include "webrtc/system_wrappers/interface/trace.h" |
| #include "webrtc/typedefs.h" |
| +#include "webrtc/video/rtc_event_log.h" |
| namespace webrtc { |
| @@ -145,7 +146,9 @@ AudioCodingModuleImpl::AudioCodingModuleImpl( |
| first_frame_(true), |
| callback_crit_sect_(CriticalSectionWrapper::CreateCriticalSection()), |
| packetization_callback_(NULL), |
| - vad_callback_(NULL) { |
| + vad_callback_(NULL), |
| + event_log_ptr_crit_sect_(CriticalSectionWrapper::CreateCriticalSection()), |
|
terelius
2015/08/05 10:35:42
I got the following comment from pbos@ concering C
hlundin-webrtc
2015/08/05 11:02:06
Yes, that was my concern. If you can make the desi
ivoc
2015/08/06 10:57:51
So which option do we prefer? I would like to hear
|
| + event_log_(nullptr) { |
| if (InitializeReceiverSafe() < 0) { |
| WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, |
| "Cannot initialize receiver"); |
| @@ -736,6 +739,11 @@ int AudioCodingModuleImpl::PlayoutData10Ms(int desired_freq_hz, |
| "PlayoutData failed, RecOut Failed"); |
| return -1; |
| } |
| + { |
| + CriticalSectionScoped lock(event_log_ptr_crit_sect_); |
| + if (event_log_) |
|
terelius
2015/08/05 10:35:42
I thought the reason for having a no-op implementa
hlundin-webrtc
2015/08/05 11:02:06
Having a no-op implementation is not the same as n
ivoc
2015/08/06 10:57:51
If I'm not mistaken, the ACM is also used standalo
terelius
2015/08/11 09:04:34
Good point Ivo. It would still be able to point at
terelius
2015/08/11 09:04:34
Indeed. However, the proposed checks do not guaran
|
| + event_log_->LogDebugEvent(RtcEventLog::DebugEvent::kAudioPlayout); |
| + } |
| audio_frame->id_ = id_; |
| return 0; |
| @@ -971,6 +979,11 @@ void AudioCodingModuleImpl::DisableNack() { |
| receiver_.DisableNack(); |
| } |
| +void AudioCodingModuleImpl::SetEventLog(RtcEventLog* event_log) { |
| + CriticalSectionScoped lock(event_log_ptr_crit_sect_); |
| + event_log_ = event_log; |
| +} |
| + |
| std::vector<uint16_t> AudioCodingModuleImpl::GetNackList( |
| int64_t round_trip_time_ms) const { |
| return receiver_.GetNackList(round_trip_time_ms); |