Add ability to retrieve capabilities for audio input devices to MediaDevicesDispatcherHost.

BUG=657733

Review-Url: https://codereview.chromium.org/2868853002
Cr-Commit-Position: refs/heads/master@{#471774}
diff --git a/content/common/media/media_devices.mojom b/content/common/media/media_devices.mojom
index 7d2d2cc..6940ccb 100644
--- a/content/common/media/media_devices.mojom
+++ b/content/common/media/media_devices.mojom
@@ -5,6 +5,7 @@
 module mojom;
 
 import "media/capture/mojo/video_capture_types.mojom";
+import "media/mojo/interfaces/audio_parameters.mojom";
 
 [Native]
 enum MediaDeviceType;
@@ -30,6 +31,11 @@
   FacingMode facing_mode;
 };
 
+struct AudioInputDeviceCapabilities {
+  string device_id;
+  media.mojom.AudioParameters parameters;
+};
+
 // This object lives in the browser and is responsible for processing device
 // enumeration requests and managing subscriptions for device-change
 // notifications.
@@ -41,15 +47,26 @@
                    bool request_video_input,
                    bool request_audio_output)
                        => (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.
+  // Do not expose the data contained in the result of this function to
+  // JavaScript.
   GetVideoInputCapabilities()
       => (array<VideoInputDeviceCapabilities> video_input_device_capabilities);
 
+  // Returns a list of audio input devices and their capabilities.
+  // If there is a user-preferred device, it is the first in the result.
+  // Otherwise, the system-default device 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 the result of this function to
+  // JavaScript.
+  GetAudioInputCapabilities()
+      => (array<AudioInputDeviceCapabilities> audio_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
   // |subscription_id| values that are unique per device type.