Can't always correctly rotate the camera

Bug #1535820 reported by Chris Coulson on 2016-01-19
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Oxide
High
Unassigned
webapps-sprint
High
David Barth
qtubuntu (Ubuntu)
Undecided
Unassigned

Bug Description

We rely on QScreen::orientation() and QScreen::primaryOrientation() to work out the camera orientation, but there is an issue with this on the phone - QScreen::orientation is only ever Qt::PortraitOrientation or Qt::LandscapeOrientation. We never get the Inverted orientations, which means that the we can't correctly rotate the camera in all cases.

(Also QScreen::primaryOrientation doesn't work correctly on the phone - see bug 1520670, although we do currently have a workaround for this).

Changed in oxide:
importance: Undecided → High
status: New → Triaged
summary: - Various rotation issues with video capture
+ Can't always correctly rotate the camera
Chris Coulson (chrisccoulson) wrote :

Oxide has been using QScreen::nativeOrientation for a while now instead of QScreen::primaryOrientation. Still, we never get Inverted orientations so this bug still exists.

David Barth (dbarth) on 2016-06-21
Changed in webapps-sprint:
milestone: none → sprint-24
status: New → Triaged
David Barth (dbarth) on 2016-06-21
Changed in webapps-sprint:
assignee: nobody → David Barth (dbarth)
Daniel d'Andrada (dandrader) wrote :

The problem is there's no way in those Qt APIs to specify that the QWindow is rotated relative to the QScreen. Qt API assumes that QWindow axes are always perfectly aligned with the QScreen they're in. You can only express that the *contents* of a QWindow are rotated relative to the QScreen.

Unity8 rotates window surfaces on the display. eg: a fullscreen landscape application window in a 500x1000 pixels phone screen will be 1000x500.

Meaning that applications rotated by unity8 never really know they're rotated as they don't have to bother rotating their contents. qtubuntu does some gymnastics in order to produce QScreen values that make the application think it's always matching its QSCreen and thus no content rotation is needed (eg: SDK's OrientationHelper will never think a rotation is needed).

If you really need to know where your window is on the display and how device is oriented, you will need to look elsewhere. Current Qt APIs are not able to provide that.

Daniel d'Andrada (dandrader) wrote :

And the hack in qtubuntu made to appease code that rotates UI according to Screen.angleBetween(Screen.primaryOrientation, Screen.orientation) (like OrientationHelper) also doesn't work well on desktop (bug 1542395)

David Barth (dbarth) on 2016-06-24
Changed in webapps-sprint:
importance: Undecided → High
David Barth (dbarth) on 2016-07-12
Changed in webapps-sprint:
milestone: sprint-24 → sprint-25
Peter Bittner (peter-bittner) wrote :

Looks like this issue makes the video image appear upside-down in both portrait and landscape orientation for websites using WebRTC (e.g. https://appear.in/test-drive).

Note that the image orientation used to work correctly for landscape phone orientation before OTA-11. This issue blocks the Appear.in app from working, see https://github.com/bittner/appear-in/issues/1

On BQ phone or tablet, using either oxide-1.15 or oxide-1.16, I get 2 or 3
orientations correct, out of 4.

On a krillin, ie Aquaris 4.5, I have a correct camera view in either:
portrait, landscape (rotating anti-clockwise) or inverted portrait, but not
in inverted landscape where I see myself upside down.

This is what ths bug is about.

But a phone is different than a tablet, in that inverted portrait does not
result in a shell rotation.

On a cooler, ie M10 tablet, I have 2 orientations correct: landscape (with
the camera on top), inverted portrait (ie, with the power and volume
buttons looking downward). The other 2 result in the camera view being
upside-down.

On Wed, Aug 10, 2016 at 10:30 PM, Peter Bittner <email address hidden>
wrote:

> Looks like this issue makes the video image appear upside-down in both
> portrait and landscape orientation for websites using WebRTC (e.g.
> https://appear.in/test-drive).
>
> Note that the image orientation used to work correctly for landscape
> phone orientation before OTA-11. This issue blocks the Appear.in app
> from working, see https://github.com/bittner/appear-in/issues/1
>
> ** Bug watch added: github.com/bittner/appear-in/issues #1
> https://github.com/bittner/appear-in/issues/1
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1535820
>
> Title:
> Can't always correctly rotate the camera
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/oxide/+bug/1535820/+subscriptions
>

Peter Bittner (peter-bittner) wrote :

Sorry to say so, but on bq Aquaris E5 "Ubuntu Edition" your own image is always upside-down in both the Appear.in app (i.e. displayed by the webapp-container) and the phone's Web browser, for both portrait and landscape. Try https://appear.in/ubuntu-phone yourself on the phone, or install the Appear.in app [1] and see.

[1] https://uappexplorer.com/app/appear-in.peter-bittner

As noted before, the orientation used to be correct in the Web browser (before the camera+mike access implementation was introduced) for both orientations until OTA-10 (inclusive), and correct at least for landscape starting with OTA-11.

Is there any hope this is going to be fixed any time before Christmas?

Peter Bittner (peter-bittner) wrote :

Let me reinforce that this issue is not specific to Appear.in (i.e. no "JavaScript parameter problem"). Other sites have the same problem, and the regular desktop browsers display the image correctly.

Test drive:
- https://talky.io/ubuntu-phone
- https://appear.in/ubuntu-phone
- https://webrtc.github.io/samples/src/content/devices/input-output/

Pat McGowan (pat-mcgowan) wrote :

@peter sorry it did not land, track in lp:1605365

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Michał Sawicz (saviq) on 2017-03-13
affects: qtubuntu → qtubuntu (Ubuntu)
Changed in qtubuntu (Ubuntu):
status: New → Confirmed
Changed in qtubuntu (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.