Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Camera API

80 views
Skip to first unread message

David Bruant

unread,
Dec 24, 2012, 6:37:52 AM12/24/12
to dev-w...@lists.mozilla.org
Hi,

The wikimo page [1] suggests that the Camera API is only planned for the
future. And it seems that it'll be part of the WebRTC effort which, I
understand, isn't ready yet.
However, after some digging, I've found:
* The camera app
https://github.com/mozilla-b2g/gaia/blob/master/apps/camera/js/camera.js
* A "temporary solution" https://bugzilla.mozilla.org/show_bug.cgi?id=708484
* https://bugzilla.mozilla.org/show_bug.cgi?id=776934

What's the status of this API?
Is it a privileged API?
What is the short-term plan?
Long-term plan?

More to the point, though I'll derive my own answer from the previous
answers: should I bother documenting the short-term solution?

Thanks,

David

[1] https://wiki.mozilla.org/WebAPI#Planned_for_the_future

Maire Reavy

unread,
Dec 24, 2012, 10:53:29 AM12/24/12
to David Bruant, dev-w...@lists.mozilla.org
Hi David,

How I (or others) answer your question sort of depends on why you want
to know. It sounds like you are writing documentation (or thinking
about it) for some feature or set of features. Are you interested in
Firefox OS, Firefox for Desktop, Firefox for Android, or all of the
above? What's the purpose of the documentation and who is the audience
(e.g. app developers)?

Regarding WebRTC: WebRTC uses getUserMedia (gUM) to capture live camera
(and/or microphone) data. gUM for Desktop is already in Nightly, pref'd
off. We plan to pref gUM on in Firefox 20. Note: gUM in WebRTC
currently captures live camera data (for a video stream) -- not still
images -- and does not yet support recording, though the working group
plans to extend the API to include still image capture and recording
support. The gUM standard is currently being developed at the W3C:
http://dev.w3.org/2011/webrtc/editor/getusermedia.html

There is an open bug to add Desktop UI for still image capture using
gUM: *Bug 748835* <https://bugzilla.mozilla.org/show_bug.cgi?id=748835>

For WebRTC, we plan to get all of it (including gUM) working on Mobile
(Android and Firefox OS) in 2013. The Android work has already started.

The rest of your questions concerns the camera capture solution for
version 1 of Firefox OS. So I'll let someone else answer those. :-)

Cheers,
-Maire
> _______________________________________________
> dev-webapi mailing list
> dev-w...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-webapi

--
Maire Reavy <mre...@mozilla.com>
Mozilla

David Bruant

unread,
Dec 24, 2012, 11:08:09 AM12/24/12
to Maire Reavy, dev-w...@lists.mozilla.org
Hi Maire,

Le 24/12/2012 16:53, Maire Reavy a écrit :
> Hi David,
>
> How I (or others) answer your question sort of depends on why you want
> to know. It sounds like you are writing documentation (or thinking
> about it) for some feature or set of features.
I am indeed documenting the WebAPIs. Currently as a Mozilla contractor
(I'll likely continue after my contract ends).

> Are you interested in Firefox OS, Firefox for Desktop, Firefox for
> Android, or all of the above?
For now, it would be only FirefoxOS, but I'm interested in the others
platforms out of curiosity.

> What's the purpose of the documentation and who is the audience (e.g.
> app developers)?
The primary audience would be app developers and I have initially
refined it to non-certified apps developers, because it's the broader
audience.

> Regarding WebRTC: WebRTC uses getUserMedia (gUM) to capture live
> camera (and/or microphone) data. gUM for Desktop is already in
> Nightly, pref'd off. We plan to pref gUM on in Firefox 20. Note: gUM
> in WebRTC currently captures live camera data (for a video stream) --
> not still images -- and does not yet support recording, though the
> working group plans to extend the API to include still image capture
> and recording support. The gUM standard is currently being developed
> at the W3C: http://dev.w3.org/2011/webrtc/editor/getusermedia.html
>
> There is an open bug to add Desktop UI for still image capture using
> gUM: *Bug 748835* <https://bugzilla.mozilla.org/show_bug.cgi?id=748835>
>
> For WebRTC, we plan to get all of it (including gUM) working on Mobile
> (Android and Firefox OS) in 2013. The Android work has already started.
Good to know. Do you have a more accurate date than 2013? and how it
will relate with the initial FirefoxOS release? will getUserMedia be
exposed in it?

