After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 646868 - tag: Provide Creative Commons helper functions
tag: Provide Creative Commons helper functions
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other Linux
: Normal enhancement
: 0.10.36
Assigned To: Tim-Philipp Müller
GStreamer Maintainers
Depends on:
Blocks: 347320
 
 
Reported: 2011-04-06 01:32 UTC by Bastien Nocera
Modified: 2011-08-10 09:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2011-04-06 01:32:53 UTC
In the same way that we provide iso-codes helper functions in gst_tag_get_language_*().

liblicense (packaged by most distributions), provides a simple RDF file per license URL.

So one would:
- grab the GST_TAG_LICENSE_URI (eg. http://creativecommons.org/licenses/by/2.5/it/)
- and from it, deduce the RDF filename (eg. creativecommons.org_licenses_by_2.5_it_.rdf) and parse it

And give access to various fields of that file, for example:
- identifier
- translated name
- translated description
- permits, requires and prohibits [1]
- version

from [1] and the identifier, front-ends applications could easily show the "usual" CC icons.
Comment 1 Sebastian Dröge (slomo) 2011-04-06 08:22:39 UTC
Currently no library in gst-plugins-base has additional dependencies other than core, glib and gobject. Not sure if we want to change that.

But such API would be useful, yes
Comment 2 Tim-Philipp Müller 2011-04-06 08:38:53 UTC
> Currently no library in gst-plugins-base has additional dependencies other than
> core, glib and gobject. Not sure if we want to change that.

Don't think so, not for something like this anyway. A soft dependency like iso-codes should be fine though.
Comment 3 Bastien Nocera 2011-04-06 12:22:19 UTC
(In reply to comment #1)
> Currently no library in gst-plugins-base has additional dependencies other than
> core, glib and gobject. Not sure if we want to change that.
> 
> But such API would be useful, yes

I'm not sure I was clear enough. The data files are shipped with liblicense. I don't want GStreamer to use liblicense itself, I want it to use the RDF data files shipped with liblicense. In fact, the whole point is to avoid using liblicense and its crummy API in the first place ;)

Distributions could then split the RDF files into a "liblicense-data" or somesuch.
Comment 4 Sebastian Dröge (slomo) 2011-04-06 12:38:57 UTC
So you want GStreamer to do RDF parsing? Or only pass the raw RDF data to the application if available?
Comment 5 Bastien Nocera 2011-04-06 13:00:51 UTC
(In reply to comment #4)
> So you want GStreamer to do RDF parsing? Or only pass the raw RDF data to the
> application if available?

To do the parsing, like it does iso-codes's XML files.
Comment 6 Tim-Philipp Müller 2011-07-15 09:44:14 UTC
How about API like this:

+/* functions to deal with (mostly) Creative Commons licenses */
+
+/**
+ * GstTagLicenseFlags:
+ * @GST_TAG_LICENSE_FLAG_PERMITS_REPRODUCTION: making multiple copies
+ *     is allowed
+ * @GST_TAG_LICENSE_FLAG_PERMITS_DISTRIBUTION: distribution, public display
+ *     and public performance are allowed
+ * @GST_TAG_LICENSE_FLAG_PERMITS_DERIVATIVE_WORKS: distribution of derivative
+ *     works is allowed
+ * @GST_TAG_LICENSE_FLAG_PERMITS_SHARING: commercial derivatives are allowed,
+ *     but only non-commercial distribution is allowed
+ * @GST_TAG_LICENSE_FLAG_REQUIRES_NOTICE: copyright and license notices
+ *     must be kept intact
+ * @GST_TAG_LICENSE_FLAG_REQUIRES_ATTRIBUTION: credit must be given to
+ *     copyright holder and/or author
+ * @GST_TAG_LICENSE_FLAG_REQUIRES_SHARE_ALIKE: derivative works must be
+ *     licensed under the same terms or compatible terms as the original work
+ * @GST_TAG_LICENSE_FLAG_REQUIRES_SOURCE_CODE: source code (the preferred
+ *     form for making modifications) must be provided when exercising some
+ *     rights granted by the license
+ * @GST_TAG_LICENSE_FLAG_REQUIRES_COPYLEFT: derivative and combined works
+ *     must be licensed under specified terms, similar to those of the original
+ *     work
+ * @GST_TAG_LICENSE_FLAG_REQUIRES_LESSER_COPYLEFT: derivative works must be
+ *     licensed under specified terms, with at least the same conditions as
+ *     the original work; combinations with the work may be licensed under
+ *     different terms
+ * @GST_TAG_LICENSE_FLAG_PROHIBITS_COMMERCIAL_USE: exercising rights for
+ *     commercial purposes is prohibited
+ * @GST_TAG_LICENSE_FLAG_PROHIBITS_HIGH_INCOME_NATION_USE: use in a
+ *     non-developing country is prohibited
+ * @GST_TAG_LICENSE_FLAG_CREATIVE_COMMONS_LICENSE: this license was created
+ *     by the Creative Commons project
+ * @GST_TAG_LICENSE_FLAG_FREE_SOFTWARE_FOUNDATION_LICENSE: this license was
+ *     created by the Free Software Foundation (FSF)
+ *
+ * See http://creativecommons.org/ns for more information.
+ *
+ * Since: 0.10.36
+ */
+/* FIXME: should we have the _FLAG_ bit in the name or not? not is nicer.. */
+typedef enum {
+  GST_TAG_LICENSE_FLAG_PERMITS_REPRODUCTION             = (1 << 0),
+  GST_TAG_LICENSE_FLAG_PERMITS_DISTRIBUTION             = (1 << 1),
+  GST_TAG_LICENSE_FLAG_PERMITS_DERIVATIVE_WORKS         = (1 << 2),
+  GST_TAG_LICENSE_FLAG_PERMITS_SHARING                  = (1 << 3),
+
+  GST_TAG_LICENSE_FLAG_REQUIRES_NOTICE                  = (1 << 8),
+  GST_TAG_LICENSE_FLAG_REQUIRES_ATTRIBUTION             = (1 << 9),
+  GST_TAG_LICENSE_FLAG_REQUIRES_SHARE_ALIKE             = (1 << 10),
+  GST_TAG_LICENSE_FLAG_REQUIRES_SOURCE_CODE             = (1 << 11),
+  GST_TAG_LICENSE_FLAG_REQUIRES_COPYLEFT                = (1 << 12),
+  GST_TAG_LICENSE_FLAG_REQUIRES_LESSER_COPYLEFT         = (1 << 13),
+
+  GST_TAG_LICENSE_FLAG_PROHIBITS_COMMERCIAL_USE         = (1 << 16),
+  GST_TAG_LICENSE_FLAG_PROHIBITS_HIGH_INCOME_NATION_USE = (1 << 17),
+
+  GST_TAG_LICENSE_FLAG_CREATIVE_COMMONS_LICENSE         = (1 << 24),
+  GST_TAG_LICENSE_FLAG_FREE_SOFTWARE_FOUNDATION_LICENSE = (1 << 25)
+} GstTagLicenseFlags;
+
+gchar **            gst_tag_get_licenses (void);
+
+GstTagLicenseFlags  gst_tag_get_license_flags (const gchar * license_ref);
+
+const gchar *       gst_tag_get_license_nick  (const gchar * license_ref);
+
+const gchar *       gst_tag_get_license_title (const gchar * license_ref);
+
+const gchar *       gst_tag_get_license_description (const gchar * license_ref);
+
+const gchar *       gst_tag_get_license_jurisdiction (const gchar * license_ref);
+
Comment 7 Bastien Nocera 2011-07-15 09:55:57 UTC
gst_tag_get_license_version (); missing?

Rest looks good to me.
Comment 8 Tim-Philipp Müller 2011-07-15 10:25:01 UTC
> gst_tag_get_license_version() missing?

I thought about that, but wasn't quite sure what it would be useful for, where/how one would use it. I was planning to add a way to check whether a license is deprecated/obsolete/replaced by a newer version though.

Would you want this to return a string or a version number as float?
Comment 9 Bastien Nocera 2011-07-15 10:35:52 UTC
(In reply to comment #8)
> > gst_tag_get_license_version() missing?
> 
> I thought about that, but wasn't quite sure what it would be useful for,
> where/how one would use it. I was planning to add a way to check whether a
> license is deprecated/obsolete/replaced by a newer version though.

That might be helpful as well.

> Would you want this to return a string or a version number as float?

If there ever was a "2.5.1", say, we'd need it being a string.
Comment 10 Tim-Philipp Müller 2011-08-10 09:46:05 UTC
commit 54e143c5e79ca9e2076d9d7bb22a58fd80da0a27
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Fri Jul 15 13:19:38 2011 +0100

    tag: add unit test for new license API
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646868

commit 25f8f6453ea22cfc8e77575f3899acd952d85c6c
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Fri Jul 15 13:14:16 2011 +0100

    tag: add mklicensestables utility
    
    Add (uninstalled) tool to create licenses-table.dat from liblicense's
    RDF files. It's not very pretty and makes loats of assumptions about
    the input, but should work. If things change, we can fix it then.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646868

commit c4bab487e700d932626d02c3df0bb4fc3b677358
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Fri Jul 15 13:07:55 2011 +0100

    tag: add convenience API to handle creative commons licenses
    
    Based on liblicense's RDF files.
    
    API: GstTagLicenseFlags
    API: gst_tag_get_licenses()
    API: gst_tag_get_license_flags()
    API: gst_tag_get_license_nick()
    API: gst_tag_get_license_title()
    API: gst_tag_get_license_version()
    API: gst_tag_get_license_description()
    API: gst_tag_get_license_jurisdiction()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646868