Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong frames in landscape mode #13

Closed
lbielski opened this issue Nov 29, 2015 · 5 comments
Closed

Wrong frames in landscape mode #13

lbielski opened this issue Nov 29, 2015 · 5 comments

Comments

@lbielski
Copy link

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?

@sorccu
Copy link
Member

sorccu commented Nov 29, 2015

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

On Sunday, 29 November 2015, lbielski [email protected] 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.

@lbielski
Copy link
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?

@sorccu
Copy link
Member

sorccu commented Nov 29, 2015

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.

@sorccu
Copy link
Member

sorccu commented Nov 29, 2015

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

@lbielski
Copy link
Author

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

stoefln pushed a commit to stoefln/minicap that referenced this issue Nov 10, 2021
…fig-file

Upgrade to GitHub-native Dependabot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants