Jump to content
Sign in to follow this  
Fabian1648

[Android][Delphi Rio] Impossible to set correctly a CameraComponent

Recommended Posts

Hi,

In a Android App, I start a CameraComponent with the following code:

Quote

 if Not Assigned(CameraComponent1) then
  begin
   CameraComponent1 := TCameraComponent.Create(Self);
   CameraComponent1.Kind := TCameraKind.BackCamera;
   CameraComponent1.Quality := TVideoCaptureQuality.MediumQuality;
   CameraComponent1.OnSampleBufferReady := CameraComponent1SampleBufferReady;
   CameraComponent1.Active:=True;
  end;

When the image capture is done, I stop the camera with the following code:

Quote

 if Assigned(CameraComponent1) then
  begin
   CameraComponent1.OnSampleBufferReady := nil;
   CameraComponent1.Active := False;

   //CameraComponent1.free;
   FreeAndNil(CameraComponent1);
  end;

When I want to capture a new picture, the setting "CameraComponent1.Quality := TVideoCaptureQuality.MediumQuality" is no longer applied, the camera use its default setting!

 

Where is the problem? In my code or in the CameraComponent?

Share this post


Link to post

I have seen the same problem and have "solved" it this way:

  Kamera.Quality := FMX.Media.TVideoCaptureQuality.LowQuality;
  Kamera.Quality := FMX.Media.TVideoCaptureQuality.MediumQuality;

 

  • Like 2

Share this post


Link to post
6 hours ago, Vandrovnik said:

I have seen the same problem and have "solved" it this way:


  Kamera.Quality := FMX.Media.TVideoCaptureQuality.LowQuality;
  Kamera.Quality := FMX.Media.TVideoCaptureQuality.MediumQuality;

 

Unbelievable! it works!

 

Thank you for your help Vandrovnik!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×