Re: Multiple Xv overlays cause blue flashing

2005-11-18 Thread Mark Vojkovich
   The grab is client-specific.  The grab will only fail if it's owned
by another client.  This is just to prevent multiple apps from fighting
over the same port.  It's assumed that if you've got a single client
that client will be able to keep track of which ports it's using.

Mark.

On Thu, 17 Nov 2005, Smoof . wrote:

 Thanks everyone for the help.  The ultimate solution was that I switched to
 a machine with an nvidia chipset.  Then I was able use the video blitter
 port to send the video images to their respecitve X windows with no
 flashing.  Interesting thing is that I was able to successfully grab the
 same port multiple times.  I would have thought that once a port had been
 grabbed it would no longer be available.


 ___
 Devel mailing list
 Devel@XFree86.Org
 http://XFree86.Org/mailman/listinfo/devel

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-17 Thread Andrew C Aitchison
On Wed, 16 Nov 2005, Smoof . wrote:
 I should have mentioned earlier that for this project I can specify any 
 video card I want.  So if someone has a suggestion of what would be the best 
 video card for this type of application please let me know.

My Matrox G550 reports:

# xvinfo
X-Video Extension version 2.2
screen #0
  Adaptor #0: Matrox G-Series Texture Engine
number of ports: 32
port base: 43
operations supported: PutImage 
supported visuals:
  depth 24, visualID 0x27
  depth 24, visualID 0x28
  depth 24, visualID 0x29
  depth 24, visualID 0x2a
no port attributes defined
maximum XvImage size: 2046 x 2046
Number of image formats: 4
  id: 0x32595559 (YUY2)
guid: 59555932--0010-8000-00aa00389b71
bits per pixel: 16
number of planes: 1
type: YUV (packed)
  id: 0x32315659 (YV12)
guid: 59563132--0010-8000-00aa00389b71
bits per pixel: 12
number of planes: 3
type: YUV (planar)
  id: 0x30323449 (I420)
guid: 49343230--0010-8000-00aa00389b71
bits per pixel: 12
number of planes: 3
type: YUV (planar)
  id: 0x59565955 (UYVY)
guid: 55595659--0010-8000-00aa00389b71
bits per pixel: 16
number of planes: 1
type: YUV (packed)

I think that the line
number of ports: 32   
means that it would be suitable.

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-17 Thread Mark Vojkovich
On Wed, 16 Nov 2005, Smoof . wrote:

 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.

   Do you have non-overlay XvImage adaptors with more than one port?
NVIDIA drivers and some others offer this.


Mark.
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-17 Thread Smoof .
Thanks everyone for the help.  The ultimate solution was that I switched to 
a machine with an nvidia chipset.  Then I was able use the video blitter 
port to send the video images to their respecitve X windows with no 
flashing.  Interesting thing is that I was able to successfully grab the 
same port multiple times.  I would have thought that once a port had been 
grabbed it would no longer be available.



___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-16 Thread Alex Deucher
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

 Thanks for your help


___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-16 Thread Mark Vojkovich
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.

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-16 Thread Smoof .

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.


___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-16 Thread Tim Roberts

Smoof . wrote:



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.



Does your graphics card support OpenGL?  One practical alternative is to 
render the movies into textures.


--
Tim Roberts, [EMAIL PROTECTED]
Providenza  Boekelheide, Inc.

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-16 Thread Smoof .

Smoof . wrote:



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.



Does your graphics card support OpenGL?  One practical alternative is to 
render the movies into textures.




Yes, I ran the SDL GL test program (testgl) and here is the output

Screen BPP: 32

Vendor : Mesa project: www.mesa3d.org
Renderer   : Mesa GLX Indirect
Version: 1.3 Mesa 4.0.4
Extensions : GL_ARB_imaging GL_ARB_multitexture GL_ARB_texture_border_clamp 
GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine 
GL_ARB_texture_env_dot3 GL_ARB_transpose_matrix GL_EXT_abgr 
GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract 
GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 
GL_EXT_texture_lod_bias


I don't know anything about openGL or textures but I'll start doing some 
research.


I should have mentioned earlier that for this project I can specify any 
video card I want.  So if someone has a suggestion of what would be the best 
video card for this type of application please let me know.


Thanks for the help.


___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: Multiple Xv overlays cause blue flashing

2005-11-16 Thread Alex Deucher
On 11/16/05, Smoof . [EMAIL PROTECTED] wrote:
 Smoof . wrote:
 
 
 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.
 
 
 Does your graphics card support OpenGL?  One practical alternative is to
 render the movies into textures.
 

 Yes, I ran the SDL GL test program (testgl) and here is the output

 Screen BPP: 32

 Vendor : Mesa project: www.mesa3d.org
 Renderer   : Mesa GLX Indirect
 Version: 1.3 Mesa 4.0.4
 Extensions : GL_ARB_imaging GL_ARB_multitexture GL_ARB_texture_border_clamp
 GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine
 GL_ARB_texture_env_dot3 GL_ARB_transpose_matrix GL_EXT_abgr
 GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract
 GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3
 GL_EXT_texture_lod_bias


this is software OpenGL.

 I don't know anything about openGL or textures but I'll start doing some
 research.

 I should have mentioned earlier that for this project I can specify any
 video card I want.  So if someone has a suggestion of what would be the best
 video card for this type of application please let me know.

 Thanks for the help.



many graphics cards even support YUV textures.  mesa has an extension
to expose that functionality (MESA_ycbcr_texture, IIRC)

Alex

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel