8000 Wrong frames in landscape mode · Issue #13 · openstf/minicap · GitHub
[go: up one dir, main page]

Skip to content

Wrong frames in landscape mode #13

Closed

Description

@lbielski

Hi!

I'm trying to use minicap with my Nexus 4 (api 22) and I have a problem with frames which I get when the device is rotated into a landscape mode.
I start minicap with the following command:
LD_LIBRARY_PATH=/data/local/tmp/minicap-devel /data/local/tmp/minicap-devel/minicap -P 768x1280@384x640/0

I consume the data with a client written in Java and it works beautifully in portrait mode.
As soon as I rotate the phone into a landscape I get this image:
minicap_rotated

In my Java client I'm just reading the frame and then decoding it from JPEG using ImageIO.
Is it a decoding issue or rotation is not supported yet?

Activity

  1. sorccu commented on Nov 29, 2015

    @sorccu
    Member

    Just read the README. You need to detect rotation changes with something
    and then restart minicap.

    On Sunday, 29 November 2015, lbielski notifications@github.com wrote:

    Hi!

    I'm trying to use minicap with my Nexus 4 (api 22) and I have a problem
    with frames which I get when the device is rotated into a landscape mode.
    I start minicap with the following command:
    LD_LIBRARY_PATH=/data/local/tmp/minicap-devel
    /data/local/tmp/minicap-devel/minicap -P 768x1280@384x640/0

    I consume the data with a client written in Java and it works beautifully
    in portrait mode.
    As soon as I rotate the phone into a landscape I get this image:
    [image: minicap_rotated]
    https://cloud.githubusercontent.com/assets/3857029/11455380/d14b67d4-96b0-11e5-90e9-a0b5357f373c.png

    In my Java client I'm just reading the frame and then decoding it from
    JPEG using ImageIO.
    Is it a decoding issue or rotation is not supported yet?

    —
    Reply to this email directly or view it on GitHub
    #13.

  2. lbielski commented on Nov 29, 2015

    @lbielski
    Author

    Thanks for the answer!

    Actually I read the readme (otherwise I wouldn't be able to implement a client), and it says that if I'm in always upright quirk mode I should take it into account while rendering: "This needs to be taken into account when rendering the image."

    So I assumed that I should get a rotated landscape image and then rotate it while rendering.

    Any suggestions how I can detect the rotation changes?

  3. sorccu commented on Nov 29, 2015

    @sorccu
    Member

    If the quirks flags say the device has QUIRK_ALWAYS_UPRIGHT, then it means that when rotation is 0 or 180, you get a portrait image that's never upside down, or if rotation is 90 or 270, a landscape image that's never upside down.

    You can try RotationWatcher.apk like mentioned in the README.

  4. sorccu commented on Nov 29, 2015

    @sorccu
    Member

    Also, I know it sounds stupid that you have to do it that way, but it's due to limitations of the private APIs.

  5. lbielski commented on Nov 29, 2015

    @lbielski
    Author

    I'm so sorry - missed that portion of the README :(
    Now everything is clear.
    Thanks for your help!

  6. added a commit that references this issue on Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0