Closed Bug 1146637 Opened 9 years ago Closed 9 years ago

Firefox OS (flame) ignores constraints, chooses very low video resolution

Categories

(Core :: WebRTC: Audio/Video, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: jryans, Assigned: jryans)

References

Details

Attachments

(2 files)

Attached file Scratchpad test script
Flame Versions (latest full flash from QA server):

Build ID               20150323010204
Gaia Revision          9b6f3024e4d0e62dd057231f4b14abe1782932ab
Gaia Date              2015-03-22 10:09:18
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/e730012260a4
Gecko Version          39.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150323.043448
Firmware Date          Mon Mar 23 04:34:57 EDT 2015
Bootloader             L1TC10011880

STR:

1. Connect to a Flame nightly with WebIDE from nightly Firefox by choosing "flame" from the "Device" menu on the top-right
2. Accept the connection prompt on device
3. Debug the System app using the "Project" menu on the top-left of WebIDE
  * If you can't see the System app (or any Gaia apps), enable "unrestricted" access from "Device" menu of WebIDE -> Runtime Info -> Request Higher Privileges (see MDN[1])
4. Choose the "Scratchpad" tool in the DevTools
5. Open the attached script
6. Press "Run"
7. Choose "Back camera" in the device's permissions prompt
8. Switch to the Console tool

Expected:

The resolution logged should be at least 480 in both dimensions.

Actual:

The resolution logged is 144 x 176.

[1]: https://developer.mozilla.org/en-US/docs/Tools/WebIDE#Unrestricted_app_debugging_%28including_certified_apps.2C_main_process.2C_etc.%29
Loading this JS fiddle[1] in the FxOS browser behaved the same way, I got 144 x 176, instead of something that meets the minimum.

[1]: http://jsfiddle.net/jryans/mux0uc2v/2/
:jib, not sure if you are the right reviewer, please redirect if needed.

I found that MediaEngineGonkVideoSource sets the picture size too late (after calling GonkCameraControl::Start), which causes GonkCameraControl to choose a picture size by "matching" two random, uninitialized values, typically causing it to choose the smallest supported size, but sometimes other values too.  By setting the values we want, we get the expected picture size.

Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6143c11d41fa
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Attachment #8587982 - Flags: review?(jib)
Comment on attachment 8587982 [details] [diff] [review]
0001-Bug-1146637-Set-correct-picture-size-on-Gonk.-r-jib.patch

Thanks! Looks good to me, but I'm going to lateral that to mikeh in case there was some reason behind the asymmetry in the old code.
Attachment #8587982 - Flags: review?(jib) → review?(mhabicher)
Comment on attachment 8587982 [details] [diff] [review]
0001-Bug-1146637-Set-correct-picture-size-on-Gonk.-r-jib.patch

Over to Andrew, as he recently refactored a lot of this code and has a better understanding of the flow.
Attachment #8587982 - Flags: review?(mhabicher) → review?(aosmond)
Comment on attachment 8587982 [details] [diff] [review]
0001-Bug-1146637-Set-correct-picture-size-on-Gonk.-r-jib.patch

Review of attachment 8587982 [details] [diff] [review]:
-----------------------------------------------------------------

r+. Good catch, this is the right thing to do (I think I posted a patch on another bug which is the same, but it never got feedback and I forgot...).
Attachment #8587982 - Flags: review?(aosmond) → review+
https://hg.mozilla.org/mozilla-central/rev/1d3edb7b2d2e
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: