<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Lucida Grande">I found the problem<br>
it was when defining the main windows to user RGBA Colormap<br>
<br>
gtk_widget_set_default_colormap    (
gdk_screen_get_rgba_colormap(screen) )<br>
<br>
<br>
mh... do you know how can I solve it? I need the window to be RGBA!<br>
<br>
<br>
Thanks!<br>
</font></font><br>
En/na sledge hammer ha escrit:
<blockquote cite="mid:BLU122-W473D2EDE396CEDDF0C8FC1AB6F0@phx.gbl"
 type="cite">
  <style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
  </style>Take a look at the example code here:<br>
<a class="moz-txt-link-freetext" href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html</a><br>
  <br>
Basically you need to listen for 'prepare-xwindow-id' signal and handle
it synchronoysly.<br>
  <hr id="stopSpelling">Date: Wed, 29 Apr 2009 11:14:57 +0200<br>
From: <a class="moz-txt-link-abbreviated" href="mailto:guitarboy000@gmail.com">guitarboy000@gmail.com</a><br>
To: <a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
Subject: [gst-devel] Gtk xoverlay problem<br>
  <br>
Hi,<br>
  <br>
I'm developing an application, it's called Gloobus and it wants to be a
very fast previewer for any kind of file, you can see some screenhots
and download it from here:<br>
  <br>
  <a moz-do-not-send="true">http://gloobus.launchpad.net</a><br>
  <br>
Now, I can reproduce audio files with gstreamer without any problem,
but when I try to do it for movies, they play in his own window.<br>
I've been trying a lot of thing with the xoverlay function that its
supposed to be the one to make the video play in a gtk widget but I get
an error<br>
  <br>
If I add the gtk_drawing_area into the GTK_FIXED before I call the
xoverlay function, I get a BAD WINDOW error and the application stops.<br>
If I add the gtk_drawing_area into the GTK_FIXED after I call the
xoverlay function, I get that the gtk drawin has no window or pixmap
and it plays in its own window.<br>
  <br>
Here you have the code, I hope you can see what fails here:<br>
  <br>
container is a gtk_fixed added into the main window!<br>
  <br>
  <br>
  <br>
  <br>
void iMovie::play(GtkWidget * container)<br>
{<br>
  <br>
         m_drawable = gtk_drawing_area_new();<br>
         gtk_widget_set_size_request (m_drawable, 600, 500);<br>
       
 gtk_fixed_put(GTK_FIXED(container),m_drawable,SHADOW_WIDTH,SHADOW_WIDTH+HEADER_HEIGHT);<br>
                   <br>
         g_print("Start Playing (%s)...\n",g_file_get_uri ( m_gfile));<br>
  <br>
         gst_init (NULL, NULL);<br>
  <br>
         m_pipeline         = gst_pipeline_new            
("gst-player");<br>
         m_bin               = gst_element_factory_make ("playbin",    
  "m_bin");<br>
         m_sink          = gst_element_factory_make ("xvimagesink", 
"m_sink");<br>
         g_object_set ( G_OBJECT (m_bin), "video-sink", m_sink, NULL );<br>
         gst_bin_add  ( GST_BIN (m_pipeline), m_bin );<br>
  <br>
  <br>
         {<br>
                  GstBus *bus;<br>
                  bus = gst_pipeline_get_bus (GST_PIPELINE
(m_pipeline));<br>
                  gst_object_unref (bus);<br>
         }<br>
  <br>
         <br>
         g_object_set (G_OBJECT (m_bin), "uri", g_file_get_uri(
m_gfile), NULL );<br>
         g_object_set (G_OBJECT (m_sink), "force-aspect-ratio", TRUE,
NULL  );<br>
         <br>
    <br>
             <br>
         if (GST_IS_X_OVERLAY (m_sink))<br>
            {<br>
                  printf("Is Overlay (Win ID:
%i)!!\n",GPOINTER_TO_INT(GDK_WINDOW_XWINDOW(m_drawable-&gt;window)));<br>
  <br>
                  gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (m_sink),
GPOINTER_TO_INT(GDK_WINDOW_XWINDOW(m_drawable-&gt;window)));<br>
                  gst_x_overlay_handle_events  (GST_X_OVERLAY (m_sink),
FALSE);<br>
            }<br>
 <br>
         gst_element_set_state (m_pipeline, GST_STATE_PLAYING);<br>
          <br>
         gtk_widget_show_all(container); <br>
}<br clear="all">
  <br>
-- <br>
Jordi Hernández Puigdellívol<br>
  <br>
  <hr>Δείξτε το στιλ σας με μια εικόνα στο Messenger. Δείτε τις όλες. <a
 moz-do-not-send="true" href="http://download.live.com/messenger%20"
 target="_new">Κάντε κλικ εδώ!</a>
  <pre wrap="">
<hr size="4" width="90%">
------------------------------------------------------------------------------
Register Now &amp; Save for Velocity, the Web Performance &amp; Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance &amp; Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/velocityconf">http://p.sf.net/sfu/velocityconf</a></pre>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a>
  </pre>
</blockquote>
</body>
</html>