Kotlin
How mirroring actually works
The “mirror” effect itself is implemented at the point where you transform raw camera frames into frames that are given to the SDK:
Obtain the raw camera frame For Camera2: from the ImageReader callback. Apply a horizontal flip (mirror)
- Software mirroring: manipulate the pixel buffer (e.g., reverse columns per row).
- Texture/GL mirroring: if using OpenGL, flip the texture coordinates horizontally when drawing to the surface that feeds the SDK.
- In either case, the final frame the SDK sees has left/right swapped vs. the raw camera output.
- Deliver the mirrored frame to the SDK
- Convert the frame to the configured pixel format (e.g., NV21) if necessary. Call the appropriate callback method on BaseVideoCapturer to hand off the mirrored frame.
Basic video capture
Learn how set up a basic video capturer using the Vonage Video SDK.
Steps
1
Introduction2
Getting Started3
Creating a new project4
Adding the Android SDK5
Setting up authentication6
Requesting permissions7
Creating the Mirror Video Capturer8
Starting capture wiring into the Publisher lifecycle9
How mirroring actually works10
Running the app11
Conclusion