Skip to content

Commit 5260b90

Browse files
dimadesuThibaultBee
authored andcommitted
feat(ui): render preview of correct size in landscape orientation for non-camera sources
1 parent 3a39c00 commit 5260b90

File tree

1 file changed

+4
-1
lines changed
  • ui/src/main/java/io/github/thibaultbee/streampack/ui/views

1 file changed

+4
-1
lines changed

ui/src/main/java/io/github/thibaultbee/streampack/ui/views/PreviewView.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,10 @@ class PreviewView @JvmOverloads constructor(
431431
context.getCameraCharacteristics(videoSource.cameraId)
432432
builder.populateFromCharacteristics(cameraCharacteristics).build()
433433
} else {
434-
builder.build()
434+
val rotationDegrees = OrientationUtils.getSurfaceRotationDegrees(display.rotation)
435+
builder
436+
.setSourceOrientation(rotationDegrees)
437+
.build()
435438
}.also { request ->
436439
val surface = withContext(coroutineContext + supervisorJob) {
437440
viewfinder.requestSurface(request)

0 commit comments

Comments
 (0)