How To Stop Video Capture - DIGITAL-LOGIC MICROSPACE PCC-P5 Technical User's Manual

Table of Contents

Advertisement

DIGITAL-LOGIC AG
PCCP5 Manual V2.3

4.11.5 How to stop video capture

//-------------------------------------------------------------------------
// FreezeVideo() : Stops capturing the incoming video; whatever is in the
// frame buffer is being displayed.
//
// Enter:
// none
// Exit :
// Nothing
//-------------------------------------------------------------------------
void FreezeVideo()
{
int mr03;
DWORD start_time;
WritePortUchar(ulMrAddr, MR_VIN_CTRL_2);
mr03 = ReadPortUshort(ulMrAddr); // Read current value
if((mr03 & (VIC2_START_GRAB << 8)))
{ // video is running, h/w is grabbing video, wait for input VSync
mr03 &= ~(VIC2_START_GRAB << 8); // turn off the bit to freeze the video
//
// Sometimes if Video Input is not comming thru video port (ZV Port
// Disabled) then we will never get Video VSync (hanging problem). We must
// time out our wait for VSync. If we do not see VSync within 2 frames
// of input VSync (80 Miliseconds for 25Hz Video, worst case) we must get
// out of the waiting loop.
//
start_time = timeGetTime(); // 1 millisec precision
WritePortUchar(ulMrAddr, MR_VIN_CTRL_4);
while( !(ReadPortUshort(ulMrAddr) & (VIC4_VSYNC << 8)) &&
((timeGetTime() - start_time) < 200));
WritePortUshort(ulMrAddr, mr03); // freeze the video
start_time = timeGetTime(); // 1 millisec precision
WritePortUchar(ulMrAddr, MR_VIN_CTRL_4);
while((ReadPortUshort(ulMrAddr) & (VIC4_FRM_READY << 8)) &&
((timeGetTime() - start_time) < 200));
76

Advertisement

Table of Contents
loading

Table of Contents