user228561
user228561

Reputation: 1

Problem of Frame rate during the camera preview

I am writing a Camera driver driver for a Windows Mobile platform.

I have a problem with an application that shows the preview correctlly but at a very low rate (maybe 1 or 2 frames /sec).

After investigation, I could see that frames are coming ok from the sensor (every 45ms) but when a HW event occurs for that frame to be stored, no buffer is available and then the frame is dropped.

In our case, buffers are provided by the application through the IOCTL_CS_BUFFERS/CS_ENQUEUE API. The problem is that buffers are given at a very low rate and this is the reason why the preview is not working ok.

The problem is that I cannot investigate why is this API given at this rate since the PIN_IOControl is called from the Directshow firmware.

The issue I have previously described concerns a test application.

Now if I am using the Windows Mobile Camera application the preview is ok in picture mode (about 15 frames/sec). But when video mode is switched ON the the preview shows only about 2 frames pers sec (like in the test application we are using).

The only difference I could see between these 2 modes is that video mode preview is using QCIF format whereas capture mode (picture) preview used the QVGA format.

Thank you for the help.

Fabrice.

Upvotes: 0

Views: 255

Answers (1)

Geraint Davies
Geraint Davies

Reputation: 2847

Directshow will return the buffers to the pool once the downstream filters have finished with them. You are being held up by whatever is using the buffers downstream, not by directshow itself.

It sounds as if you have an encoder downstream that can only manage 2fps, so that is the rate at which capture buffers are released to the pool. You could increate the size of the pool, if you have control over your output buffer parameters in the driver, but that will not help except momentarily. You could also investigate alternate filter graphs, such as writing directly to disk.

G

Upvotes: 1

Related Questions