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

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

Issue 29423003: Added video capture capabilities retrieval and caching to VideoCaptureManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed mechanics of Caps enumeration to be asynchronous and 2 threaded. UT adapted. Created 7 years, 2 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 6f0b0ec4702dedd2e9e2f43caecee942542ec5e8..dc8b0ef2263ab9b7b78e4ec26b31d879d0cb34a0 100644
--- a/content/browser/renderer_host/media/video_capture_manager.h
+++ b/content/browser/renderer_host/media/video_capture_manager.h
@@ -82,6 +82,12 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
VideoCaptureControllerID client_id,
VideoCaptureControllerEventHandler* client_handler);
+ // Retrieve the available capture capabilities for a particular device. The
+ // capabilities are cached during GetAvailableDevicesOnDeviceThread() and
+ // updated on DoStartDeviceOnDeviceThread(). The call is asynchronous and the
+ // reply comes via OnDeviceCapabilitiesEnumerated().
tommi (sloooow) - chröme 2013/10/25 14:15:34 nit: nice comment in general but I don't think you
mcasas 2013/10/28 12:50:08 Boosted prosaic skills :) + corrected callback nam
+ void EnumerateDeviceCapabilities(const StreamDeviceInfo& device_info);
+
private:
virtual ~VideoCaptureManager();
struct DeviceEntry;
@@ -96,6 +102,9 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
void OnClosed(MediaStreamType type, int capture_session_id);
void OnDevicesEnumerated(MediaStreamType stream_type,
const media::VideoCaptureDevice::Names& names);
+ void OnDeviceCapabilitiesEnumerated(
+ const StreamDeviceInfo& device_info,
+ const media::VideoCaptureCapabilities& capabilities);
// Find a DeviceEntry by its device ID and type, if it is already opened.
DeviceEntry* GetDeviceEntryForMediaStreamDevice(
@@ -115,6 +124,10 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
media::VideoCaptureDevice::Names GetAvailableDevicesOnDeviceThread(
MediaStreamType stream_type);
+ // Queries and returns the video capture capabilities of a device.
+ media::VideoCaptureCapabilities GetDeviceCapabilitiesOnDeviceThread(
+ const StreamDeviceInfo& device_info) const;
+
// Create and Start a new VideoCaptureDevice, storing the result in
// |entry->video_capture_device|. Ownership of |client| passes to
// the device.
@@ -177,6 +190,13 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
// device thread.
media::VideoCaptureDevice::Names video_capture_devices_;
+ // Local cache of video capture capabilities, indexed by unique id. It is
+ // created in GetAvailableDevicesOnDeviceThread(), updated in
+ // DoStartDeviceOnDeviceThread() and retrieved for a particular device id in
+ // EnumerateDeviceCapabilities(), read only.
tommi (sloooow) - chröme 2013/10/25 14:15:34 is this last part true? It looks like EnumerateDe
mcasas 2013/10/28 12:50:08 Correct, this comment has not been updated after I
+ std::map<std::string, media::VideoCaptureCapabilities>
+ video_capture_capabilities_;
tommi (sloooow) - chröme 2013/10/25 14:15:34 Instead of an extra map, can we change video_captu
mcasas 2013/10/28 12:50:08 Done. It turned out to be a class - first due to C
+
DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager);
};

Powered by Google App Engine
This is Rietveld 408576698