diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index dd3e691337..54d97223cc 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -1751,6 +1751,7 @@ GstTagImageType GST_TYPE_TAG_IMAGE_TYPE gst_tag_image_type_get_type +gst_tag_license_flags_get_type GstTagEntryMatch diff --git a/gst-libs/gst/tag/licenses.c b/gst-libs/gst/tag/licenses.c index f42e971add..31632b1d1e 100644 --- a/gst-libs/gst/tag/licenses.c +++ b/gst-libs/gst/tag/licenses.c @@ -524,3 +524,55 @@ gst_tag_get_license_version (const gchar * license_ref) GST_ERROR ("Could not determine version for ref '%s'", license_ref); return NULL; } + +GType +gst_tag_license_flags_get_type (void) +{ + /* FIXME: we should really be using glib-mkenums for this.. */ +#define C_FLAGS(v) ((guint) v) + static gsize id = 0; + static const GFlagsValue values[] = { + {C_FLAGS (GST_TAG_LICENSE_PERMITS_REPRODUCTION), + "GST_TAG_LICENSE_PERMITS_REPRODUCTION", "permits-reproduction"}, + {C_FLAGS (GST_TAG_LICENSE_PERMITS_DISTRIBUTION), + "GST_TAG_LICENSE_PERMITS_DISTRIBUTION", "permits-distribution"}, + {C_FLAGS (GST_TAG_LICENSE_PERMITS_DERIVATIVE_WORKS), + "GST_TAG_LICENSE_PERMITS_DERIVATIVE_WORKS", + "permits-derivative-works"}, + {C_FLAGS (GST_TAG_LICENSE_PERMITS_SHARING), + "GST_TAG_LICENSE_PERMITS_SHARING", "permits-sharing"}, + {C_FLAGS (GST_TAG_LICENSE_REQUIRES_NOTICE), + "GST_TAG_LICENSE_REQUIRES_NOTICE", "requires-notice"}, + {C_FLAGS (GST_TAG_LICENSE_REQUIRES_ATTRIBUTION), + "GST_TAG_LICENSE_REQUIRES_ATTRIBUTION", "requires-attributions"}, + {C_FLAGS (GST_TAG_LICENSE_REQUIRES_SHARE_ALIKE), + "GST_TAG_LICENSE_REQUIRES_SHARE_ALIKE", "requires-share-alike"}, + {C_FLAGS (GST_TAG_LICENSE_REQUIRES_SOURCE_CODE), + "GST_TAG_LICENSE_REQUIRES_SOURCE_CODE", "requires-source-code"}, + {C_FLAGS (GST_TAG_LICENSE_REQUIRES_COPYLEFT), + "GST_TAG_LICENSE_REQUIRES_COPYLEFT", "requires-copyleft"}, + {C_FLAGS (GST_TAG_LICENSE_REQUIRES_LESSER_COPYLEFT), + "GST_TAG_LICENSE_REQUIRES_LESSER_COPYLEFT", + "requires-lesser-copyleft"}, + {C_FLAGS (GST_TAG_LICENSE_PROHIBITS_COMMERCIAL_USE), + "GST_TAG_LICENSE_PROHIBITS_COMMERCIAL_USE", + "prohibits-commercial-use"}, + {C_FLAGS (GST_TAG_LICENSE_PROHIBITS_HIGH_INCOME_NATION_USE), + "GST_TAG_LICENSE_PROHIBITS_HIGH_INCOME_NATION_USE", + "prohibits-high-income-nation-use"}, + {C_FLAGS (GST_TAG_LICENSE_CREATIVE_COMMONS_LICENSE), + "GST_TAG_LICENSE_CREATIVE_COMMONS_LICENSE", + "creative-commons-license"}, + {C_FLAGS (GST_TAG_LICENSE_FREE_SOFTWARE_FOUNDATION_LICENSE), + "GST_TAG_LICENSE_FREE_SOFTWARE_FOUNDATION_LICENSE", + "free-software-foundation-license"}, + {0, NULL, NULL} + }; + + if (g_once_init_enter (&id)) { + GType tmp = g_flags_register_static ("GstTagLicenseFlags", values); + g_once_init_leave (&id, tmp); + } + + return (GType) id; +} diff --git a/gst-libs/gst/tag/tag.h b/gst-libs/gst/tag/tag.h index 6d70bef565..08ff9421c2 100644 --- a/gst-libs/gst/tag/tag.h +++ b/gst-libs/gst/tag/tag.h @@ -621,6 +621,8 @@ const gchar * gst_tag_get_license_description (const gchar * license_ref) const gchar * gst_tag_get_license_jurisdiction (const gchar * license_ref); +GType gst_tag_license_flags_get_type (void); + G_END_DECLS #endif /* __GST_TAG_TAG_H__ */