Re: ΄πΈ΄: Constraints and Capabilities API for getUserMedia: more detailed proposal

On 4/9/2012 9:51 AM, Harald Alvestrand wrote:
> On 03/29/2012 03:55 AM, Li Li wrote:
>> Thanks for bringing this up. I hope application should be able to discover cameras and select which ones to use, as it is not uncommon for mobile devices to have two cameras these days.
>> If this ability is not supported, then there is also a gap between getCapabilities(), which return multiple cameras, and getUserMedia(), which can't select them.
> If we define a constraint named "video-camera-identity", with a string
> value, and define that getCapabilities() return a single, unique value
> of "video-camera-identity" for each camera, the problem is solved:
> 
> getCapabilities() returns
> [ camera1 {
> 'video-camera-identity': 'foo1'
> },
> camera2 {
> 'video-camera-identity': 'bar3'
> }
> ]
> 
> getUserMedia gets called as
> 
> getUserMedia(....., [ mandatory: { 'video-camera-identity' : 'bar3' } ] )
> 
> apologies for the braces and brackets of the wrong type; I hope the idea
> shines through.
> One issue: this constraint is not an enum, a max or a min - it's a
> fourth type of constraint.

You could make in an enum (CAMERA_1, CAMERA_2, etc) (ditto for
microphones!), and separately in the capabilities identify what the
camera enum "is" (front/back/etc).  Thus the constraint would be an enum.

-- 
Randell Jesup
randell-ietf@jesup.org

Received on Monday, 9 April 2012 14:27:43 UTC