> The rest of your questions concerns the camera capture solution for
> version 1 of Firefox OS. So I'll let someone else answer those. :-)
Thanks for your answers about WebRTC :-)

David

Maire Reavy

unread,
Dec 24, 2012, 11:22:37 AM12/24/12
to David Bruant, dev-w...@lists.mozilla.org
On 12/24/2012 11:08 AM, David Bruant wrote:
>> For WebRTC, we plan to get all of it (including gUM) working on
>> Mobile (Android and Firefox OS) in 2013. The Android work has
>> already started.
> Good to know. Do you have a more accurate date than 2013? and how it
> will relate with the initial FirefoxOS release? will getUserMedia be
> exposed in it?

getUserMedia and WebRTC will not be in version 1 of FFOS. I expect it
will be a priority to get gUM and WebRTC into version 2, but the
features and roadmap for version 2 (especially what are required
features versus "nice to have") are still being decided. At the moment
everyone is focused on getting version 1 "done".

I believe it's worth documenting the current solution because that is
the one that will be shipping in version 1 of FFOS:
The FFOS folks can jump in and correct me if my info is stale or if
documentation already exists.

>
>> The rest of your questions concerns the camera capture solution for
>> version 1 of Firefox OS. So I'll let someone else answer those. :-)
> Thanks for your answers about WebRTC :-)

You're welcome. (And Happy Holidays!)

-Maire

>>
>> On 12/24/2012 6:37 AM, David Bruant wrote:
>>> Hi,
>>>
>>> The wikimo page [1] suggests that the Camera API is only planned for
>>> the future. And it seems that it'll be part of the WebRTC effort
>>> which, I understand, isn't ready yet.
>>> However, after some digging, I've found:
>>> * The camera app
>>> https://github.com/mozilla-b2g/gaia/blob/master/apps/camera/js/camera.js
>>>
>>> * A "temporary solution"
>>> https://bugzilla.mozilla.org/show_bug.cgi?id=708484
>>> * https://bugzilla.mozilla.org/show_bug.cgi?id=776934
>>>
>>> What's the status of this API?
>>> Is it a privileged API?
>>> What is the short-term plan?
>>> Long-term plan?
>>>
>>> More to the point, though I'll derive my own answer from the
>>> previous answers: should I bother documenting the short-term solution?
>>>
>>> Thanks,
>>>
>>> David
>>>
>>> [1] https://wiki.mozilla.org/WebAPI#Planned_for_the_future

Mike Habicher

unread,
Dec 24, 2012, 11:25:45 AM12/24/12
to Maire Reavy, dev-w...@lists.mozilla.org, David Bruant
Hi David,

The camera API[1][2] is done for Firefox OS v1. It is a privileged API,
intended only for use by the camera app, which you've linked to below in
github.

The short-term plan is to continue to extend this API to expose more
features of the underlying camera hardware to the camera app[3]; the
long-term plan is to merge it into getUserMedia() in a way that
continues to allow access to these detailed camera control functions in
a standards-compliant way.

Cheers,
--Mike.

1.
http://mxr.mozilla.org/mozilla-central/source/dom/camera/nsIDOMNavigatorCamera.idl
2.
http://mxr.mozilla.org/mozilla-central/source/dom/camera/nsIDOMCameraManager.idl
3. https://bugzilla.mozilla.org/show_bug.cgi?id=786756


