| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 #ifdef HAVE_WEBRTC_VOICE | 11 #ifdef HAVE_WEBRTC_VOICE |
| 12 | 12 |
| 13 #include "webrtc/media/engine/webrtcvoiceengine.h" | 13 #include "webrtc/media/engine/webrtcvoiceengine.h" |
| 14 | 14 |
| 15 #include <algorithm> | 15 #include <algorithm> |
| 16 #include <cstdio> | 16 #include <cstdio> |
| 17 #include <string> | 17 #include <string> |
| 18 #include <vector> | 18 #include <vector> |
| 19 | 19 |
| 20 #include "webrtc/audio_sink.h" | 20 #include "webrtc/audio_sink.h" |
| 21 #include "webrtc/base/arraysize.h" | 21 #include "webrtc/base/arraysize.h" |
| 22 #include "webrtc/base/base64.h" | 22 #include "webrtc/base/base64.h" |
| 23 #include "webrtc/base/byteorder.h" | 23 #include "webrtc/base/byteorder.h" |
| 24 #include "webrtc/base/common.h" | 24 #include "webrtc/base/common.h" |
| 25 #include "webrtc/base/helpers.h" | 25 #include "webrtc/base/helpers.h" |
| 26 #include "webrtc/base/logging.h" | 26 #include "webrtc/base/logging.h" |
| 27 #include "webrtc/base/stringencode.h" | 27 #include "webrtc/base/stringencode.h" |
| 28 #include "webrtc/base/stringutils.h" | 28 #include "webrtc/base/stringutils.h" |
| 29 #include "webrtc/base/trace_event.h" | 29 #include "webrtc/base/trace_event.h" |
| 30 #include "webrtc/call/rtc_event_log.h" | |
| 31 #include "webrtc/common.h" | 30 #include "webrtc/common.h" |
| 32 #include "webrtc/media/base/audioframe.h" | 31 #include "webrtc/media/base/audioframe.h" |
| 33 #include "webrtc/media/base/audiosource.h" | 32 #include "webrtc/media/base/audiosource.h" |
| 34 #include "webrtc/media/base/mediaconstants.h" | 33 #include "webrtc/media/base/mediaconstants.h" |
| 35 #include "webrtc/media/base/streamparams.h" | 34 #include "webrtc/media/base/streamparams.h" |
| 36 #include "webrtc/media/engine/webrtcmediaengine.h" | 35 #include "webrtc/media/engine/webrtcmediaengine.h" |
| 37 #include "webrtc/media/engine/webrtcvoe.h" | 36 #include "webrtc/media/engine/webrtcvoe.h" |
| 38 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 37 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" |
| 39 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 38 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 40 #include "webrtc/system_wrappers/include/field_trial.h" | 39 #include "webrtc/system_wrappers/include/field_trial.h" |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 if (is_dumping_aec_) { | 1104 if (is_dumping_aec_) { |
| 1106 // Stop dumping AEC when we are dumping. | 1105 // Stop dumping AEC when we are dumping. |
| 1107 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != | 1106 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != |
| 1108 webrtc::AudioProcessing::kNoError) { | 1107 webrtc::AudioProcessing::kNoError) { |
| 1109 LOG_RTCERR0(StopDebugRecording); | 1108 LOG_RTCERR0(StopDebugRecording); |
| 1110 } | 1109 } |
| 1111 is_dumping_aec_ = false; | 1110 is_dumping_aec_ = false; |
| 1112 } | 1111 } |
| 1113 } | 1112 } |
| 1114 | 1113 |
| 1115 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) { | |
| 1116 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | |
| 1117 webrtc::RtcEventLog* event_log = voe_wrapper_->codec()->GetEventLog(); | |
| 1118 if (event_log) { | |
| 1119 return event_log->StartLogging(file); | |
| 1120 } | |
| 1121 LOG_RTCERR0(StartRtcEventLog); | |
| 1122 return false; | |
| 1123 } | |
| 1124 | |
| 1125 void WebRtcVoiceEngine::StopRtcEventLog() { | |
| 1126 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | |
| 1127 webrtc::RtcEventLog* event_log = voe_wrapper_->codec()->GetEventLog(); | |
| 1128 if (event_log) { | |
| 1129 event_log->StopLogging(); | |
| 1130 return; | |
| 1131 } | |
| 1132 LOG_RTCERR0(StopRtcEventLog); | |
| 1133 } | |
| 1134 | |
| 1135 int WebRtcVoiceEngine::CreateVoEChannel() { | 1114 int WebRtcVoiceEngine::CreateVoEChannel() { |
| 1136 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1115 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 1137 return voe_wrapper_->base()->CreateChannel(voe_config_); | 1116 return voe_wrapper_->base()->CreateChannel(voe_config_); |
| 1138 } | 1117 } |
| 1139 | 1118 |
| 1140 class WebRtcVoiceMediaChannel::WebRtcAudioSendStream | 1119 class WebRtcVoiceMediaChannel::WebRtcAudioSendStream |
| 1141 : public AudioSource::Sink { | 1120 : public AudioSource::Sink { |
| 1142 public: | 1121 public: |
| 1143 WebRtcAudioSendStream(int ch, webrtc::AudioTransport* voe_audio_transport, | 1122 WebRtcAudioSendStream(int ch, webrtc::AudioTransport* voe_audio_transport, |
| 1144 uint32_t ssrc, const std::string& c_name, | 1123 uint32_t ssrc, const std::string& c_name, |
| (...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2551 } | 2530 } |
| 2552 } else { | 2531 } else { |
| 2553 LOG(LS_INFO) << "Stopping playout for channel #" << channel; | 2532 LOG(LS_INFO) << "Stopping playout for channel #" << channel; |
| 2554 engine()->voe()->base()->StopPlayout(channel); | 2533 engine()->voe()->base()->StopPlayout(channel); |
| 2555 } | 2534 } |
| 2556 return true; | 2535 return true; |
| 2557 } | 2536 } |
| 2558 } // namespace cricket | 2537 } // namespace cricket |
| 2559 | 2538 |
| 2560 #endif // HAVE_WEBRTC_VOICE | 2539 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |