Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a SurfaceView in android app that displays a video from a camera connected to a phone via bluetooth.
I would like to be able to horizontally mirror/flip the video after decoding it. By mirroring I mean for instance, If there's a chair showing on the left i would like to show it on the right of the screen, this is mirroring.
I know for a fact SurfaceView inherits View so I tried setScaleX(-1) with no luck

Any help will be much appreciated
Thanks in advance

What I have tried:

in iOS I have achieved this by the following sample code:
C#
AVSampleBufferDisplayLayer.transform = CATransform3DMakeScale(-1.0, 1.0, 1.0);

I was hoping that android has something similar but SurfaceView doesn't have transform property. I have tried:
Java
surfaceView.setScaleX(-1);
surfaceView.setScaleY(-1);
surfaceView.setRotationX();
Posted
Updated 31-May-19 9:21am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900