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

[Question] Stream is rotated #1730

Open
alexsafe opened this issue Feb 26, 2025 · 2 comments
Open

[Question] Stream is rotated #1730

alexsafe opened this issue Feb 26, 2025 · 2 comments

Comments

@alexsafe
Copy link

Hi,

I am starting the stream with my phone closed. So aquiring the Surface will be an issues for this situation.
I am using GenericStream. I tried some rotations and other things. This is what I am getting.

Image Image

Is there any way to solve this using GenericStream ? To add also the fact that if the phone is on everything works good.

@pedroSG94
Copy link
Owner

Hello,

I assume that you are already using this:
https://github.com/pedroSG94/RootEncoder/blob/master/app/src/main/java/com/pedro/streamer/rotation/CameraFragment.kt#L79
Right?

If yes, then you can try get values received in each orientation when the device is on using this code:
https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/view/GlStreamInterface.kt#L85
Store it, and create your own implementation to manually add your values:

      getGlInterface().setCameraOrientation(orientation)
      getGlInterface().setIsPortrait(isPortrait)

Meanwhile, I will check if I can reproduce the issue and implement a way to works with the device locked

@alexsafe
Copy link
Author

alexsafe commented Mar 1, 2025

Hi,

I'm using getGlInterface().autoHandleOrientation = true indeed. So far, I had some trouble implementing SensorRotationManager. I did this

private val sensorRotationManager = SensorRotationManager(context, true, true) { orientation, isPortrait -> log.d(" orientation: $orientation") }

then sensorRotationManager .start() where I start the stream and in this scenario I get a GL error. Probably not a proper GL context, so I guess I'm getting it wrong. I tried a few other things but it still didn't trigger.

However, I will give this issue more bandwidth and I'll see what I can come up with too.

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