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:
Rafał Dzięgiel
2022-06-12 14:03:36 +02:00
parent 0920914b89
commit 04a028d689
17 changed files with 713 additions and 847 deletions

View File

@@ -20,6 +20,7 @@
#pragma once
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
#include "gstclapperimporter.h"
@@ -35,7 +36,9 @@ struct _GstClapperImporterLoader
GstObject parent;
GModule *last_module;
GPtrArray *importers;
GPtrArray *context_handlers;
};
GstClapperImporterLoader * gst_clapper_importer_loader_new (void);
@@ -44,8 +47,8 @@ GstPadTemplate * gst_clapper_importer_loader_make_sink_pad_template
GstCaps * gst_clapper_importer_loader_make_actual_caps (GstClapperImporterLoader *loader);
gboolean gst_clapper_importer_loader_handle_context_query (GstClapperImporterLoader *loader, GstBaseSink *bsink, GstQuery *query);
gboolean gst_clapper_importer_loader_find_importer_for_caps (GstClapperImporterLoader *loader, GstCaps *caps, GstClapperImporter **importer);
gboolean gst_clapper_importer_loader_find_importer_for_context_query (GstClapperImporterLoader *loader, GstQuery *query, GstClapperImporter **importer);
G_END_DECLS