Question

I have a delphi app that takes snapshots from a webcam at 1 sec intervals. On the development PC it goes fine, but on the target platform (Atom-based tablet PC running embedded Windows 7 with a different camera) it is extremely flaky. After a reboot and the first time the app is run, it normally manages to initialise the webcam OK and get regular frames from it, but the next time the app is run, it fails to locate the webcam driver, and also pops up a dialog asking me to specify the video source, presumably because it can't find one..

My question: I'm sure this is related to video capture API calls not being in the right order or something, but is there a tool (like wireshark) that will enable me to sniff the API calls, so I can compare what is happening on the embedded Windows 7 system to the XP development system that works?

I am using the following calls/messages:

Initialisation:

capCreateCaptureWindow
WM_CAP_DRIVER_CONNECT
WM_CAP_SET_PREVIEW (false)
WM_CAP_SET_VIDEOFORMAT (as camera after boot is in format I can't handle)
WM_CAP_GET_VIDEOFORMAT

On 1 sec timer:

WM_CAP_SET_CALLBACK_FRAME
WM_CAP_GRAB_FRAME_NOSTOP

On callback:

WM_CAP_SET_CALLBACK_FRAME (nil)

On finish:

WM_CAP_ABORT
WM_CAP_STOP
WM_CAP_DRIVER_DISCONNECT
Was it helpful?

Solution

The first step is a lot easier: Did you make absolutely sure you have the same driver?

It might also be that the sequence of detect - start acquisition is too fast for this slow system. See if introducing a few secs sleep inbetween helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top