What is the Camera2 API Equivalent of setDisplayOrientation()?

后端 未结 4 1903
走了就别回头了
走了就别回头了 2020-12-24 12:35

With android.hardware.Camera, in order to have the camera output appropriately track the device movement, we need to hook up an OrientationEventListener

4条回答
  •  不思量自难忘°
    2020-12-24 13:29

    As you've noticed, this is supposed to "just work" for SurfaceView on the camera2 API.

    As such, there's no equivalent of setDisplayOrientation().

    We haven't heard of this issue before now, so a few questions:

    1. Do you have your app locked to landscape, or are you allowing orientation changes?
    2. Do you handle your own orientation changes, or are you having the framework tear down and restart your app when orientation changes?
    3. Do you trigger any sort of re-layout when the 180-degree rotation occurs, for example to adjust where the shutter button is?

提交回复
热议问题