Software Archive
Read-only legacy content

AcquireAccess thowing STATUS_PARAM_UNSUPPORTED intermittently

Brennon_W_
Beginner
276 Views

Hi,

Can someone explain to me how it is possible to get intermittent exceptions with AcquireAccess?

PXCMImage.ImageData colorData;
var Aquisition = sample.color.AcquireAccess(PXCMImage.Access.ACCESS_READ, PXCMImage.PixelFormat.PIXEL_FORMAT_RGB24, out colorData);

 

The issue is that during a start up phase, I get a lot of STATUS_PARAM_UNSUPPORTED  being raised. Then at various times, it continues to be raised. My assumption is that it should either work or not in terms of Params?

Or is this because the captured data is corrupted and therefore can't be converted with the pixel format?

Is there a work around for this?

 

Cheers

0 Kudos
3 Replies
Xusheng_L_Intel
Employee
276 Views

That means the specified pixel conversion is not supported. Try to use "PIXEL_FORMAT_RGB32" and see if you still have such error. Thanks!

0 Kudos
Brennon_W_
Beginner
276 Views

Hi David,

Thank you for your response.

I have switched between the formats, but it appears the error is occurring in the ToBitmap() method of the PXCMImage.ImageData type:

To verify this, instead of letting that method try and create the Bitmap, which is what intermittently dies - I parsed an existing reference to a bitmap instance. From there, I can see that the data is viable (tracking still continues etc) but the actual image is only rendered about 80% of the time.

In the following code:

                Bitmap colorBitmap = new Bitmap(640, 480, System.Drawing.Imaging.PixelFormat.Format32bppArgb); //= null;
                PXCMImage.ImageData colorData;                

                var Aquisition = sample.color.AcquireAccess(PXCMImage.Access.ACCESS_READ, PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, out colorData);

                if (Aquisition != pxcmStatus.PXCM_STATUS_DEVICE_BUSY)
                {
                    if(Aquisition != pxcmStatus.PXCM_STATUS_NO_ERROR)
                    {
                        throw new ApplicationException("Issues with Aquisition.");
                    }

                    //colorBitmap = colorData.ToBitmap(0, sample.color.info.width, sample.color.info.height);
                    colorData.ToBitmap(0, colorBitmap);

                    if (colorBitmap == null)
                    {
                        Console.WriteLine("BITMAP FAILED");
...

The last line of code here is what would normally be hit constantly if I let ToBitmap() method try to create it.

That is a nasty defect. 

0 Kudos
Brennon_W_
Beginner
276 Views

Any updates on this?

0 Kudos
Reply