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

Unified Diff: content/common/media/media_devices.mojom

Issue 2646833002: Add IPC to query capabilities of video input devices. (Closed)
Patch Set: address comment from clamy Created 3 years, 11 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/common/media/media_devices.mojom
diff --git a/content/common/media/media_devices.mojom b/content/common/media/media_devices.mojom
index d53232e580266f2337d724cee50c8786666f33b9..93e943225af7e7d8a2a85ef8b9881283805dd712 100644
--- a/content/common/media/media_devices.mojom
+++ b/content/common/media/media_devices.mojom
@@ -4,6 +4,7 @@
module mojom;
+import "media/capture/mojo/video_capture_types.mojom";
import "url/mojo/origin.mojom";
[Native]
@@ -12,6 +13,24 @@ enum MediaDeviceType;
[Native]
struct MediaDeviceInfo;
+// The values for this enum match the ones defined in
+// https://w3c.github.io/mediacapture-main/#def-constraint-facingMode
+// with the addition of NONE, which would map to the empty string in
+// JavaScript.
+enum FacingMode {
+ NONE,
+ USER,
+ ENVIRONMENT,
+ LEFT,
+ RIGHT
+};
+
+struct VideoInputDeviceCapabilities {
+ string device_id;
+ array<media.mojom.VideoCaptureFormat> formats;
+ FacingMode facing_mode;
+};
+
// This object lives in the browser and is responsible for processing device
// enumeration requests and managing subscriptions for device-change
// notifications.
@@ -24,6 +43,14 @@ interface MediaDevicesDispatcherHost {
bool request_audio_output,
url.mojom.Origin security_origin)
=> (array<array<MediaDeviceInfo>> enumeration);
+
+ // Returns a list of video devices and their capabilities.
+ // If there is a user-preferred device, it is the first in the result.
+ // The result of this function is intended for the implementation details
+ // of algorithms such as settings selection for getUserMedia.
+ // Do not expose the data contained in result of this function to JavaScript.
+ GetVideoInputCapabilities(url.mojom.Origin security_origin)
+ => (array<VideoInputDeviceCapabilities> video_input_device_capabilities);
// Creates a subscription for device-change notifications for the calling
// frame/security origin. It is the responsibility of the caller to send
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/renderer/media/media_devices_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698