On 12-12-24 10:53 AM, Maire Reavy wrote:
> Hi David,
>
> How I (or others) answer your question sort of depends on why you want
> to know. It sounds like you are writing documentation (or thinking
> about it) for some feature or set of features. Are you interested in
> Firefox OS, Firefox for Desktop, Firefox for Android, or all of the
> above? What's the purpose of the documentation and who is the
> audience (e.g. app developers)?
>
> Regarding WebRTC: WebRTC uses getUserMedia (gUM) to capture live
> camera (and/or microphone) data. gUM for Desktop is already in
> Nightly, pref'd off. We plan to pref gUM on in Firefox 20. Note: gUM
> in WebRTC currently captures live camera data (for a video stream) --
> not still images -- and does not yet support recording, though the
> working group plans to extend the API to include still image capture
> and recording support. The gUM standard is currently being developed
> at the W3C: http://dev.w3.org/2011/webrtc/editor/getusermedia.html
>
> There is an open bug to add Desktop UI for still image capture using
> gUM: *Bug 748835* <https://bugzilla.mozilla.org/show_bug.cgi?id=748835>
>
> For WebRTC, we plan to get all of it (including gUM) working on Mobile
> (Android and Firefox OS) in 2013. The Android work has already started.
>
> The rest of your questions concerns the camera capture solution for
> version 1 of Firefox OS. So I'll let someone else answer those. :-)
>
> Cheers,
> -Maire
>
>
> On 12/24/2012 6:37 AM, David Bruant wrote:
>> Hi,
>>
>> The wikimo page [1] suggests that the Camera API is only planned for
>> the future. And it seems that it'll be part of the WebRTC effort
>> which, I understand, isn't ready yet.
>> However, after some digging, I've found:
>> * The camera app
>> https://github.com/mozilla-b2g/gaia/blob/master/apps/camera/js/camera.js
>> * A "temporary solution"
>> https://bugzilla.mozilla.org/show_bug.cgi?id=708484
>> * https://bugzilla.mozilla.org/show_bug.cgi?id=776934
>>
>> What's the status of this API?
>> Is it a privileged API?
>> What is the short-term plan?
>> Long-term plan?
>>
>> More to the point, though I'll derive my own answer from the previous
>> answers: should I bother documenting the short-term solution?
>>
>> Thanks,
>>
>> David
>>
>> [1] https://wiki.mozilla.org/WebAPI#Planned_for_the_future

Jonas Sicking

unread,
Dec 25, 2012, 12:57:26 AM12/25/12
to David Bruant, dev-w...@lists.mozilla.org
On Mon, Dec 24, 2012 at 5:37 AM, David Bruant <brua...@gmail.com> wrote:
> Hi,
>
> The wikimo page [1] suggests that the Camera API is only planned for the
> future. And it seems that it'll be part of the WebRTC effort which, I
> understand, isn't ready yet.
> However, after some digging, I've found:
> * The camera app
> https://github.com/mozilla-b2g/gaia/blob/master/apps/camera/js/camera.js
> * A "temporary solution" https://bugzilla.mozilla.org/show_bug.cgi?id=708484
> * https://bugzilla.mozilla.org/show_bug.cgi?id=776934
>
> What's the status of this API?

The camera API that we put together for B2G was put together with a
lot of haste and optimized mainly for ease of implementation on top of
the backend that we have (the low-level android backend).

It is not pretty and it is not an API that I would recommend to be
standardized without modifications.

> Is it a privileged API?

In v1 yes. But for wholly other reasons. In B2G we are running all
apps in sandboxed processes. It was too much work to allow these
processes to get access to the camera backend without running the
process with very high privileges. So the API implementation only
works for apps that are running with these high privileges, which
means that we have to restrict the API only to a few certified apps.

So it's not an API problem, but an implementation problem.

> What is the short-term plan?

To ship what we have. I.e. only the camera app is running with high
enough privileges that it can use the API.

> Long-term plan?

At the very least to make the API available to sandboxed processes
which would allow us to expose it to privileged apps.

But we should look more closely at expanding the feature set of WebRTC
such that it can solve the use case of building a full featured camera
app on top of it.

> More to the point, though I'll derive my own answer from the previous
> answers: should I bother documenting the short-term solution?

I would say there are higher priorities as far as docs go.

/ Jonas
0 new messages