mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
Make sure the Gdk thread lock is not held inside the gstreamer pipeline.
Original commit message from CVS: Make sure the Gdk thread lock is not held inside the gstreamer pipeline. Fix the videosink to not hold the Gdk lock when emitting a signal. All Gtk GUI apps using GStreamer should now handle the Gdk locks when handling signals from the pipeline (as it should be)
This commit is contained in:
parent
e8ea96d23b
commit
dbe262dfbb
3 changed files with 17 additions and 11 deletions
|
@ -65,9 +65,7 @@ void gst_init(int *argc,char **argv[]) {
|
|||
* Enter the main GStreamer processing loop
|
||||
*/
|
||||
void gst_main() {
|
||||
gdk_threads_enter();
|
||||
gtk_main();
|
||||
gdk_threads_leave();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -271,6 +271,8 @@ gst_media_play_state_changed (GstPlay *play,
|
|||
g_return_if_fail (GST_IS_PLAY (play));
|
||||
g_return_if_fail (GST_IS_MEDIA_PLAY (mplay));
|
||||
|
||||
|
||||
gdk_threads_enter ();
|
||||
update_buttons (mplay, state);
|
||||
|
||||
switch (state) {
|
||||
|
@ -287,6 +289,7 @@ gst_media_play_state_changed (GstPlay *play,
|
|||
area_state = GST_STATUS_AREA_STATE_INIT;
|
||||
}
|
||||
gst_status_area_set_state (mplay->status, area_state);
|
||||
gdk_threads_leave ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -324,9 +327,11 @@ gst_media_play_frame_displayed (GstPlay *play,
|
|||
current_offset = gst_play_get_media_offset (play);
|
||||
|
||||
if (current_time != mplay->last_time) {
|
||||
gdk_threads_enter ();
|
||||
gst_media_play_update_status_area (mplay, current_time, total_time);
|
||||
update_slider (mplay, mplay->adjustment, current_offset*100.0/size);
|
||||
mplay->last_time = current_time;
|
||||
gdk_threads_leave ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,7 +352,9 @@ void
|
|||
on_toggle_play_toggled (GtkToggleButton *togglebutton,
|
||||
GstMediaPlay *play)
|
||||
{
|
||||
gdk_threads_leave ();
|
||||
gst_play_play (play->play);
|
||||
gdk_threads_enter ();
|
||||
update_buttons (play, GST_PLAY_STATE(play->play));
|
||||
}
|
||||
|
||||
|
@ -355,7 +362,9 @@ void
|
|||
on_toggle_pause_toggled (GtkToggleButton *togglebutton,
|
||||
GstMediaPlay *play)
|
||||
{
|
||||
gdk_threads_leave ();
|
||||
gst_play_pause (play->play);
|
||||
gdk_threads_enter ();
|
||||
update_buttons (play, GST_PLAY_STATE(play->play));
|
||||
}
|
||||
|
||||
|
@ -363,7 +372,9 @@ void
|
|||
on_toggle_stop_toggled (GtkToggleButton *togglebutton,
|
||||
GstMediaPlay *play)
|
||||
{
|
||||
gdk_threads_leave ();
|
||||
gst_play_stop (play->play);
|
||||
gdk_threads_enter ();
|
||||
update_buttons (play, GST_PLAY_STATE(play->play));
|
||||
}
|
||||
|
||||
|
|
|
@ -4,30 +4,27 @@
|
|||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
//#define DEBUG_ENABLED
|
||||
|
||||
#include <gnome.h>
|
||||
#include <glade/glade.h>
|
||||
|
||||
#include "gstmediaplay.h"
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GstMediaPlay *play;
|
||||
|
||||
gst_init(&argc,&argv);
|
||||
gst_init (&argc,&argv);
|
||||
gnome_init ("gstreamer", VERSION, argc, argv);
|
||||
|
||||
play = gst_media_play_new();
|
||||
play = gst_media_play_new ();
|
||||
|
||||
if (argc > 1) {
|
||||
gst_media_play_start_uri(play, argv[1]);
|
||||
gst_media_play_start_uri (play, argv[1]);
|
||||
}
|
||||
|
||||
gst_main();
|
||||
gdk_threads_enter ();
|
||||
gst_main ();
|
||||
gdk_threads_leave ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue