-
-
Notifications
You must be signed in to change notification settings - Fork 861
Description
I am working on a front camera mirroring feature.
The goal is to keep the local preview mirrored, but ensure the viewer sees the true (non-mirrored) view, so that any text shown by the host is readable.
The following API works as expected:
if (isFrontCamera) {
setIsStreamHorizontalFlip(true)
} else {
// The rear camera should not be mirrored.
setIsStreamHorizontalFlip(false)
}
I call this code after switching the camera to keep the front camera output non-mirrored.
However, there is an issue on the viewer side. Right before the camera frame updates, the last frame from the previous camera gets flipped incorrectly.
From what I observed, the StreamHorizontalFlip flag is handled at the encoder layer. When switching the camera, there is a short delay, but the StreamHorizontalFlip flag is updated immediately. This causes the in-progress frames to be flipped.
Here are the steps:
-
Front camera (StreamHorizontalFlip(true)) capturing: F1, F2, F3, F4, F5
-
Press switch camera
-
Rear camera (StreamHorizontalFlip(false)) capturing: F6, F7, F8...
At the viewer side, frame F5 is flipped incorrectly because the StreamHorizontalFlip flag changed from true to false.
Question:
Do you have any idea how to fix this issue?
Thanks!