mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
plugin: Rework code to use new GL context handler
Create a GL context handler subclass of recently added context handler base class and rework code to use it. This simplifies a lot of things, like: switching of importers at runtime, handling context queries, sharing data between importers, etc.
This commit is contained in:
19
lib/gst/plugin/gstclappersink.c
vendored
19
lib/gst/plugin/gstclappersink.c
vendored
@@ -480,25 +480,12 @@ gst_clapper_sink_query (GstBaseSink *bsink, GstQuery *query)
|
||||
GstClapperSink *self = GST_CLAPPER_SINK_CAST (bsink);
|
||||
gboolean res = FALSE;
|
||||
|
||||
GST_CLAPPER_SINK_LOCK (self);
|
||||
|
||||
if (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT) {
|
||||
gboolean is_inactive;
|
||||
|
||||
GST_OBJECT_LOCK (self);
|
||||
is_inactive = (GST_STATE (self) < GST_STATE_PAUSED);
|
||||
GST_OBJECT_UNLOCK (self);
|
||||
|
||||
/* Some random context query in the middle of playback
|
||||
* should not trigger importer replacement */
|
||||
if (is_inactive)
|
||||
gst_clapper_importer_loader_find_importer_for_context_query (self->loader, query, &self->importer);
|
||||
if (self->importer)
|
||||
res = gst_clapper_importer_handle_context_query (self->importer, bsink, query);
|
||||
GST_CLAPPER_SINK_LOCK (self);
|
||||
res = gst_clapper_importer_loader_handle_context_query (self->loader, bsink, query);
|
||||
GST_CLAPPER_SINK_UNLOCK (self);
|
||||
}
|
||||
|
||||
GST_CLAPPER_SINK_UNLOCK (self);
|
||||
|
||||
if (res)
|
||||
return TRUE;
|
||||
|
||||
|
Reference in New Issue
Block a user