Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 1827263002: Early initialize recording on the ADM from WebRtcVoiceMediaChannel. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Simplify the solution Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.h ('k') | webrtc/voice_engine/channel_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index 21094fde4d45af8baed7c5228237a5caba363e04..4fcfdb8f7e6fe8ffe87a1d4318dbf91ba0ad312e 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -1078,6 +1078,12 @@ int WebRtcVoiceEngine::CreateVoEChannel() {
return voe_wrapper_->base()->CreateChannel(voe_config_);
}
+webrtc::AudioDeviceModule* WebRtcVoiceEngine::adm() {
+ RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
+ RTC_DCHECK(adm_);
+ return adm_;
+}
+
class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
: public AudioSource::Sink {
public:
@@ -1800,9 +1806,17 @@ void WebRtcVoiceMediaChannel::SetSend(bool send) {
return;
}
- // Apply channel specific options when channel is enabled for sending.
+ // Apply channel specific options, and initialize the ADM for recording (this
+ // may take time on some platforms, e.g. Android).
if (send) {
engine()->ApplyOptions(options_);
+
+ // InitRecording() will return an error if the ADM is already recording.
+ if (!engine()->adm()->Recording()) {
Taylor Brandstetter 2016/04/01 18:41:02 Shouldn't this call "RecordingIsInitialized"?
the sun 2016/04/01 21:35:40 Actually, it looks like both must be checked. Look
+ if (engine()->adm()->InitRecording() != 0) {
+ LOG(LS_WARNING) << "Failed to initialize recording";
+ }
+ }
}
// Change the settings on each send channel.
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.h ('k') | webrtc/voice_engine/channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698