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

Preview in 1:1 aspect ratio is not handled by OpenGlView in "adjust" mode #1550

Open
replicant1 opened this issue Aug 20, 2024 · 1 comment

Comments

@replicant1
Copy link

When you call startPreview() and supply a width and height that are the same, the resulting preview is distorted and does not preserve the aspect ratio of the image.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repository here: https://github.com/replicant1/OpenGLViewRootEncoderProblem
  2. In the file InstructorStreamFragment.kt go to the surfaceChanged() function and set the width and height of the preview to a resolution that is supported by your device's camera. Make sure the width and height are the same.
  3. Run the app on your device
  4. Observe that the preview is distorted

re-1080x1080

Expected behavior

The preview should not be distorted, but should be adjusted with black gutters to fit on the screen.
re-640x480

Smartphone (please complete the following information):

  • Library version 2.4.5
  • Device: Pixel 6
  • OS: Android 14
  • Media server [e.g. srs, version 5.0]
  • Class used RtmpCamera1, OpenGlView
@pedroSG94
Copy link
Owner

Hello,

Thank you for the report. Fixed here:
7106c73

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