fix: video orientation hint degrees
This commit is contained in:
1 parent
5471f8cd80
commit
9d11cf99ed
2 files changed
+11
-3
No files matched your search
@@ -7271,10 +7271,18 @@ class Camera2Controller(private val context: Context) {
|
||||
}
|
||||
|
||||
private fun resolveDedicatedVideoOrientationHintDegrees(orientationOffsetDegrees: Int): Int {
|
||||
return resolveSurfaceTextureVideoOrientationDegrees(
|
||||
deviceRotationDegrees = OrientationObserver.rotationDegrees.toInt(),
|
||||
// UI 在反向竖屏时保持 0°,录像必须使用包含 180° 的拍摄方向。
|
||||
val captureRotationDegrees = OrientationObserver.captureRotationDegrees.toInt()
|
||||
val orientationHintDegrees = resolveSurfaceTextureVideoOrientationDegrees(
|
||||
deviceRotationDegrees = captureRotationDegrees,
|
||||
calibrationOffsetDegrees = orientationOffsetDegrees,
|
||||
)
|
||||
PLog.d(
|
||||
TAG,
|
||||
"Video orientation: capture=$captureRotationDegrees, " +
|
||||
"calibrationOffset=$orientationOffsetDegrees, orientationHint=$orientationHintDegrees"
|
||||
)
|
||||
return orientationHintDegrees
|
||||
}
|
||||
|
||||
// ==================== 延时拍摄和网格线 ====================
|
||||
|
||||
@@ -34,7 +34,7 @@ object OrientationObserver {
|
||||
var continuousOrientationDegrees by mutableFloatStateOf(0f)
|
||||
private set
|
||||
|
||||
// 存储拍摄方向,包含反向竖屏,用于照片保存/处理
|
||||
// 存储拍摄方向,包含反向竖屏,用于照片保存/处理和录像方向元数据
|
||||
var captureRotationDegrees by mutableStateOf(0f)
|
||||
private set
|
||||
|
||||
|
||||
Reference in new issue
Block a user