Re: Multiple Xv overlays cause blue flashing
"Smoof ." <[email protected]>
| Newsgroups | gmane.comp.xfree86.devel |
|---|---|
| Message-ID | <[email protected]> |
>On Wed, 16 Nov 2005, Alex Deucher wrote: > > > On 11/16/05, Smoof . <[email protected]> wrote: > > > Hello, > > > > > > I am writing an application that will display up to 9 independent >video > > > streams (each stream is 320 x 240). I'm new to Xv and may not be >using the > > > correct terminology so please bear with me. I have tried two >approaches: > > > > > > The first approach was to create one large overlay using >XvShmCreateImage > > > and tile in the video frames. Once all frames are tiled in, use > > > XvShmPutImage to send them to the X server. This method works >perfectly. > > > However, my ultimate goal is to send each video stream to it's own GTK > > > widget so I can have each video stream playing in a window that can be > > > moved, be surrounded by buttons, minimized, etc... > > > > > > I implemented this by creating a simple GTK app with three drawing >areas > > > (ultimately I will have 9) of 320x240 and used some GDK functions to > > > determine the X window id's for the widgets. I created a separate >overlay > > > (again using XvShmCreateImage) for each window. Then I call >XvShmPutImage > > > once for each window. Finally I call XFlush so send the requests to >the X > > > server. I tried using XSync but it seemed to interfere with the GTK >event > > > loop. > > > > > > The problem with this second approach is that the overlays are >flashing blue > > > (the overlay color key from what I've read). So I looking for advice >on how > > > to update multiple overlays at a rate of 24fps without any flashing. >Or if > > > you don't think this is possible then please let me know and I'll just >have > > > to get by with my first implementation. > > > > > > > Most hardware only has one overlay so each widget will be fighting for > > it. only the one that has it at any given moment will actually > > display the video; the rest will show the colorkey. > > > > Alex > > Typically, a client will grab the Xv port when using it to prevent >other clients from being able to use the same Xv port. When a new >client can't grab one Xv port, it looks for another one. That mechanism >only works when there are different clients. If you want to do all >rendering from the same client, then you need to deliberately use >different ports for each Window. Some drivers export more than one >adaptor that supports XvImages and some adaptors have more than one >port. Overlay adaptors will typically only have a single port. >Run xvinfo for a summary of adaptors and their capabilities. > > > Mark. My plan was to do all the rendering with the same client and I know that my overlay adaptor only has a single port for the YUV420 format that I am using. Can someone say if the following would be possible: Suppose I create a single overlay that is the size of the entire screen. Then I could track the absolute position and visibility of the individual widget windows I want to send the video streams to. I would then tile in the images into the correct spot in the overlay to match the window position. Now, if there were some way of using the alpha channel to only cause the certain portions of the overlay to be seen then that might do the trick. Or could I just manually fill the areas I want to expose with the color key? Please keep in mind that I really don't know what I'm talking about and have no idea if this is possible but it sounds like the only way to prevent the flashing is to use a single overlay and somehow figure out how to share it among the widget windows. Thanks for your help and advice.