Hey Fabrice,
On 05/14/2012 01:40 PM, Fabrice Desré wrote:
Some design questions for this API :
- Where do we hook up this API : my choice would be for MediaStreams
that come from a camera to also implement the camera control interface.
I think that's a great place to start with!
- Use events or callbacks (or DOMRequests) for asynchronous calls.
getUserMedia() will probably use callbacks so it may be more consistent
to also use callbacks here.
I'd prefer callbacks, not only because it's consistent with
getUserMedia, but also that DOMRequests seem more suited to objects that
are actually in the DOM tree (and need to take advantage of multiple
listeners, event bubbling, etc). These are not applicable to Media Streams.
- Expose each control as a property or provide a generic
setFeature()/getFeature() access?
Individual properties are better than generic methods, IMHO. Otherwise
we run the risk of overloading too many things into a single function,
like ioctl.
interface CameraControl {
// takes a full resolution capture. Passes a DOMFile to successCB.
void takePicture(successCB, [errorCB]);
// asks the hardware to autofocus. successCB is called when the
// autofocus has completed.
void autofocus(successCB, [errorCB]);
attribute DOMString flash; // "on", "off" or "auto"
attribute DOMString effect; // "none", "mono", "sepia", ...
attribute long brightness;
}
All of the above look great! However:
// Starts recording. Passes a DOMFile to successCB.
startRecording(successCB);
// stops an ongoing recording. Will cause the successCB
// from startRecording to be called.
stopRecording();
We might want to consider moving recording elsewhere. There are few
proposals floating around (Media Source API, Media Recorder in
getUserMedia, and record methods on Media Streams themselves). We can
pass in resolution information via the constraints API for getUserMedia
so that recording can be done at a high resolution, independent of preview.
Cheers,
-Anant
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media