Closed
Bug 1099381
Opened 11 years ago
Closed 10 years ago
[Camera][Gecko] If pre-init camera SetConfiguration() fails, need to release CameraControl and call onClosed
Categories
(Firefox OS Graveyard :: Gaia::Camera, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.2 S1 (5dec)
People
(Reporter: mikeh, Assigned: mikeh)
References
Details
(Whiteboard: [ft:media] [2.2 target])
Attachments
(1 file, 2 obsolete files)
|
9.18 KB,
patch
|
aosmond
:
review+
|
Details | Diff | Splinter Review |
With the camera pre-initialization in bug 1090501, calling getCamera() now instead creates a DOMCameraControl wrapper around the ICameraControl object and if an initial configuration is specified, passes that configuration to SetConfiguration().
SetConfiguration() can fail (see bug 1099375), but there is no way to communicate that to the app.
The cleanest solution seems to be to call getCamera()s onError callback and reject the promise, while discarding the DOM/ICameraControl objects.
| Assignee | ||
Comment 1•11 years ago
|
||
...unfortunately the getCamera() callbacks have already run. So have the hardware state change notification. Also, in the case of bug 1099375, we were even able to successfully apply the requested configuration! The failure doesn't occur until GCC::SetConfigurationImpl() tries to start the preview. It's this last step that fails.
| Assignee | ||
Comment 2•11 years ago
|
||
I'm not entirely happy with this solution, but wanted to solicit some feedback.
Comment 3•11 years ago
|
||
Comment on attachment 8525386 [details] [diff] [review]
WIP - close camera if initial config can't be applied to pre-init camera
Review of attachment 8525386 [details] [diff] [review]:
-----------------------------------------------------------------
Looks fine to me, although if you want a cleaner solution, why not redefine how/when we fulfill getCamera instead. Something like:
- Never fulfill getCamera promise on hardware open. Instead fulfill on configuration updated.
- Add configuration updated trigger when camera opened without being supplied an initial configuration by application. This makes some kind of logical sense because it still has an initial state as given by the driver.
Attachment #8525386 -
Flags: feedback?(aosmond) → feedback+
| Assignee | ||
Comment 4•11 years ago
|
||
(In reply to Andrew Osmond [:aosmond] from comment #3)
> Looks fine to me, although if you want a cleaner solution, why not redefine
> how/when we fulfill getCamera instead. Something like:
> - Never fulfill getCamera promise on hardware open. Instead fulfill on
> configuration updated.
> - Add configuration updated trigger when camera opened without being
> supplied an initial configuration by application. This makes some kind of
> logical sense because it still has an initial state as given by the driver.
The reason for not doing this is that in general, this -will- succeed, and it allows the Camera app to start up faster if it gets the open hardware instance ASAP. i.e. it can grab recorder profiles, query additional supported features, etc.
| Assignee | ||
Updated•11 years ago
|
Summary: [Camera][Gecko] If pre-init camera SetConfiguration() fails, need to release CameraControl and call onError → [Camera][Gecko] If pre-init camera SetConfiguration() fails, need to release CameraControl and call onClosed
Updated•11 years ago
|
Whiteboard: [ft:media] [2.2 target]
Target Milestone: --- → 2.2 S1 (5dec)
| Assignee | ||
Comment 5•11 years ago
|
||
Attachment #8525386 -
Attachment is obsolete: true
Attachment #8528557 -
Flags: review?(aosmond)
| Assignee | ||
Comment 6•11 years ago
|
||
Small change in StartInternal(): if there's no initial config, we don't call OnConfigurationChange() or OnPreviewStateChange().
Attachment #8528557 -
Attachment is obsolete: true
Attachment #8528557 -
Flags: review?(aosmond)
Attachment #8528609 -
Flags: review?(aosmond)
Comment 7•11 years ago
|
||
Comment on attachment 8528609 [details] [diff] [review]
Close camera if initial config can't be applied to pre-init camera, v1.1
Review of attachment 8528609 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM.
Attachment #8528609 -
Flags: review?(aosmond) → review+
Comment 8•10 years ago
|
||
Attachment 8528609 [details] [diff] was included/modified as part of bug 1104913.
https://hg.mozilla.org/mozilla-central/rev/ce9707a48002
https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/ce9707a48002
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•