On Thu, Sep 4, 2014 at 4:22 PM, Robert O'Callahan <rob...@ocallahan.org> wrote:
> On Fri, Sep 5, 2014 at 11:01 AM, Jonas Sicking <jo...@sicking.cc> wrote:
>>
>> What's the use case here? Note that in order to build even a
>> half-decent camera app just for taking selfies you need some amount of
>> control over of focus. For more advanced camera apps you also want
>> control over backlight compensation, flash etc.
>
>
> Yes. That's all in-scope for the ImageCapture spec. See
> http://w3c.github.io/mediacapture-image/#photooptions. We don't implement
> those options yet, but ultimately ImageCapture should be what our Camera app
> uses.

Ooh, that is great! Though surprisingly the API doesn't seem to have
any support for focus or flash control? Was that intentionally left
out?

Looking at the API though, why is it based on Events rather than
Promises? This seems to make the API much harder and more error prone
to use since you might have to worry about matching up the right
'photo' event with the right call to takePhoto(). The following seems
like an easier-to-use API.

[Constructor(VideoStreamTrack track)]
interface ImageCapture {
    readonly    attribute PhotoOptions     photoOptions;
    readonly    attribute VideoStreamTrack videoStreamTrack;
    readonly    attribute MediaStream      previewStream;

    Promise<void> setOptions (PhotoSettings? photoSettings);
    Promise<Blob> takePhoto ();
    Promise<ImageData> grabFrame ();
};

/ Jonas
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to