Jump to content
Sign in to follow this  
stacker_liew

TCameraComponent Crash Occasionally While In Capturing Mode

Recommended Posts

17 hours ago, Dave Nottage said:

There's a workaround in the report.

Can you show me the workaround, I can't access to the server for some reason.

 

Thanks

Share this post


Link to post

Make a copy of (bds)\source\fmx\FMX.Media.Android.pas, and put it in your project folder. Modify this routine:

  function CreateJBitmapFromYuvBuffer: JBitmap;
  var
    Image: JYuvImage;
    Rect: JRect;
    Stream: JByteArrayOutputStream;
    LoadOptions: JBitmapFactory_Options;
  begin
    SurfaceSection.Acquire;
    try
      Image := TJYuvImage.JavaClass.init(SharedBuffer, SharedBufferFormat, PreviewBufferSize.X, PreviewBufferSize.Y,
        nil);
    finally
      SurfaceSection.Release;
    end;

Replacing the SurfaceSection references with QueueSection

  • Like 1

Share this post


Link to post
On 4/28/2019 at 11:31 AM, Dave Nottage said:

Make a copy of (bds)\source\fmx\FMX.Media.Android.pas, and put it in your project folder. Modify this routine:


  function CreateJBitmapFromYuvBuffer: JBitmap;
  var
    Image: JYuvImage;
    Rect: JRect;
    Stream: JByteArrayOutputStream;
    LoadOptions: JBitmapFactory_Options;
  begin
    SurfaceSection.Acquire;
    try
      Image := TJYuvImage.JavaClass.init(SharedBuffer, SharedBufferFormat, PreviewBufferSize.X, PreviewBufferSize.Y,
        nil);
    finally
      SurfaceSection.Release;
    end;

Replacing the SurfaceSection references with QueueSection

Thanks.

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  

×