First, thanks for making such an easy to use API vs.
understanding how the Xv extension works.
A system that I work with draws multiple video streams
from host memory to the screen. It was brought to my
attention that the Xv/SDL_Overlay would be the most
efficient way to put UYVY packed data on the video
card.
My question is… what is the correct way to draw data
over the overlay? The data may be bitmaps, font,
lines, arcs, etc. Here is an example of the basic
algorithm:
while (1)
{
LockSurface(pSurface)
LockOverlay(pOverlay)
FrameSync(frame) // wait for video frame
copy(frame, pOverlay->pixels[0])
UnlockOverlay(pOverlay)
UnlockSurface(pSurface)
}
If I wanted to draw a “t” breaking the screen into
four quadrants, how should I go about this? I tried
using SDL_FillRect() with a rectangle with width an
height of one to make a line and then do a
SDL_UpdateRect() only on the portion that I just drew
the lines. It would look something like this:
while (1)
{
LockSurface(pSurface)
LockOverlay(pOverlay)
FrameSync(frame) // wait for video frame
copy(frame, pOverlay->pixels[0])
// draw horizontal line
SDL_FillRect(pSurface, rect, color)
SDL_UpdateRect(pSurface, rect)
// draw vertical line
SDL_FillRect(pSurface, rect, color)
SDL_UpdateRect(pSurface, rect)
UnlockOverlay(pOverlay)
UnlockSurface(pSurface)
}
Am I doing this at the correct time? I moved the line
drawing methods outside the locking mechanisms and it
doesn’t seem to make any difference. I also notice
that the overhead starts increasing with just a few
lines. I will need to draw more complicated data on
the video overlay and am concerned that the overhead
will compound.
What I would really like to do is draw this overlay
once and have it be blitted automatically until I
choose to change it. Any thoughts, corrections, or
just good advice is welcome. Thanks.
Regards,
Shane=====
Regards,
Shane M. Walton, Software Engineer
Digital System Resources, Inc.
@Shane_Walton
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/