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

Side by Side Diff: content/renderer/media/audio_device_factory.cc

Issue 2108673004: Enable renderer-side mixing output of different audio sources basing on finch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/audio_device_factory.h" 5 #include "content/renderer/media/audio_device_factory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/common/content_constants_internal.h" 10 #include "content/common/content_constants_internal.h"
11 #include "content/renderer/media/audio_input_message_filter.h" 11 #include "content/renderer/media/audio_input_message_filter.h"
12 #include "content/renderer/media/audio_message_filter.h" 12 #include "content/renderer/media/audio_message_filter.h"
13 #include "content/renderer/media/audio_renderer_mixer_manager.h" 13 #include "content/renderer/media/audio_renderer_mixer_manager.h"
14 #include "content/renderer/render_thread_impl.h" 14 #include "content/renderer/render_thread_impl.h"
15 #include "media/audio/audio_input_device.h" 15 #include "media/audio/audio_input_device.h"
16 #include "media/audio/audio_output_device.h" 16 #include "media/audio/audio_output_device.h"
17 #include "media/base/audio_renderer_mixer_input.h" 17 #include "media/base/audio_renderer_mixer_input.h"
18 #include "media/base/media_switches.h"
18 #include "url/origin.h" 19 #include "url/origin.h"
19 20
20 namespace content { 21 namespace content {
21 22
22 // static 23 // static
23 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; 24 AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL;
24 25
25 namespace { 26 namespace {
26 const int64_t kMaxAuthorizationTimeoutMs = 4000; 27 const int64_t kMaxAuthorizationTimeoutMs = 4000;
27 28
(...skipping 13 matching lines...) Expand all
41 device->RequestDeviceAuthorization(); 42 device->RequestDeviceAuthorization();
42 return device; 43 return device;
43 } 44 }
44 45
45 // This is where we decide which audio will go to mixers and which one to 46 // This is where we decide which audio will go to mixers and which one to
46 // AudioOutpuDevice directly. 47 // AudioOutpuDevice directly.
47 bool IsMixable(AudioDeviceFactory::SourceType source_type) { 48 bool IsMixable(AudioDeviceFactory::SourceType source_type) {
48 if (source_type == AudioDeviceFactory::kSourceMediaElement) 49 if (source_type == AudioDeviceFactory::kSourceMediaElement)
49 return true; // Must ALWAYS go through mixer. 50 return true; // Must ALWAYS go through mixer.
50 51
51 // TODO(olka): make a decision for the rest of the sources basing on OS 52 if (base::FeatureList::IsEnabled(media::kNewAudioRenderingMixingStrategy))
tommi (sloooow) - chröme 2016/06/29 14:03:40 return base::FeatureList::IsEnabled(media::kNewAud
o1ka 2016/06/29 14:28:35 Done.
52 // type and configuration parameters. 53 return true; // Mix everything if experiment is enabled.
54
53 return false; 55 return false;
54 } 56 }
55 57
56 scoped_refptr<media::SwitchableAudioRendererSink> NewMixableSink( 58 scoped_refptr<media::SwitchableAudioRendererSink> NewMixableSink(
57 int render_frame_id, 59 int render_frame_id,
58 int session_id, 60 int session_id,
59 const std::string& device_id, 61 const std::string& device_id,
60 const url::Origin& security_origin) { 62 const url::Origin& security_origin) {
61 RenderThreadImpl* render_thread = RenderThreadImpl::current(); 63 RenderThreadImpl* render_thread = RenderThreadImpl::current();
62 return scoped_refptr<media::AudioRendererMixerInput>( 64 return scoped_refptr<media::AudioRendererMixerInput>(
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 device_id, security_origin); 179 device_id, security_origin);
178 if (sink) 180 if (sink)
179 return sink; 181 return sink;
180 } 182 }
181 183
182 return NewOutputDevice(render_frame_id, session_id, device_id, 184 return NewOutputDevice(render_frame_id, session_id, device_id,
183 security_origin); 185 security_origin);
184 } 186 }
185 187
186 } // namespace content 188 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698