| Index: content/browser/renderer_host/media/audio_input_device_manager.h
|
| diff --git a/content/browser/renderer_host/media/audio_input_device_manager.h b/content/browser/renderer_host/media/audio_input_device_manager.h
|
| index 96bff65679102dd59554b1e2d057e1223cf1c2c6..3a4215805fb6b5f41e649bad2a02086d1641068f 100644
|
| --- a/content/browser/renderer_host/media/audio_input_device_manager.h
|
| +++ b/content/browser/renderer_host/media/audio_input_device_manager.h
|
| @@ -6,8 +6,8 @@
|
| // communicates with MediaStreamManager and AudioInputRendererHost on the
|
| // browser IO thread, handles queries like enumerate/open/close from
|
| // MediaStreamManager and start/stop from AudioInputRendererHost.
|
| -
|
| -// All the queries and work are handled on the IO thread.
|
| +// The work for enumerate/open/close is handled asynchronously on Media Stream
|
| +// device thread, while start/stop are synchronous API on IO thread.
|
|
|
| #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_
|
| #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_
|
| @@ -21,10 +21,6 @@
|
| #include "content/common/media/media_stream_options.h"
|
| #include "media/audio/audio_device_name.h"
|
|
|
| -namespace media {
|
| -class AudioManager;
|
| -}
|
| -
|
| namespace media_stream {
|
|
|
| class AudioInputDeviceManagerEventHandler;
|
| @@ -41,7 +37,7 @@ class CONTENT_EXPORT AudioInputDeviceManager
|
| static const int kInvalidSessionId;
|
| static const char kInvalidDeviceId[];
|
|
|
| - explicit AudioInputDeviceManager(media::AudioManager* audio_manager);
|
| + AudioInputDeviceManager(scoped_refptr<base::MessageLoopProxy> message_loop);
|
|
|
| // MediaStreamProvider implementation, called on IO thread.
|
| virtual void Register(MediaStreamProviderListener* listener) OVERRIDE;
|
| @@ -61,20 +57,32 @@ class CONTENT_EXPORT AudioInputDeviceManager
|
| friend class base::RefCountedThreadSafe<AudioInputDeviceManager>;
|
| virtual ~AudioInputDeviceManager();
|
|
|
| + // Executed on media stream device thread.
|
| + void EnumerateOnDeviceThread();
|
| + void OpenOnDeviceThread(int session_id, const StreamDeviceInfo& device);
|
| + void CloseOnDeviceThread(int session_id);
|
| +
|
| // Executed on IO thread to call Listener.
|
| void DevicesEnumeratedOnIOThread(StreamDeviceInfoArray* devices);
|
| void OpenedOnIOThread(int session_id);
|
| void ClosedOnIOThread(int session_id);
|
| void ErrorOnIOThread(int session_id, MediaStreamProviderError error);
|
|
|
| + // Helpers.
|
| + bool IsOnDeviceThread() const;
|
| +
|
| + // Only accessed on Browser::IO thread.
|
| MediaStreamProviderListener* listener_;
|
| int next_capture_session_id_;
|
| typedef std::map<int, AudioInputDeviceManagerEventHandler*> EventHandlerMap;
|
| EventHandlerMap event_handlers_;
|
| +
|
| + // Only accessed from media stream device thread.
|
| typedef std::map<int, media::AudioDeviceName> AudioInputDeviceMap;
|
| AudioInputDeviceMap devices_;
|
| - // TODO(tommi): Is it necessary to store this as a member?
|
| - media::AudioManager* audio_manager_;
|
| +
|
| + // The message loop of media stream device thread that this object runs on.
|
| + scoped_refptr<base::MessageLoopProxy> message_loop_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AudioInputDeviceManager);
|
| };
|
|
|