RE: 答复: Constraints and Capabilities API for getUserMedia: more detailed proposal

What if I want to use the video input on foo1 (a webcam with mic) and audio input on bar3 (a headset)?
If I say: 
navigator.getUserMedia({audio:true, video:true}, {mandatory: [{identity:foo1}, {identity:bar3}]}, cb), then the UA doesn't know where the audio stream comes from: foo1 or bar3.

It seems an object-oriented approach is needed for this case:
foo1.getUserMedia({video:true}, cb);
bar3.getUserMedia({audio:true}, cb);

So it becomes a two-step drill-down process:
1) navigator.getCapabilitie() gets a list of qualified logical devices with stream capabilities;
2) {device}.getUserMedia() gets a stream from the selected device with the requested capability;

Thanks.
Li

-----Original Message-----
From: Harald Alvestrand [mailto:harald@alvestrand.no] 
Sent: Monday, April 09, 2012 9:51 AM
To: Li Li
Cc: Soo-Hyun Choi; public-media-capture@w3.org
Subject: Re: 答复: Constraints and Capabilities API for getUserMedia: more detailed proposal

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.

Does this need further definition?


> Li
>
>
> -----邮件原件-----
> 发件人: Soo-Hyun Choi [mailto:s.choi@hackerslab.eu] 
> 发送时间: 2012年3月29日 8:28
> 收件人: Li Li
> 抄送: public-media-capture@w3.org
> 主题: Re: Constraints and Capabilities API for getUserMedia: more detailed proposal
>
> All,
>
> On Wed, Mar 28, 2012 at 11:32, Li Li <Li.NJ.Li@huawei.com> wrote:
>> If the getCapabilities() returns multiple devices (e.g. camera001,
>> camera002), I wonder how navigator.getUserMedia() is able to select which
>> device to use. Do we have to say: camera001.getUserMedia(), or somehow
>> designate the target device in the argument?
>>
> As I've raised the similar issue earlier regarding this
> (http://lists.w3.org/Archives/Public/public-media-capture/2012Mar/0015.html),
> this sort of choosing multiple cameras should better to be considered.
>
>
> Best regards,
> Soo-Hyun

Received on Monday, 9 April 2012 16:23:00 UTC