Re: X Errors when overlaying xvimagesink on GTK+ windows/widgets

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: X Errors when overlaying xvimagesink on GTK+ windows/widgets

Nick Daniels
Hi,

> When running my test program I get the following situations with the associated errors:
>
> 1. Window and video appears fine.
> ##############################
> ###
> Now playing

I have managed to solve the problem of the random crashes and X errors preventing the program from working stably by using the "expose" method used by Tristan in his blog and test program (http://tristanswork.blogspot.com/2008/09/fullscreen-video-in-gstreamer-with-gtk.html). I added the following line to my .ui file (attached in my original message) in the GtkDrawingArea widget "object".

<signal name="expose-event" handler="window_expose_cb" />

And the following handler function to my "test.c" file, also attached in the original message:

void window_expose_cb(GtkWidget * widget, GdkEventExpose * event, gpointer data)
{
    gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(vidsink), GDK_WINDOW_XWINDOW(widget->window));
}

Of course I then deleted the "setup_window" bus sync handler I was using before.

> The "tristan-test" only overlays to the Gtk Window widget and works
> fine except it throws an X error on exit with the messages in the console as follows:...

This is the only problem I still have and is the error Tristan's test program has - when you close the window the following error appears:

The program 'test' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 205 error_code 3 request_code 3 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

I assume this is because when the gst main loop is exited by closing the window the video overlay isn't being shutdown properly? My final question: is there a specific way you are meant to exit programs that are using X overlays?

Many thanks,
Nick

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: X Errors when overlaying xvimagesink on GTK+ windows/widgets

Filippo
On Thu, Dec 3, 2009 at 3:41 PM, Nick Daniels
<[hidden email]> wrote:
> Hi,
>
>> When running my test program I get the following situations with the
>> associated errors:

Hi, I could be wrong but it really seems the usual xoverlay+client
side windows bug.
Please take a look at
https://bugzilla.gnome.org/show_bug.cgi?id=599885, there is an
exhaustive explanation of the reason it happens and how to properly
solve it.

Hope this helps,
Filippo

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: X Errors when overlaying xvimagesink on GTK+ windows/widgets

Tristan Matthews-2
Hi Nick,

I've since changed how we use xoverlay in our application
(http://svn.sat.qc.ca/trac/miville). Instead of handling the
expose-event, I listen on the pipeline's bus for the
"prepare-xwindow-id" message and then call
gst_x_overlay_set_xwindow_id on the window. Additionally, I added a
callback for the window's destroy-event which quits the GMainLoop.
I'll try and do a new post soon with these details, but I'd appreciate
any feedback from the gst community on my approach.

The updated example lives at:
http://svn.sat.qc.ca/miville/inhouse/prototypes/gstreamer/cpp/fullscreen/test.c

Best,
Tristan

2009/12/3 Filippo Argiolas <[hidden email]>:

> On Thu, Dec 3, 2009 at 3:41 PM, Nick Daniels
> <[hidden email]> wrote:
>> Hi,
>>
>>> When running my test program I get the following situations with the
>>> associated errors:
>
> Hi, I could be wrong but it really seems the usual xoverlay+client
> side windows bug.
> Please take a look at
> https://bugzilla.gnome.org/show_bug.cgi?id=599885, there is an
> exhaustive explanation of the reason it happens and how to properly
> solve it.
>
> Hope this helps,
> Filippo
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>



--
Tristan Matthews
email: [hidden email]
web: http://tristanswork.blogspot.com

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: X Errors when overlaying xvimagesink on GTK+ windows/widgets

Nick Daniels
In reply to this post by Nick Daniels
> Hi, I could be wrong but it really seems the usual xoverlay+client
> side windows bug.
> Please take a look at
> https://bugzilla.gnome.org/show_bug.cgi?id=599885, there is an
> exhaustive explanation of the reason it happens and how to properly
> solve it.
>
> Hope this helps,
> Filippo

Thanks for putting me onto this Filippo, this is what my first problem must be...

> I've since changed how we use xoverlay in our application
> (http://svn.sat.qc.ca/trac/miville). Instead of handling the
> expose-event, I listen on the pipeline's bus for the
> "prepare-xwindow-id" message and then call
> gst_x_overlay_set_xwindow_id on the window. Additionally, I added a
> callback for the window's destroy-event which quits the GMainLoop.
> I'll try and do a new post soon with these details, but I'd appreciate
> any feedback from the gst community on my approach.

> The updated example lives at:
> http://svn.sat.qc.ca/miville/inhouse/prototypes/gstreamer/cpp/fullscreen/test.c

> Best,
> Tristan

Thanks Tristan, you're blog was absolutely invaluable for me getting my head around the X Overlays on GTK+. I'm a newbie to GTK, Gstreamer, Glib etc. (& C for anything more than simple engineering maths coursework) so I needed something like that to quickly introduce me!

It seems the exit error I was getting was because I was using the "gtk_main" loop function instead of the "g_main_loop_run" function. I had set a destroy event but I guess exiting the gtk_main loop does not cleanup the overlays etc. I will also try and switch to "the prepare-xwindow-id" method as that's what was suggested in the xoverlay documentation.

Thank you both for the quick help! Maybe now I can get on and actually make something useful!

Cheers,
Nick

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel