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

Unified Diff: content/browser/renderer_host/media/video_capture_manager.h

Issue 10912004: Begin adding support for tab mirroring via the MediaStream audio/video capturing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 8 years, 3 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/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_;

Powered by Google App Engine
This is Rietveld 408576698