Skip to content

Commit 3889e45

Browse files
committed
add setPreviewRotation to glstreaminterface
1 parent 11e0b14 commit 3889e45

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

library/src/main/java/com/pedro/library/view/GlStreamInterface.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class GlStreamInterface(private val context: Context): OnFrameAvailableListener,
7070
private var encoderRecordWidth = 0
7171
private var encoderRecordHeight = 0
7272
private var streamOrientation = 0
73+
private var previewOrientation = 0
7374
private var previewWidth = 0
7475
private var previewHeight = 0
7576
private var isPortrait = false
@@ -296,7 +297,7 @@ class GlStreamInterface(private val context: Context): OnFrameAvailableListener,
296297
surfaceManager.swapBuffer()
297298
}
298299
if (surfaceManagerPreview.makeCurrent()) {
299-
mainRender.drawScreenPreview(w, h, orientationPreview, aspectRatioMode, 0,
300+
mainRender.drawScreenPreview(w, h, orientationPreview, aspectRatioMode, previewOrientation,
300301
isPreviewVerticalFlip, isPreviewHorizontalFlip, previewViewPort)
301302
surfaceManagerPreview.swapBuffer()
302303
}
@@ -445,6 +446,11 @@ class GlStreamInterface(private val context: Context): OnFrameAvailableListener,
445446
this.streamOrientation = orientation
446447
}
447448

449+
fun setPreviewRotation(orientation: Int) {
450+
this.previewOrientation = orientation
451+
}
452+
453+
448454
fun setPreviewResolution(width: Int, height: Int) {
449455
this.previewWidth = width
450456
this.previewHeight = height

0 commit comments

Comments
 (0)