mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
gst-plugin: Avoid main thread invoke when used with "ClapperGtkVideo"
This thread invoke is done mainly to support testing with gst-launch-1.0, otherwise no need when used with "ClapperGtkVideo". We can avoid doing this, by checking whether this type was already registered in which case it means that "ClapperGtkVideo" widget is used within GTK application and registered before sink starts processing data. In case of "ClapperGtkVideo" we might run into situation where these two threads are stuck waiting for each other to be idle. This change works around this issue. Fixes #555
This commit is contained in:
@@ -594,11 +594,14 @@ static gboolean
|
||||
gst_clapper_sink_start (GstBaseSink *bsink)
|
||||
{
|
||||
GstClapperSink *self = GST_CLAPPER_SINK_CAST (bsink);
|
||||
gboolean with_clapper_gtk;
|
||||
|
||||
GST_INFO_OBJECT (self, "Start");
|
||||
|
||||
if (G_UNLIKELY (!(! !gst_gtk_invoke_on_main ((GThreadFunc) (GCallback)
|
||||
gst_clapper_sink_start_on_main, self)))) {
|
||||
with_clapper_gtk = g_type_from_name ("ClapperGtkVideo");
|
||||
|
||||
if (G_UNLIKELY (!with_clapper_gtk && !(! !gst_gtk_invoke_on_main (
|
||||
(GThreadFunc) (GCallback) gst_clapper_sink_start_on_main, self)))) {
|
||||
GST_ELEMENT_ERROR (self, RESOURCE, NOT_FOUND,
|
||||
("GtkWidget could not be created"), (NULL));
|
||||
|
||||
|
Reference in New Issue
Block a user