airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
200 stars 11 forks source link

[Feature Request] `Camera::mirrored` #3100

Open itlancer opened 6 months ago

itlancer commented 6 months ago

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.

henke37 commented 6 months ago

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

itlancer commented 6 months ago

@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?".

henke37 commented 6 months ago

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

itlancer commented 6 months ago

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.