RE: getDeviceInfos and capabilities()

It seems odd to me that if you call capabilities() on a specific Track, you get something other than the capabilities of the specific device that is attached to the Track.   If we want a method that returns all capabilities for all devices, it should be static, just like getSourceInfos().    But whatever method returns all capabilities needs  to group them by device.  It doesn't do me much good to know that there is a camera facing front and also a camera with framerate n if I can't tell whether they are the same camera or not.


-          Jim

From: Harald Alvestrand [mailto:harald@alvestrand.no]
Sent: Wednesday, May 15, 2013 9:01 AM
To: public-media-capture@w3.org
Subject: getDeviceInfos and capabilities()

Hello,

I just want to verify something....
in the "device info" proposal we agreed to earlier, the following static method is added:

interface MediaStreamTrack {
    static sequence<SourceInfo> getSourceInfos()
}

dictionary SourceInfo {
   DOMString id;  // same as "sourceid" in previous proposal
   DOMString kind;  // "video" or "audio"
   DOMString label;  // only present if authorized
   VideoFacingModeEnum facing;  // only for video sources
}

One thing this allows is to get the list of all valid sourceId values. But it gives more information than that, on a per-device basis.

This has not yet been added to the draft.

The capabilities() call in the latest editors' draft also gives the list of all valid sourceId values, but in a slightly different context:

interface MediaStreamTrack : EventTarget {
   ....
    (AllVideoCapabilites or AllAudioCapabilities) capabilities ();
   ....
}

dictionary AllVideoCapabilities {
    CapabilityList?  sourceType;
    CapabilityList?  sourceId;
    CapabilityRange? width;
    CapabilityRange? height;
    CapabilityRange? frameRate;
    CapabilityList?  facingMode;
};

This gives all possible values of sourceId as well as facingMode, but doesn't match them up - you can't tell from the fact that "front" and "back" are present in the capabilities which sourceId belongs to which camera.

Two possible directions to go in:

- No change. Just add the getSourceInfos call as described, and keep the capabilities() as is - separate.
- Modify the capabilities() call to return a structure more like SourceInfo, where the capabilities of each individual device are enumerated separately - effectively, merging the two functionalities.

This moves the target of capabilties() somewhat - from describing what the legal ranges of constraints are to describing what acceptable ranges of constraints on specific devices are.

By nature, I'm conservative, so I'd prefer the first alternative. But I'm only one participant.

What do people think?

                Harald

Received on Wednesday, 15 May 2013 15:11:25 UTC