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

Unified Diff: content/renderer/media/audio_renderer_mixer_manager.h

Issue 1942803002: Caching AudioOutputDevice instances in mixer manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, fix for sleep() compile error on win and a bit of cleanup around timeouts. 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: content/renderer/media/audio_renderer_mixer_manager.h
diff --git a/content/renderer/media/audio_renderer_mixer_manager.h b/content/renderer/media/audio_renderer_mixer_manager.h
index 20a1aa59eaf3db3d8e65c0ef805dfe98c16e5e9e..96bbc72a0212709d75a035c12f3bef5b14500d2a 100644
--- a/content/renderer/media/audio_renderer_mixer_manager.h
+++ b/content/renderer/media/audio_renderer_mixer_manager.h
@@ -6,8 +6,8 @@
#define CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_
#include <map>
+#include <memory>
#include <string>
-#include <utility>
#include "base/macros.h"
#include "base/synchronization/lock.h"
@@ -18,13 +18,12 @@
#include "url/origin.h"
namespace media {
-class AudioHardwareConfig;
class AudioRendererMixer;
class AudioRendererMixerInput;
-class AudioRendererSink;
}
namespace content {
+class AudioRendererSinkCache;
// Manages sharing of an AudioRendererMixer among AudioRendererMixerInputs based
// on their AudioParameters configuration. Inputs with the same AudioParameters
@@ -41,7 +40,8 @@ namespace content {
// via the shared memory. See http://crbug.com/114700.
class CONTENT_EXPORT AudioRendererMixerManager {
public:
- AudioRendererMixerManager();
+ static std::unique_ptr<AudioRendererMixerManager> Create();
+
~AudioRendererMixerManager();
// Creates an AudioRendererMixerInput with the proper callbacks necessary to
@@ -74,6 +74,16 @@ class CONTENT_EXPORT AudioRendererMixerManager {
const std::string& device_id,
const url::Origin& security_origin);
+ // Returns output device information. This call goes to the sink cache.
+ media::OutputDeviceInfo GetOutputDeviceInfo(
+ int source_render_frame_id,
+ int session_id,
+ const std::string& device_id,
+ const url::Origin& security_origin);
+
+ protected:
+ AudioRendererMixerManager(std::unique_ptr<AudioRendererSinkCache> sink_cache);
+
private:
friend class AudioRendererMixerManagerTest;
@@ -135,6 +145,9 @@ class CONTENT_EXPORT AudioRendererMixerManager {
AudioRendererMixerMap mixers_;
base::Lock mixers_lock_;
+ // Mixer sink cache. Should outlive |mixers_| => must be declared after them.
+ std::unique_ptr<AudioRendererSinkCache> sink_cache_;
miu 2016/05/12 21:53:06 Please make this const, since it is not mutated an
o1ka 2016/05/17 17:17:23 Done.
+
DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerManager);
};

Powered by Google App Engine
This is Rietveld 408576698