| Index: content/browser/renderer_host/media/video_capture_manager.h
|
| diff --git a/content/browser/renderer_host/media/video_capture_manager.h b/content/browser/renderer_host/media/video_capture_manager.h
|
| index 4a2f55478cfcd951f0d35155e789433c307c7e83..036128d59a42a9089b1716ed425e6ef3f184eed0 100644
|
| --- a/content/browser/renderer_host/media/video_capture_manager.h
|
| +++ b/content/browser/renderer_host/media/video_capture_manager.h
|
| @@ -29,9 +29,7 @@ class VideoCaptureControllerEventHandler;
|
| namespace media_stream {
|
|
|
| // VideoCaptureManager opens/closes and start/stops video capture devices.
|
| -class CONTENT_EXPORT VideoCaptureManager
|
| - : public base::RefCountedThreadSafe<VideoCaptureManager>,
|
| - public MediaStreamProvider {
|
| +class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
|
| public:
|
| // Calling |Start| of this id will open the first device, even though open has
|
| // not been called. This is used to be able to use video capture devices
|
| @@ -87,7 +85,6 @@ class CONTENT_EXPORT VideoCaptureManager
|
|
|
| private:
|
| friend class ::MockVideoCaptureManager;
|
| - friend class base::RefCountedThreadSafe<VideoCaptureManager>;
|
|
|
| virtual ~VideoCaptureManager();
|
|
|
| @@ -111,15 +108,18 @@ class CONTENT_EXPORT VideoCaptureManager
|
| VideoCaptureControllerEventHandler* handler);
|
|
|
| // Executed on Browser::IO thread to call Listener.
|
| - void OnOpened(int capture_session_id);
|
| - void OnClosed(int capture_session_id);
|
| + void OnOpened(content::MediaStreamDeviceType type, int capture_session_id);
|
| + void OnClosed(content::MediaStreamDeviceType type, int capture_session_id);
|
| void OnDevicesEnumerated(const StreamDeviceInfoArray& devices);
|
| - void OnError(int capture_session_id, MediaStreamProviderError error);
|
| + void OnError(content::MediaStreamDeviceType type, int capture_session_id,
|
| + MediaStreamProviderError error);
|
|
|
| // Executed on device thread to make sure Listener is called from
|
| // Browser::IO thread.
|
| - void PostOnOpened(int capture_session_id);
|
| - void PostOnClosed(int capture_session_id);
|
| + void PostOnOpened(content::MediaStreamDeviceType type,
|
| + int capture_session_id);
|
| + void PostOnClosed(content::MediaStreamDeviceType type,
|
| + int capture_session_id);
|
| void PostOnDevicesEnumerated(const StreamDeviceInfoArray& devices);
|
| void PostOnError(int capture_session_id, MediaStreamProviderError error);
|
|
|
| @@ -142,8 +142,12 @@ class CONTENT_EXPORT VideoCaptureManager
|
| // Only accessed from device thread.
|
| // VideoCaptureManager owns all VideoCaptureDevices and is responsible for
|
| // deleting the instances when they are not used any longer.
|
| - typedef std::map<int, media::VideoCaptureDevice*> VideoCaptureDevices;
|
| - VideoCaptureDevices devices_;
|
| + struct DeviceEntry {
|
| + content::MediaStreamDeviceType stream_type;
|
| + media::VideoCaptureDevice* capture_device; // Maybe shared across sessions.
|
| + };
|
| + typedef std::map<int, DeviceEntry> VideoCaptureDevices;
|
| + VideoCaptureDevices devices_; // Maps capture_session_id to DeviceEntry.
|
|
|
| // Set to true if using fake devices for testing, false by default.
|
| bool use_fake_device_;
|
|
|