views:

45

answers:

1

Hi,

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.

+1  A: 

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

Geraint Davies
Thanks for your answer.I agree by the fact that a process is holding the buffers (it can be for example and color/format conversion process). Since capture preview is working ok I don't think that any change concerning buffer management should be done. Rather, I suspect that when having low frame rate, intermediate processes occurs to make the Filter/renderer Pins format compatible. Since capture preview is working I wanted to compare the graph configurationand the Pin formats during run-time but I could not find any tool that do the job.Do you think I am on the right way?thanks
use the viewgraph tool from www.gdcl.co.uk/mobile to see the graph configuration and connection media types.
Geraint Davies