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

[Bug] Camera mode #89

Open
FerLuisxd opened this issue Apr 18, 2020 · 15 comments
Open

[Bug] Camera mode #89

FerLuisxd opened this issue Apr 18, 2020 · 15 comments

Comments

@FerLuisxd
Copy link

I like that the screen and video autorotates but It would be nice to define it on settings because the auto rotation works fine everywhere except for the camera app? I see the logos changing rotation but the video streaming isn't

Build: 3.4.6
Android: 10
Phone: Samsung Galaxy S10

@dkrivoruchko
Copy link
Owner

I think it's ok with camera app too, just camera app rotate image also so camera image appear to be twice rotated but not the camera app UI

@scrool
Copy link

scrool commented Apr 29, 2020

With my S10e I have noticed that:

  • Samsung's camera app always shows up in portait mode
  • Open Camera app always shows up in landscape mode
  • Google camera (side loaded, org.codeaurora.snapcam) image automatically rotated as any other screen (e.g. home screen).

I'm not very familiar with Android API but from what I read in OpenCamera's Manifet for Main Activity:

<activity
            android:name="net.sourceforge.opencamera.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="landscape"
            android:configChanges="orientation|screenSize|keyboardHidden"

it seems to handle runtime configuration changes on their own as described in Android Developers documentation -> Handle configuration changes -> Handling the configuration change yourself.

I guess there is no way for ScreenStream to detect rotation if (camera) app doesn't rotate its image?

@dkrivoruchko
Copy link
Owner

Yes, ScreenStream has no way of detecting what other apps do with rotation.
So maybe I need to add option in ScreenStream to disable rotation detection.
Will it help?

@scrool
Copy link

scrool commented Apr 29, 2020

I think autorotation in ScreenStream is not a problem here. Rather the other way around - if ScreenStream would be able to rotate output depending on device sensors rather than activity in the foreground?

@vikrant123pundir
Copy link

vikrant123pundir commented Apr 30, 2020

Yes, ScreenStream has no way of detecting what other apps do with rotation.
So maybe I need to add option in ScreenStream to disable rotation detection.
Will it help?

I am not a programmer, but can "screen-stream" know that which app is in foreground?
If yes, then user can define what to do with "rotation" when problematic apps pop up to foreground.

@dkrivoruchko
Copy link
Owner

@scrool It do rotate base on current device display rotation.
@vikrant123pundir No. This is a Android security restriction.

@FerLuisxd
Copy link
Author

What about a button to let us rotate manully?

@dkrivoruchko
Copy link
Owner

There is an option for that already.

@scrool
Copy link

scrool commented May 1, 2020

I'm still not sure if I have explained my issue correctly. So I have made a video with ScreenStream running on a phone and stream displayed on a monitor in the background. Background color of the stream is grey so you can see outline of actual image. On the monitor you can also see logcat displaying only messages that contain .*Rotation.*.

Then:

  1. I have started Google Camera app
  2. you might see that "viewfinder" (preview image?) of a camera can be seen in a stream on the background. It is in portrait mode.
  3. then I started to rotate the camera
  4. at around 11 seconds you can see that ScreenStream detected rotation and rotated the image to landscape mode.
  5. after rotation of camera back ScreenStream detected rotation and rotated the image back to portait mode.

This is the ideal behaviour that I'd love to see also for other apps. Let's continue:

  1. I have started Samsung's Camera app (default in Galaxy S10e)
  2. in the background you might see streamed image stays in portrait mode.
  3. then I have rotated the camera all the way to 90 degrees
  4. no rotation is detected by ScreenStream an image stays in portait mode.

And finally:

  1. I have started OpenCamera app.
  2. as soon as app is started stream switches to landscape mode. Phone is still in portrait position. I guess this is because of MainActivity definition of android:screenOrientation and android:configChanges (see above).
  3. again I rotated camera all the way to 90 degrees.
  4. and again no rotation is detected and this time image stays in landscape mode.

Please see video here: https://youtu.be/xRXof3bDlGw

Have we been on the same page before?

To recap - I'd like ScreenStream to rotate the image based on device sensors rather than what oritentation active activity reports to the system.

@dkrivoruchko
Copy link
Owner

@scrool Rotate based on device sensors does not help much. I can lock into portrait mode and rotate phone. This will case wrong rotation detection.
What is the real practical case you trying to solve? I doubt you use all three proto apps at once.

@vikrant123pundir
Copy link

@scrool Why not just launch the application as per your requirement of "landscape" or "portrait" mode?
Even my camera's UI exhibits same behaviour, that's why I initially downloaded another camera app with landscape mode as default.
Now I force rotate the inbuilt camera app via "automate" application. Works fine for me. You can also give it a try.

@scrool
Copy link

scrool commented May 2, 2020

can lock into portrait mode and rotate phone. This will case wrong rotation detection.

I'm not sure, if I understand your point here. I don't want to lock into any mode.

What is the real practical case you trying to solve?

I have one phone that I make a photo but I don't see application's viewfinder / preview. So I run ScreenStream there. On another (client) screen I display the stream. Rotation of phone with a camera and secondary screen are physicall in sync.

Let's say I open Samsung's camera app. If I shoot in portrait mode everything is fine. But whenever I rotate phone to landscape mode I see small, 90 degree rotatated image on the (client) secondary screen where preview from the camera is rather hard to see and rotate in my brain to understand directions. So I (often) have to unmount phone camera, go to ScreenStream settings, choose correct rotation before sending to client so I can see image on the secondary display correctly rotated.

With this feature I'd like to make faster switch between landscape and portrait mode.

I doubt you use all three proto apps at once.
You are correct. Google camera app doesnt' work for me I just happen to have it installed. Most often I use Samsung's camera but sometimes I switch to OpenCamera.

My intention was to proove the point that this beahavior depends on (camera) application rather than ScreenStream wouldn't rotate image at all.

@scrool
Copy link

scrool commented May 2, 2020

Why not just launch the application as per your requirement of "landscape" or "portrait" mode?

See above - I rotate camera phone. On the top of that I most often use Samsung phone because it has different features and is simpler to use.

@dkrivoruchko
Copy link
Owner

@scrool The only thing I can propose is to add option in app settings to disable rotation detection at all. Will it make you happy?

@scrool
Copy link

scrool commented May 2, 2020

I'm afraid that disable of rotation detection wouldn't help me.

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

4 participants