Delphi FireMonkey iOS Camera Orientation

  

I’m having an issue with TCameraComponent and orientation on iOS.
Here is my code where I create the Camera:
Camera:=TCameraComponent.Create(Self);
Camera.Name:=’Camera’;
Camera.OnSampleBufferReady:=CameraSampleBufferReady;
Camera.Kind:=FMX.Media.TCameraKind.BackCamera;
Camera.FocusMode:=FMX.Media.TFocusMode.ContinuousAutoFocus;
Camera.Quality:=FMX.Media.TVideoCaptureQuality.MediumQuality;
Camera.Active:=TRUE

In CameraSampleBufferReady I have (via a TThread.Synchronize):
Camera.SampleBufferToBitmap(ScannerImage.Bitmap,TRUE)

to show the frame on a TImageControl that is Client-Aligned to a TabItem on a TTabControl (I switch to this tab when the user starts scanning)
In some cases (not always, which is the puzzling thing), the camera appears to get "out of sync" (orientation-wise) with the application, ie. the image on the phone appears rotated 90°, so that when the user moves the phone left/right, the image on the phone moves up/down.
Is there a setting I can send to the Camera that forces it to follow the phone’s orientation, or can I set the Camera’s orientation to a specific setting?
The application is set to "Portrait" + "Upside Down" in Orientation setting.
The same code works flawlessly on Android.

Comments are closed.