ThibaultBee / StreamPack

SRT/RTMP/RTMPS live streaming libraries for Android
https://thibaultbee.github.io/StreamPack/index.html
Apache License 2.0
193 stars 68 forks source link

How to adjust Preview image to nomal? #37

Closed Squall-Huang closed 2 years ago

Squall-Huang commented 2 years ago

Hi: My app's camera AutoFitSurfaceView preview's image in portrait too thin,but in landscape too fat. How to solve this problem?

ThibaultBee commented 2 years ago

Do you have screenshot? I thought you used AndroidX SurfaceProvider?

Squall-Huang commented 2 years ago

I use

io.github.thibaultbee.streampack.views.AutoFitSurfaceView

Squall-Huang commented 2 years ago

Hi ThibaultBee: io.github.thibaultbee.streampack.views.AutoFitSurfaceView AutoFitSurfaceView stretch image. I don't know how to solve this problem?

ThibaultBee commented 2 years ago

Do you have the same aspect ratio on the demo-camera? It is not supposed to look like this. Have you tested everything with the layout_width or layout_height

ThibaultBee commented 2 years ago

Can you share your layout.xml?

Squall-Huang commented 2 years ago

Hi ThibaultBee: Thank you for reply!^^ I have chaged to another lib made with CameraX and solve this problem. But still very thanks for your enthusiastic reply.