EasyManua.ls Logo

DIGITAL-LOGIC MICROSPACE PCC-P5 - How to Disable Video Playback and Capture Module (Exit); How to Start Video Capture

Default Icon
148 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DIGITAL-LOGIC AG PCCP5 Manual V2.3
75
4.11.3 How to disable video playback and capture module (Exit)
1. Restore XRD0.
2. Restore SAR04.
UCHAR XR_Index;
XR_Index = ReadPortUshort(ulXrAddr); // Save XR Index
WritePortUshort(ulXrAddr,XRD0); // Restore XRD0
WritePortUshort(ulXrAddr,0x044e); // Read SAR04
WritePortUshortAddr,SAR04); // Restore SAR04
WritePortUchar(ulXrAddr,XR_Index); // Restore XR_Index
4.11.4 How to start video capture
// In 55x VGAs, capture counters are not updated with the new off-screen
// address until the next Input Video VSync. So, the first frame of the input
// video is captured at the old address left in the counters when we froze
// the video. This may cause the memory corruption. To avoid this problem we
// need to ignore the data of the first input video frame. We already set the
// acquisition window to NULL during initialization. Now all we have to do is to
// wait for the first couple of input Vsyncs then set the acquisition rectangle
// to proper values. Acquisition rectangle must not be set till video started
// flowing in (bVideoFlowingIn = 1). bVideoFlowingIn flag is set to 0 at
// initialization time.
// So let us perform the first frame ritual.
//
if(!bVideoFlowingIn)
{ // This is first time to start 550 video, see if video is flowing?
start_time = timeGetTime(); // 1 millisec precision
while(((timeGetTime() - start_time) < 200))
{ // wait for 200 milisec (33.3 ms for 30Hz video) and VSyncActivity
WritePortUchar(ulMrAddr, MR_VIN_CTRL_4);
if(ReadPortUshort(ulMrAddr) & (VIC4_VSYNC << 8))
{
bVideoFlowingIn = 1; // video start flowing
//
// Wait for Input VSync is over.
//
start_time = timeGetTime(); // 1 millisec precision
WritePortUchar(ulMrAddr, MR_VIN_CTRL_4);
while((ReadPortUshort(ulMrAddr) & (VIC4_VSYNC << 8)) &&
((timeGetTime() - start_time) < 200));
//
// Now wait for next VSync.
//
start_time = timeGetTime(); // 1 millisec precision
WritePortUchar(ulMrAddr, MR_VIN_CTRL_4);
while(!(ReadPortUshort(ulMrAddr) & (VIC4_VSYNC << 8)) &&
((timeGetTime() - start_time) < 200));
//
// Restore crop.right
//
SetCropRect((LPRECTL)&rCrop);
break;
}
}
} // FirstTime VideoFlowingIn
mr03 |= (VIC2_START_GRAB << 8); // unfreeze the video (start capturing)
WritePortUshort(ulMrAddr,mr03); // write new value

Table of Contents

Related product manuals