The Gaia Camera Application (https://wiki.mozilla.org/Gaia/Camera) needs
access to camera feature that are beyond just displaying a preview and
taking a picture.
Namely, Gaia needs at least to control the flash and have the
possibility to take full resolution still capture, as well as
starting/stopping video recording. Video recording is different than
previewing since it can be a higher resolution.
Qualcomm has a API for that
(https://developer.qualcomm.com/docs/html5/api/camera.html) that maps
closely to the android HAL layer. It is fully isolated from any other
spec, eg getUserMedia() so we are unlikely to implement it as it is.
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.
- 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.
- Expose each control as a property or provide a generic
setFeature()/getFeature() access?
Here's a tentative interface description :
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]);
// Starts recording. Passes a DOMFile to successCB.
startRecording(successCB);
// stops an ongoing recording. Will cause the successCB
// from startRecording to be called.
stopRecording();
attribute DOMString flash; // "on", "off" or "auto"
attribute DOMString effect; // "none", "mono", "sepia", ...
attribute long brightness;
}
Comments, etc. welcome!
Fabrice
--
Fabrice Desré
b2g Team
Mozilla Corporation
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media