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

Unified Diff: media/base/audio_renderer_mixer_input.h

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 | « media/base/audio_renderer_mixer.cc ('k') | media/base/audio_renderer_mixer_input.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_renderer_mixer_input.h
diff --git a/media/base/audio_renderer_mixer_input.h b/media/base/audio_renderer_mixer_input.h
index a75320e78c681c73303c8d65bca0f9fb8a7cfd30..b23c27fc94b7feb1b5cec609511847ad2ea4383b 100644
--- a/media/base/audio_renderer_mixer_input.h
+++ b/media/base/audio_renderer_mixer_input.h
@@ -27,24 +27,15 @@
namespace media {
+class AudioRendererMixerPool;
class AudioRendererMixer;
class MEDIA_EXPORT AudioRendererMixerInput
: NON_EXPORTED_BASE(public SwitchableAudioRendererSink),
public AudioConverter::InputCallback {
public:
- typedef base::Callback<AudioRendererMixer*(const AudioParameters& params,
- const std::string& device_id,
- const url::Origin& security_origin,
- OutputDeviceStatus* device_status)>
- GetMixerCB;
- typedef base::Callback<void(const AudioParameters& params,
- const std::string& device_id,
- const url::Origin& security_origin)>
- RemoveMixerCB;
-
- AudioRendererMixerInput(const GetMixerCB& get_mixer_cb,
- const RemoveMixerCB& remove_mixer_cb,
+ AudioRendererMixerInput(AudioRendererMixerPool* mixer_pool,
+ int owner_id,
const std::string& device_id,
const url::Origin& security_origin);
@@ -70,6 +61,9 @@ class MEDIA_EXPORT AudioRendererMixerInput
private:
friend class AudioRendererMixerInputTest;
+ // Pool to obtain mixers from / return them to.
+ AudioRendererMixerPool* const mixer_pool_;
+
// Protect |volume_|, accessed by separate threads in ProvideInput() and
// SetVolume().
base::Lock volume_lock_;
@@ -82,20 +76,15 @@ class MEDIA_EXPORT AudioRendererMixerInput
double ProvideInput(AudioBus* audio_bus,
base::TimeDelta buffer_delay) override;
- // Callbacks provided during construction which allow AudioRendererMixerInput
- // to retrieve a mixer during Initialize() and notify when it's done with it.
- const GetMixerCB get_mixer_cb_;
- const RemoveMixerCB remove_mixer_cb_;
-
// AudioParameters received during Initialize().
AudioParameters params_;
- // ID of hardware device to use
- std::string device_id_;
+ const int owner_id_;
+ std::string device_id_; // ID of hardware device to use
url::Origin security_origin_;
- // AudioRendererMixer provided through |get_mixer_cb_| during Initialize(),
- // guaranteed to live (at least) until |remove_mixer_cb_| is called.
+ // AudioRendererMixer obtained from mixer pool during Initialize(),
+ // guaranteed to live (at least) until it is returned to the pool.
AudioRendererMixer* mixer_;
// Source of audio data which is provided to the mixer.
« no previous file with comments | « media/base/audio_renderer_mixer.cc ('k') | media/base/audio_renderer_mixer_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698