Advertisement
Guest User

Untitled

a guest
Mar 1st, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.32 KB | None | 0 0
  1. // Request a frame buffer from capture driver
  2.     if (IOM_COMPLETED == status) {
  3.         // Capture buffer will return the latest captured buffer
  4.         status = FVID_dequeue(capChInfo.chanHandle, &(capChInfo.frame));
  5.         if (IOM_COMPLETED != status) {
  6.             System_printf("Failed to dequeue capture channel device\r\n");
  7.             BIOS_exit(0);
  8.         }
  9.         System_printf("DQ Cap vpifFrm.rpFrm = 0x%x\r\n", capChInfo.frame->frame.rpFrm);
  10.     }
  11.  
  12.     framecount++;
  13.     while (framecount < NR_FRAMES_CAPTURED) {
  14.         framecount++;
  15.  
  16.         // Invalidate the buffer before giving to capture driver
  17.         Cache_inv(capChInfo.frame->frame.rpFrm.buf, sizeimage*2, Cache_Type_ALL, TRUE);
  18.  
  19.         // Give the old capture frame buffer back to driver and get the
  20.         // recently captured frame buffer
  21.         status = FVID_exchange(capChInfo.chanHandle, &(capChInfo.frame));
  22.         if (IOM_COMPLETED != status) {
  23.             System_printf("Error in exchanging capture buffer\r\n");
  24.             BIOS_exit(0);
  25.         }
  26.         else {
  27.             // Flush and invalidate the processed buffer so that the DMA
  28.             // reads the processed data
  29.             Cache_wbInv(capChInfo.frame->frame.rpFrm.buf, sizeimage*2, Cache_Type_ALL, TRUE);
  30.         }
  31.     }
  32.  
  33.     memcpy(captured_raw_data_buffer, capChInfo.frame->frame.rpFrm.buf, sizeimage*2);
  34.     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