We are using camera2 API to get preview and encode video simultaneously, using mediacodec. We know when we should rotate the camera by querying 'CameraCharacteristics.SENSOR_ORIENTATION' but there is only preview rotation option.
What we need is to rotate the surface which goes to the encoder so we will not get video upside down. (Or rotate the camera itself like the old camera API.)
Thanks