[SDL] YUVOverlay

tony Tong chaffmanus at yahoo.com
Tue Mar 5 21:57:01 PST 2002


Here's how I'm using the yuv overlay:
//-----------------------------------------
capture from v4l capture card

SDL_Overlay *overlay;
SDL_Rect rect;
................
..............

SDL_LockYUVOverlay(overlay);
memcpy into overlay->pixels[] //copy data from v4l
card
SDL_UnlockYUVOverlay(overlay);
SDL_DisplayYUVOverlay(overlay,&rect);
//-----------------------------------------

But here i have something i cant understand.
1.
The method of yuvoverlay announces it will adopt DMA
which can reduce the overhead of cpu.However in above
code,memcpy still will consume most cpu time .
then does it mean SDL yuvoverlay is not a true
hardware overlay?
2.
SDL announces it support the hardware overlay .
why do i need memcpy in the above code ? 
it seems the copy function should be implement by
hardware just like " overlay->pixels =
hardware_data_Y_pointer 
why ?  who can give me a answer ?
Any help will be nice ,thanks in advance!


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/




More information about the SDL mailing list