[gst-devel] Xwindow and freeze with video display
bounce bounce
bouncebounce at caramail.com
Tue Jul 10 19:50:24 CEST 2007
Hi,
I'm developping a Xwindow application using GStreamer to play video.
I'm using a "ximagesink" in my application and I encounter some problems with GStreamer.
I'm using a "playbin" pipeline and a "ximagesink" sink.
/******************************************************/
playbin = gst_element_factory_make ("playbin", "playbin");
if (!playbin) {
printf("Couldn't create playbin element.");
return FALSE;
}
GstBus *bus = gst_element_get_bus(playbin);
gst_bus_enable_sync_message_emission (bus);
// connect to the sync-message signal of the bus
g_signal_connect (bus, "sync-message", G_CALLBACK(cb_bus), NULL);
vsink = gst_element_factory_make("ximagesink", "vsink");
gst_element_set_bus(vsink,bus);
GstStateChangeReturn ret;
ret=gst_element_set_state(vsink,GST_STATE_READY);
if(ret==GST_STATE_CHANGE_FAILURE){
g_print("failed to set vsink state to ready\n");
exit(-1);
}
asink = gst_element_factory_make ("fakesink", "asink");
g_object_set (G_OBJECT (playbin), "audio-sink", asink, "video-sink", vsink, NULL);
if ( ! playbin || ! vsink || ! asink ) {
printf("Couldn't continue due to an error while making elements : ");
return FALSE;
}
/* catch "prepare-xwindow-id" message */
gst_bus_set_sync_handler(bus,gst_bus_sync_signal_handler,NULL);
/* sycn_handler need to be release on app finalizing */
gulong sync_handler=g_signal_connect(bus, "sync-message::element", G_CALLBACK(element_msg_sync), video_win);
gst_object_unref(GST_OBJECT(bus));
/********************************************************/
As you can observed, I'm trying to use "gst_bus_enable_sync_message_emission()" because I don't want to use G_MAIN_LOOP but I've some problem when I try to read the video after that an EOS message was sent. The video is output with a lot of freeze while the background seems to be well.
I've the same problem when I'm trying to seek the video.
I read in the documentation that I need to call "gst_bus_enable_sync_message_emission()" regularly and to call "gst_bus_disable_sync_message_emission()" also. So, I'm trying to call "gst_bus_enable_sync_message_emission()" each time I'm playing the video but the problem is always here, the video display is always freezing.
Do you have an idea about the problem ?
Can "gst_bus_enable_sync_message_emission()" be the origin of my problem ?
Do you have a suggestion ?
More information about the gstreamer-devel
mailing list