From 2c9cbc6d06ee0feec7977619f47638c30203f00a Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 5 Jul 2019 09:40:57 -0400 Subject: [PATCH] formatter: Better document metadata registration And fix xges mimetype to match typefind mimetype --- ges/ges-formatter.c | 37 ++++++++++++++++++++++++++----------- ges/ges-formatter.h | 2 +- ges/ges-xml-formatter.c | 2 +- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ges/ges-formatter.c b/ges/ges-formatter.c index 2f5d815..3f992ae 100644 --- a/ges/ges-formatter.c +++ b/ges/ges-formatter.c @@ -470,22 +470,37 @@ ges_formatter_get_default (void) return ret; } +/** + * ges_formatter_class_register_metas: + * @klass: The class to register metas on + * @name: The name of the formatter + * @description: The formatter description + * @extensions: A list of coma separated file extensions handled + * by the formatter. The order of the extensions should match the + * list of the structures inside @caps + * @caps: The caps the formatter handled, they should match what + * gstreamer typefind mechanism will report for the files the formatter + * handles. + * @version: The version of the formatter + * @rank: The rank of the formatter + */ void -ges_formatter_class_register_metas (GESFormatterClass * class, +ges_formatter_class_register_metas (GESFormatterClass * klass, const gchar * name, const gchar * description, const gchar * extensions, - const gchar * mimetype, gdouble version, GstRank rank) + const gchar * caps, gdouble version, GstRank rank) { - class->name = g_strdup (name); - class->description = g_strdup (description); - class->extension = g_strdup (extensions); - class->mimetype = g_strdup (mimetype); - class->version = version; - class->rank = rank; + g_return_if_fail (klass->name); + klass->name = g_strdup (name); + klass->description = g_strdup (description); + klass->extension = g_strdup (extensions); + klass->mimetype = g_strdup (caps); + klass->version = version; + klass->rank = rank; if (g_atomic_int_get (&initialized) - && g_type_class_peek (G_OBJECT_CLASS_TYPE (class))) - gst_object_unref (ges_asset_request (G_OBJECT_CLASS_TYPE (class), NULL, - NULL)); + && g_type_class_peek (G_OBJECT_CLASS_TYPE (klass))) + gst_object_unref (ges_asset_request (G_OBJECT_CLASS_TYPE (klass), NULL, + NULL)); } /* Main Formatter methods */ diff --git a/ges/ges-formatter.h b/ges/ges-formatter.h index 1f31bf8..e2beec3 100644 --- a/ges/ges-formatter.h +++ b/ges/ges-formatter.h @@ -150,7 +150,7 @@ void ges_formatter_class_register_metas (GESFormatterClass * klass, const gchar *name, const gchar *description, const gchar *extensions, - const gchar *mimetype, + const gchar *caps, gdouble version, GstRank rank); diff --git a/ges/ges-xml-formatter.c b/ges/ges-xml-formatter.c index a426249..4eee805 100644 --- a/ges/ges-xml-formatter.c +++ b/ges/ges-xml-formatter.c @@ -2084,7 +2084,7 @@ ges_xml_formatter_class_init (GESXmlFormatterClass * self_class) ges_formatter_class_register_metas (GES_FORMATTER_CLASS (self_class), "ges", "GStreamer Editing Services project files", - "xges", "application/ges", VERSION, GST_RANK_PRIMARY); + "xges", "application/xges", VERSION, GST_RANK_PRIMARY); basexmlformatter_class->save = _save; } -- 2.7.4