Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Request a frame buffer from capture driver
- if (IOM_COMPLETED == status) {
- // Capture buffer will return the latest captured buffer
- status = FVID_dequeue(capChInfo.chanHandle, &(capChInfo.frame));
- if (IOM_COMPLETED != status) {
- System_printf("Failed to dequeue capture channel device\r\n");
- BIOS_exit(0);
- }
- System_printf("DQ Cap vpifFrm.rpFrm = 0x%x\r\n", capChInfo.frame->frame.rpFrm);
- }
- framecount++;
- while (framecount < NR_FRAMES_CAPTURED) {
- framecount++;
- // Invalidate the buffer before giving to capture driver
- Cache_inv(capChInfo.frame->frame.rpFrm.buf, sizeimage*2, Cache_Type_ALL, TRUE);
- // Give the old capture frame buffer back to driver and get the
- // recently captured frame buffer
- status = FVID_exchange(capChInfo.chanHandle, &(capChInfo.frame));
- if (IOM_COMPLETED != status) {
- System_printf("Error in exchanging capture buffer\r\n");
- BIOS_exit(0);
- }
- else {
- // Flush and invalidate the processed buffer so that the DMA
- // reads the processed data
- Cache_wbInv(capChInfo.frame->frame.rpFrm.buf, sizeimage*2, Cache_Type_ALL, TRUE);
- }
- }
- memcpy(captured_raw_data_buffer, capChInfo.frame->frame.rpFrm.buf, sizeimage*2);
- Cache_wbInv(capChInfo.frame->frame.rpFrm.buf, sizeimage*4, Cache_Type_ALL, TRUE); // this is needed after memcpy, but why 4?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement