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

Unified Diff: media/base/audio_renderer_mixer.h

Issue 1942803002: Caching AudioOutputDevice instances in mixer manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments addressed, map->vector in AudioRendererCacheImpl 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
Index: media/base/audio_renderer_mixer.h
diff --git a/media/base/audio_renderer_mixer.h b/media/base/audio_renderer_mixer.h
index 7a6c1dd781bb96572e51dd71bbe96247d6ae6566..5b56cd1193518320c5d749b1ac91b0d9195006ba 100644
--- a/media/base/audio_renderer_mixer.h
+++ b/media/base/audio_renderer_mixer.h
@@ -27,7 +27,7 @@ class MEDIA_EXPORT AudioRendererMixer
: NON_EXPORTED_BASE(public AudioRendererSink::RenderCallback) {
public:
AudioRendererMixer(const AudioParameters& output_params,
- const scoped_refptr<AudioRendererSink>& sink);
+ scoped_refptr<AudioRendererSink> sink);
~AudioRendererMixer() override;
// Add or remove a mixer input from mixing; called by AudioRendererMixerInput.
@@ -48,6 +48,9 @@ class MEDIA_EXPORT AudioRendererMixer
OutputDeviceInfo GetOutputDeviceInfo();
+ // Used by AudioRendererMixerManager to remove mixer sink from the sink cache.
DaleCurtis 2016/05/23 18:29:08 This isn't necessary, just have the ARMM store the
o1ka 2016/05/23 19:21:35 Well, I don feel like it's any better to store it
DaleCurtis 2016/05/23 20:20:26 I do in this case. Can you explain why you think i
o1ka 2016/05/24 15:00:41 Ok, the one without an interface is nicer. (added
+ const AudioRendererSink* sink_ptr() { return audio_sink_.get(); };
+
private:
// Maps input sample rate to the dedicated converter.
using AudioConvertersMap =
@@ -63,11 +66,11 @@ class MEDIA_EXPORT AudioRendererMixer
return sample_rate == output_params_.sample_rate();
}
- // Output sink for this mixer.
- scoped_refptr<AudioRendererSink> audio_sink_;
-
// Output parameters for this mixer.
- AudioParameters output_params_;
+ const AudioParameters output_params_;
+
+ // Output sink for this mixer.
+ const scoped_refptr<AudioRendererSink> audio_sink_;
// ---------------[ All variables below protected by |lock_| ]---------------
base::Lock lock_;

Powered by Google App Engine
This is Rietveld 408576698