Skip to content

Front camera mirroring issue #1936

@mrtndat

Description

@mrtndat

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:

  1. Front camera (StreamHorizontalFlip(true)) capturing: F1, F2, F3, F4, F5

  2. Press switch camera

  3. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions