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

Unified Diff: content/renderer/media/audio_device_factory.cc

Issue 1942803002: Caching AudioOutputDevice instances in mixer manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make WebAudioSourceProvider to always return real sink info reguardless the client - to avoid behavior change. Created 4 years, 7 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 | « content/content_tests.gypi ('k') | content/renderer/media/audio_renderer_mixer_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_device_factory.cc
diff --git a/content/renderer/media/audio_device_factory.cc b/content/renderer/media/audio_device_factory.cc
index 40d8455f5c402a2c1a02af593bd174ab333add57..ffe459c9f21c3e381e9c069b613fa65506fdb2e2 100644
--- a/content/renderer/media/audio_device_factory.cc
+++ b/content/renderer/media/audio_device_factory.cc
@@ -135,22 +135,16 @@ AudioDeviceFactory::NewAudioCapturerSource(int render_frame_id) {
}
// static
-// TODO(http://crbug.com/587461): Find a better way to check if device exists
-// and is authorized.
media::OutputDeviceInfo AudioDeviceFactory::GetOutputDeviceInfo(
int render_frame_id,
int session_id,
const std::string& device_id,
const url::Origin& security_origin) {
- scoped_refptr<media::AudioRendererSink> sink = NewFinalAudioRendererSink(
+ RenderThreadImpl* render_thread = RenderThreadImpl::current();
+ DCHECK(render_thread) << "RenderThreadImpl is not instantiated, or "
+ << "GetOutputDeviceInfo() is called on a wrong thread ";
+ return render_thread->GetAudioRendererMixerManager()->GetOutputDeviceInfo(
render_frame_id, session_id, device_id, security_origin);
-
- const media::OutputDeviceInfo& device_info = sink->GetOutputDeviceInfo();
-
- // TODO(olka): Cache it and reuse, http://crbug.com/586161
- sink->Stop(); // Must be stopped.
-
- return device_info;
}
AudioDeviceFactory::AudioDeviceFactory() {
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/audio_renderer_mixer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698