<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
hello, <br>
<br>
I hacked vlc0.7.0 on the template of mozilla plugin to wrap libvlc into
a dynamic library. This library is useful to integrate vlc into any app
software. Then, I created a QT component which offers high level
function interfacing with my library. <br>
<br>
My primary target was windows box and after having installed every
necessary cygwin tools and sdk and managed to compile vlc, all worked
really fine. My next cibling is Linux and here I face a display
problem. As I'm really not a specialist of  x11/xvideo but more a
beginner, I will try to expose you my bug and my understanding of the
process : <br>
<br>
One essential function in the mozilla plugin (and therefore mine) is
the SetWindow function. this function transmits to vlc a window handle
which is where the app wants VLC to display media. Window handle is
affected to vlc variable "drawable". later the vout module (x11 or
xvideo) will use that one if set instead of creating a new window.<br>
SetWindow as lot of os-specific code.  As for  linux,  there is those 4
lines : <br>
<br>
<font color="#000099"><small><font
 face="Courier New, Courier, monospace">    p_plugin->window =
(Window) window->window;<br>
    p_plugin->p_display = ((NPSetWindowCallbackStruct
*)window->ws_info)->display;<br>
<br>
    Widget w = XtWindowToWidget( p_plugin->p_display,
p_plugin->window );<br>
    XtAddEventHandler( w, ExposureMask, FALSE,<br>
                       (XtEventHandler)Redraw, p_plugin );<br>
    Redraw( w, (XtPointer)p_plugin, NULL );</font></small><br>
</font><br>
where window is of type : <br>
<font color="#000099"><small><font
 face="Courier New, Courier, monospace">     typedef struct _NPWindow</font></small><small><font
 face="Courier New, Courier, monospace">{</font></small><br>
</font>
<blockquote><font color="#000099"><small><font
 face="Courier New, Courier, monospace">  void* window;  /* Platform
specific window handle */</font></small><br>
  <small><font face="Courier New, Courier, monospace">                
/* OS/2: x - Position of bottom left corner  */</font></small><br>
  <small><font face="Courier New, Courier, monospace">                
/* OS/2: y - relative to visible netscape window */</font></small><br>
  <small><font face="Courier New, Courier, monospace">  int32 x;      
/* Position of top left corner relative */</font></small><br>
  <small><font face="Courier New, Courier, monospace">  int32 y;      
/* to a netscape page.                    */</font></small><br>
  <small><font face="Courier New, Courier, monospace">  uint32 width; 
/* Maximum window size */</font></small><br>
  <small><font face="Courier New, Courier, monospace">  uint32 height;</font></small><br>
  <small><font face="Courier New, Courier, monospace">  NPRect
clipRect; /* Clipping rectangle in port coordinates */</font></small><br>
  <small><font face="Courier New, Courier, monospace">                  
/* Used by MAC only.              */</font></small><br>
  <small><font face="Courier New, Courier, monospace">#if
defined(XP_UNIX) && !defined(XP_MACOSX)</font></small><br>
  <small><font face="Courier New, Courier, monospace">  void * ws_info;
/* Platform-dependent additonal data */</font></small><br>
  <small><font face="Courier New, Courier, monospace">#endif /* XP_UNIX
*/</font></small><br>
  <small><font face="Courier New, Courier, monospace">  NPWindowType
type; /* Is this a window or a drawable? */</font></small><br>
  <small><font face="Courier New, Courier, monospace">} NPWindow;</font></small><br>
  </font></blockquote>
<br>
and here is <small><font face="Courier New, Courier, monospace">NPSetWindowCallbackStruct
:</font></small><br>
<blockquote><font color="#000099"><small><font
 face="Courier New, Courier, monospace">typedef struct</font></small><br>
  <small><font face="Courier New, Courier, monospace">{</font></small><br>
  <small><font face="Courier New, Courier, monospace">  int32       
type;</font></small><br>
  <small><font face="Courier New, Courier, monospace">#ifdef XP_UNIX</font></small><br>
  <small><font face="Courier New, Courier, monospace">  Display*    
display;</font></small><br>
  <small><font face="Courier New, Courier, monospace">  Visual*     
visual;</font></small><br>
  <small><font face="Courier New, Courier, monospace">  Colormap    
colormap;</font></small><br>
  <small><font face="Courier New, Courier, monospace">  unsigned int
depth;</font></small><br>
  <small><font face="Courier New, Courier, monospace">#endif</font></small><br>
  <small><font face="Courier New, Courier, monospace">}
NPSetWindowCallbackStruct;</font></small><br>
  </font></blockquote>
Two parameters are used there : <br>
- window->window which is the window handle. this one I affect with
QWidget::winId (QT function). <br>
- <small><font face="Courier New, Courier, monospace">((NPSetWindowCallbackStruct
*)window->ws_info)->display which is the X11 display. <br>
</font></small>I tried to use QWidget::x11Display,
QWidget::x11AppDisplay or qt_xdisplay for the latter parameter but
every try ended with a :<br>
"<font color="#ff6666">Couldn't find per display information</font>"
message and exit of the app. <br>
<br>
I'm lost here and can't figure what I miss. If someone has more
knowledge of x11 and of what vlc is waiting for,  I would  appreciate 
to learn.<br>
<br>
thanks, <br>
dominique<br>
 <br>
<small><font face="Courier New, Courier, monospace"><br>
</font></small><br>
<br>
</body>
</html>

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster@videolan.org>