
Frame Grabber SDK (Windows-C) Developer Guide
// Clear buffer queues.
nRet = MV_FG_FlushQueue(hStream, MV_FG_BUFFER_QUEUE_ALL_DISCARD);
if (MV_FG_SUCCESS != nRet)
{
printf("Flush buffer queue failed! %#x\n", nRet);
}
// Revoke and release registered buffers.
for (unsigned int i = 0; i < BUFFER_NUMBER; i++)
{
if (NULL != hBuffer[i])
{
nRet = MV_FG_RevokeBuffer(hStream, hBuffer[i], NULL, NULL);
if (MV_FG_SUCCESS != nRet)
{
printf("Revoke No.%d buffer failed! %#x\n", i, nRet);
}
hBuffer[i] = NULL;
}
if (NULL != pBuffer[i])
{
free(pBuffer[i]);
pBuffer[i] = NULL;
}
}
// Close the stream channel.
nRet = MV_FG_CloseStream(hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Close stream failed! %#x\n", nRet);
}
hStream = NULL;
}
// Close the device.
if (NULL != hDevice)
{
nRet = MV_FG_CloseDevice(hDevice);
if (MV_FG_SUCCESS != nRet)
{
printf("Close device failed! %#x\n", nRet);
}
hDevice = NULL;
}
// Close the frame grabber.
if (NULL != hInterface)
{
nRet = MV_FG_CloseInterface(hInterface);
94





















































































































































