diff options
author | Dave Robillard <dave@drobilla.net> | 2009-06-22 17:04:00 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-06-22 17:04:00 -0400 |
commit | 218878de5ea48b5acdf36070a73a50fd71f41741 (patch) | |
tree | 12384ce50f1af7eb61c2c18a0d6141595797bc53 /ext | |
parent | 925e83ee60c5406b2e5f0f39b0da0f90370efc27 (diff) | |
parent | a2a0322df9a7005a01aafb5efc32fcc1179d205c (diff) | |
download | gst-plugins-bad-218878de5ea48b5acdf36070a73a50fd71f41741.tar.gz gst-plugins-bad-218878de5ea48b5acdf36070a73a50fd71f41741.tar.bz2 gst-plugins-bad-218878de5ea48b5acdf36070a73a50fd71f41741.zip |
Merge branch 'master' of git://anongit.freedesktop.org/gstreamer/gst-plugins-bad into fdo
Conflicts:
ext/ladspa/Makefile.am
ext/ladspa/gstladspa.h
ext/lv2/Makefile.am
ext/lv2/gstlv2.h
Diffstat (limited to 'ext')
-rw-r--r-- | ext/ladspa/Makefile.am | 10 | ||||
-rw-r--r-- | ext/ladspa/gstladspa.h | 2 | ||||
-rw-r--r-- | ext/lv2/Makefile.am | 10 | ||||
-rw-r--r-- | ext/lv2/gstlv2.h | 2 | ||||
-rw-r--r-- | ext/metadata/metadataexif.c | 27 | ||||
-rw-r--r-- | ext/metadata/metadatatags.c | 12 | ||||
-rw-r--r-- | ext/metadata/metadatatags.h | 4 | ||||
-rw-r--r-- | ext/metadata/metadataxmp.c | 64 |
8 files changed, 100 insertions, 31 deletions
diff --git a/ext/ladspa/Makefile.am b/ext/ladspa/Makefile.am index 00582ed7..23c84f57 100644 --- a/ext/ladspa/Makefile.am +++ b/ext/ladspa/Makefile.am @@ -1,8 +1,14 @@ plugin_LTLIBRARIES = libgstladspa.la libgstladspa_la_SOURCES = gstladspa.c -libgstladspa_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_CFLAGS) $(LRDF_CFLAGS) -libgstladspa_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) $(LIBM) $(LRDF_LIBS) ../../gst-libs/gst/signalprocessor/libgstsignalprocessor.la +libgstladspa_la_CFLAGS = \ + -I$(top_builddir)/gst-libs \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_CONTROLLER_CFLAGS) $(GST_CFLAGS) $(LRDF_CFLAGS) +libgstladspa_la_LIBADD = \ + $(top_builddir)/gst-libs/gst/signalprocessor/libgstsignalprocessor.la \ + $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) \ + $(LIBM) $(LRDF_LIBS) libgstladspa_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstladspa_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/ext/ladspa/gstladspa.h b/ext/ladspa/gstladspa.h index f51d6233..14532318 100644 --- a/ext/ladspa/gstladspa.h +++ b/ext/ladspa/gstladspa.h @@ -28,7 +28,7 @@ #include <gst/gst.h> -#include "../../gst-libs/gst/signalprocessor/gstsignalprocessor.h" +#include <gst/signalprocessor/gstsignalprocessor.h> G_BEGIN_DECLS diff --git a/ext/lv2/Makefile.am b/ext/lv2/Makefile.am index f10c7acf..18fe6481 100644 --- a/ext/lv2/Makefile.am +++ b/ext/lv2/Makefile.am @@ -1,8 +1,14 @@ plugin_LTLIBRARIES = libgstlv2.la libgstlv2_la_SOURCES = gstlv2.c -libgstlv2_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_CFLAGS) $(SLV2_CFLAGS) -libgstlv2_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) $(LIBM) $(SLV2_LIBS) ../../gst-libs/gst/signalprocessor/libgstsignalprocessor.la +libgstlv2_la_CFLAGS = \ + -I$(top_builddir)/gst-libs \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_CONTROLLER_CFLAGS) $(GST_CFLAGS) $(SLV2_CFLAGS) +libgstlv2_la_LIBADD = \ + $(top_builddir)/gst-libs/gst/signalprocessor/libgstsignalprocessor.la \ + $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) \ + $(LIBM) $(SLV2_LIBS) libgstlv2_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstlv2_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/ext/lv2/gstlv2.h b/ext/lv2/gstlv2.h index f76235b4..389c03d1 100644 --- a/ext/lv2/gstlv2.h +++ b/ext/lv2/gstlv2.h @@ -28,7 +28,7 @@ #include <gst/gst.h> -#include "../../gst-libs/gst/signalprocessor/gstsignalprocessor.h" +#include <gst/signalprocessor/gstsignalprocessor.h> G_BEGIN_DECLS diff --git a/ext/metadata/metadataexif.c b/ext/metadata/metadataexif.c index 58d83e2d..0769dab4 100644 --- a/ext/metadata/metadataexif.c +++ b/ext/metadata/metadataexif.c @@ -694,16 +694,16 @@ metadataparse_exif_content_foreach_entry_func (ExifEntry * entry, /* DDD - degrees */ value = (gdouble) rt->numerator / (gdouble) rt->denominator; + GST_DEBUG ("deg: %lu / %lu", rt->numerator, rt->denominator); rt++; /* MM - minutes and SS - seconds */ - if (rt->numerator % rt->denominator) { - value += (gdouble) rt->numerator / (gdouble) rt->denominator; - } else { - value += rt->numerator / rt->denominator; - rt++; - value += rt->numerator / rt->denominator; - } + GST_DEBUG ("min: %lu / %lu", rt->numerator, rt->denominator); + value += (gdouble) rt->numerator / ((gdouble) rt->denominator * 60.0); + rt++; + GST_DEBUG ("sec: %lu / %lu", rt->numerator, rt->denominator); + value += + (gdouble) rt->numerator / ((gdouble) rt->denominator * 3600.0); /* apply sign */ if (entry->tag == EXIF_TAG_GPS_LATITUDE) { @@ -1049,17 +1049,24 @@ metadatamux_exif_for_each_tag_in_list (const GstTagList * list, const ExifTag ref_tag = entry->tag == EXIF_TAG_GPS_LATITUDE ? EXIF_TAG_GPS_LATITUDE_REF : EXIF_TAG_GPS_LONGITUDE_REF; + /* DDD - degrees */ rt->numerator = (gulong) v; rt->denominator = 1; + GST_DEBUG ("deg: %lf : %lu / %lu", v, rt->numerator, rt->denominator); v -= rt->numerator; rt++; - rt->numerator = (gulong) (0.5 + v * 100.0); - rt->denominator = 100; + /* MM - minutes */ + rt->numerator = (gulong) (v * 60.0); + rt->denominator = 1; + GST_DEBUG ("min: %lf : %lu / %lu", v, rt->numerator, rt->denominator); + v -= ((gdouble) rt->numerator / 60.0); rt++; - rt->numerator = 0; + /* SS - seconds */ + rt->numerator = (gulong) (0.5 + v * 3600.0); rt->denominator = 1; + GST_DEBUG ("sec: %lf : %lu / %lu", v, rt->numerator, rt->denominator); if (entry->tag == EXIF_TAG_GPS_LONGITUDE) { GST_DEBUG ("longitude : %lf", value); diff --git a/ext/metadata/metadatatags.c b/ext/metadata/metadatatags.c index 82e6c381..4beee172 100644 --- a/ext/metadata/metadatatags.c +++ b/ext/metadata/metadatatags.c @@ -446,5 +446,17 @@ metadata_tags_iptc_register (void) static void metadata_tags_xmp_register (void) { + gst_tag_register (GST_TAG_XMP_GEO_LOCATION_COUNTRY, GST_TAG_FLAG_META, + G_TYPE_STRING, GST_TAG_XMP_GEO_LOCATION_COUNTRY, + "human readable english country name of where the media has been recorded or produced", + NULL); + gst_tag_register (GST_TAG_XMP_GEO_LOCATION_CITY, GST_TAG_FLAG_META, + G_TYPE_STRING, GST_TAG_XMP_GEO_LOCATION_CITY, + "human readable english city name of where the media has been recorded or produced", + NULL); + gst_tag_register (GST_TAG_XMP_GEO_LOCATION_SUBLOCATION, GST_TAG_FLAG_META, + G_TYPE_STRING, GST_TAG_XMP_GEO_LOCATION_SUBLOCATION, + "human readable location detail of where the media has been recorded or produced", + NULL); } diff --git a/ext/metadata/metadatatags.h b/ext/metadata/metadatatags.h index 8500f15a..4d718738 100644 --- a/ext/metadata/metadatatags.h +++ b/ext/metadata/metadatatags.h @@ -126,6 +126,10 @@ typedef enum { #define GST_TAG_GPS_SPEED "" #define GST_TAG_GPS_TRACK "" +#define GST_TAG_XMP_GEO_LOCATION_COUNTRY "geo-location-country" +#define GST_TAG_XMP_GEO_LOCATION_CITY "geo-location-city" +#define GST_TAG_XMP_GEO_LOCATION_SUBLOCATION "geo-location-sublocation" + /* *INDENT-ON* */ /* diff --git a/ext/metadata/metadataxmp.c b/ext/metadata/metadataxmp.c index 4da279df..5d5bdefa 100644 --- a/ext/metadata/metadataxmp.c +++ b/ext/metadata/metadataxmp.c @@ -155,13 +155,26 @@ typedef struct _tag_SchemaMap #define XMP_SCHEMA_NODE 0x80000000UL /* *INDENT-OFF* */ -/* When changing this table, update 'metadata_mapping.htm' file too. */ +/* When changing these tables, update 'metadata_mapping.htm' file too. */ static const SchemaTagMap schema_map_dublin_tags_map[] = { + {"creator", GST_TAG_ARTIST }, {"description", GST_TAG_DESCRIPTION }, - {"title", GST_TAG_TITLE }, + {"format", GST_TAG_VIDEO_CODEC }, {"rights", GST_TAG_COPYRIGHT }, + {"subject", GST_TAG_KEYWORDS }, + {"title", GST_TAG_TITLE }, {"type", GST_TAG_CODEC }, - {"format", GST_TAG_VIDEO_CODEC }, + {NULL, NULL} +}; + +static const SchemaTagMap schema_map_photoshop_tags_map[] = { + {"country", GST_TAG_XMP_GEO_LOCATION_COUNTRY }, + {"city", GST_TAG_XMP_GEO_LOCATION_CITY }, + {NULL, NULL} +}; + +static const SchemaTagMap schema_map_iptc4xmpcore_tags_map[] = { + {"location", GST_TAG_XMP_GEO_LOCATION_SUBLOCATION }, {NULL, NULL} }; /* *INDENT-ON* */ @@ -173,9 +186,26 @@ static const SchemaMap schema_map_dublin = { schema_map_dublin_tags_map }; -/* When changing this table, update 'metadata_mapping.htm' file too. */ +/* http://www.adobe.com/devnet/xmp/pdfs/xmp_specification.pdf */ +static const SchemaMap schema_map_photoshop = { + "http://ns.adobe.com/photoshop/1.0/", + "photoshop:", + 10, + schema_map_photoshop_tags_map +}; + +/* http://www.iptc.org/std/Iptc4xmpCore/1.0/specification/Iptc4xmpCore_1.0-spec-XMPSchema_8.pdf */ +static const SchemaMap schema_map_iptc4xmpcore = { + "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", + "Iptc4xmpCore:", + 13, + schema_map_iptc4xmpcore_tags_map +}; + static const SchemaMap *schemas_map[] = { &schema_map_dublin, + &schema_map_photoshop, + &schema_map_iptc4xmpcore, NULL }; @@ -474,7 +504,6 @@ metadatamux_xmp_get_tagsmap_from_gsttag (const SchemaMap * schema_map, if (NULL == schema_map) goto done; - for (i = 0; schema_map->tags_map[i].gst_tag; i++) { if (0 == strcmp (schema_map->tags_map[i].gst_tag, tag)) { tags_map = (SchemaTagMap *) & schema_map->tags_map[i]; @@ -567,10 +596,14 @@ void metadataparse_xmp_iter_node_schema (GstTagList * taglist, GstTagMergeMode mode, XmpPtr xmp, const char *schema, const char *path) { - SchemaMap *schema_map = NULL; + const SchemaMap *schema_map = NULL; + gint i; - if (0 == strcmp (schema, "http://purl.org/dc/elements/1.1/")) { - schema_map = (SchemaMap *) & schema_map_dublin; + for (i = 0; schemas_map[i]; i++) { + if (0 == strcmp (schema, schemas_map[i]->schema)) { + schema_map = schemas_map[i]; + break; + } } metadataparse_xmp_iter_array (taglist, mode, xmp, schema, path, schema_map); @@ -805,6 +838,8 @@ metadatamux_xmp_for_each_tag_in_list (const GstTagList * list, XmpPtr xmp = (XmpPtr) user_data; int i; + GST_DEBUG ("trying to map tag '%s' to xmp", tag); + for (i = 0; schemas_map[i]; i++) { /* FIXME: should try to get all of values (index) for the tag */ @@ -814,9 +849,7 @@ metadatamux_xmp_for_each_tag_in_list (const GstTagList * list, metadatamux_xmp_get_tagsmap_from_gsttag (smap, tag); if (stagmap) { - gchar *value = NULL; - GType type = gst_tag_get_type (tag); switch (type) { @@ -827,8 +860,10 @@ metadatamux_xmp_for_each_tag_in_list (const GstTagList * list, break; } - if (value) { + GST_DEBUG ("found mapping for tag '%s' in schema %s", tag, + schemas_map[i]->prefix); + if (value) { uint32_t options = 0; #ifdef XMP_1_99_5 @@ -857,13 +892,12 @@ metadatamux_xmp_for_each_tag_in_list (const GstTagList * list, } g_free (value); - } - + } else { + GST_DEBUG ("no xmp mapping for tag '%s' in schema %s found", tag, + schemas_map[i]->prefix); } - } - } #endif /* else (ifndef HAVE_XMP) */ |