plugin: importers: Support different template and actual caps

Make a template caps during class_init. It will be used for e.g. gst-inspect-1.0, while do and use an actual caps that current HW can handle.
This commit is contained in:
Rafał Dzięgiel
2022-05-25 20:30:56 +02:00
parent 5b89879031
commit 3f7ba0674f
7 changed files with 47 additions and 30 deletions

View File

@@ -61,7 +61,7 @@ make_importer (void)
}
GstCaps *
make_caps (GstRank *rank, GStrv *context_types)
make_caps (gboolean is_template, GstRank *rank, GStrv *context_types)
{
*rank = GST_RANK_SECONDARY;
*context_types = gst_clapper_gl_base_importer_make_gl_context_types ();

View File

@@ -265,12 +265,12 @@ _update_glx_caps_on_main (GstCaps *caps)
#endif
GstCaps *
make_caps (GstRank *rank, GStrv *context_types)
make_caps (gboolean is_template, GstRank *rank, GStrv *context_types)
{
GstCaps *caps = gst_gl_upload_get_input_template_caps ();
#if GST_CLAPPER_GL_BASE_IMPORTER_HAVE_X11_GLX
if (!(! !gst_gtk_invoke_on_main ((GThreadFunc) (GCallback)
if (!is_template && !(! !gst_gtk_invoke_on_main ((GThreadFunc) (GCallback)
_update_glx_caps_on_main, caps)))
gst_clear_caps (&caps);
#endif

View File

@@ -97,7 +97,7 @@ make_importer (void)
}
GstCaps *
make_caps (GstRank *rank, GStrv *context_types)
make_caps (gboolean is_template, GstRank *rank, GStrv *context_types)
{
*rank = GST_RANK_MARGINAL;