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

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

Issue 2212343003: Reland: ImageCapture: Queue up requests while device not ready (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable Android tests with bug and explanation Created 4 years, 4 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20be47fc6978e4da627e0388d2ce9385dac02cd3..e2db303556c0c6f284ae6eb532ba3c7aa3e927a7 100644
--- a/content/browser/renderer_host/media/video_capture_manager.h
+++ b/content/browser/renderer_host/media/video_capture_manager.h
@@ -165,6 +165,7 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
VideoCaptureDevice::SetPhotoOptionsCallback callback);
void TakePhoto(int session_id,
VideoCaptureDevice::TakePhotoCallback callback);
+
#if defined(OS_ANDROID)
// Some devices had troubles when stopped and restarted quickly, so the device
// is only stopped when Chrome is sent to background and not when, e.g., a tab
@@ -211,13 +212,10 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
// may be freed by this function.
void DestroyDeviceEntryIfNoClients(DeviceEntry* entry);
- // Retrieve the VideoCaptureDevice associated to |session_id|, or nullptr
- // if not found.
- VideoCaptureDevice* GetVideoCaptureDeviceBySessionId(int session_id);
-
- // Finds a DeviceEntry in different ways: by its |device_id| and |type| (if it
- // is already opened), by its |controller| or by its |serial_id|. In all
- // cases, if not found, nullptr is returned.
+ // Finds a DeviceEntry in different ways: by |session_id|, by its |device_id|
+ // and |type| (if it is already opened), by its |controller| or by its
+ // |serial_id|. In all cases, if not found, nullptr is returned.
+ DeviceEntry* GetDeviceEntryBySessionId(int session_id);
DeviceEntry* GetDeviceEntryByTypeAndId(MediaStreamType type,
const std::string& device_id) const;
DeviceEntry* GetDeviceEntryByController(
@@ -275,6 +273,17 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
media::VideoCaptureDevice* device,
gfx::NativeViewId window_id);
+ // Internal versions of the Image Capture public ones, for delayed execution.
+ void DoGetPhotoCapabilities(
+ VideoCaptureDevice::GetPhotoCapabilitiesCallback callback,
+ VideoCaptureDevice* device);
+ void DoSetPhotoOptions(
+ VideoCaptureDevice::SetPhotoOptionsCallback callback,
+ media::mojom::PhotoSettingsPtr settings,
+ VideoCaptureDevice* device);
+ void DoTakePhoto(VideoCaptureDevice::TakePhotoCallback callback,
+ VideoCaptureDevice* device);
+
#if defined(OS_MACOSX)
// Called on the IO thread after the device layer has been initialized on Mac.
// Sets |capture_device_api_initialized_| to true and then executes and_then.
@@ -324,6 +333,11 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider {
DeviceStartQueue device_start_queue_;
+ // Queue to keep photo-associated requests waiting for a device to initialize,
+ // bundles a session id integer and an associated photo-related request.
+ std::list<std::pair<int, base::Callback<void(media::VideoCaptureDevice*)>>>
+ photo_request_queue_;
+
// Device creation factory injected on construction from MediaStreamManager or
// from the test harness.
std::unique_ptr<media::VideoCaptureDeviceFactory>
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698