Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

[Feature Request] `Camera::mirrored`

Open itlancer opened this issue 1 year ago • 4 comments

Feature Description

AIR should have a way to know is camera provide mirrored image (video output) or not. For video chats, photo booths and many other AR/VR applications important to know is camera provide mirrored image or not. For example, all frontal cameras with iOS devices provide mirrored image by default. But it could varies with different cameras (embedded or external USB) for macOS/tvOS/Windows. Right now there is no way to detect it.

It could be implemented as Boolean getter Camera::mirrored or some String property which provide one of constant (UNMIRRORED, MIRRORED, UNKNOWN).

https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1389172-videomirrored?language=objc https://learn.microsoft.com/en-us/uwp/api/windows.media.capture.mediacapture.getpreviewmirroring?view=winrt-22621

Related issues: https://github.com/airsdk/Adobe-Runtime-Support/issues/1344 https://github.com/airsdk/Adobe-Runtime-Support/issues/1348 https://github.com/airsdk/Adobe-Runtime-Support/issues/305

Known Workarounds

Write your own native extension to work with cameras.

itlancer avatar Mar 04 '24 12:03 itlancer

This property belongs on the Video object. Which already lets you flip the image if you want to.

henke37 avatar Mar 09 '24 17:03 henke37

@henke37 Thanks for suggestion. But in this feature request I want to know "does camera provide mirrored output?". Not "how to make horizontal flip of video output?".

itlancer avatar Mar 11 '24 07:03 itlancer

My point is that you are misunderstanding the situation. The camera isn't the one who is flipping the image.

henke37 avatar Mar 11 '24 16:03 henke37

For iOS/macOS/tvOS I agree with you (according to Apple Objective-C/Swift APIs). For Windows it something different it belongs to MediaCapture. That's why I suggest Camera::mirrored. But it could be anything else (Video::mirrored or some other new class). I just want to detect does camera mirror the output.

itlancer avatar Mar 11 '24 17:03 itlancer