Microsoft DirectX 9.0 |
The most important information about a capture device is whether it has VCR functions, or is strictly a camera. To find out, call the IAMExtDevice::GetCapability method with the value ED_DEVCAP_DEVICE_TYPE. If the method returns the value ED_DEVTYPE_VCR, the device is a VCR and has functions such as pause, stop, fast-forward, and rewind. The following code example shows how to query the device type:
if (MyDevCap.bHasDevice)
{
LONG lDeviceType = 0;
MyDevCap.pDevice->GetCapability(ED_DEVCAP_DEVICE_TYPE, &lDeviceType, 0);
if (lDeviceType == ED_DEVTYPE_VCR)
{
// Device is a VCR. Enable all VCR functions.
}
else
{
// Device is a camera.
// Enable record and record-pause; disable other functions.
}
}
A camcorder can typically switch between VCR and camera functions. It returns the corresponding device type. If the camcorder goes offline, you should query it again the next time it becomes available. The filter graph manager posts an EC_DEVICE_LOST event when the device is removed.