typedef enum
{
- GstXmpTagTypeSimple = 0,
+ GstXmpTagTypeNone = 0,
+ GstXmpTagTypeSimple,
GstXmpTagTypeBag,
GstXmpTagTypeSeq,
GstXmpTagTypeStruct,
const gchar *tag_name;
GstXmpTagType type;
+ /* some tags must be inside a Bag even
+ * if they are a single entry. Set it here so we know */
+ GstXmpTagType supertype;
+
+ /* For tags that need a rdf:parseType attribute */
+ const gchar *parse_type;
+
/* Used for struct and compound types */
GSList *children;
}
static const gchar *
-xmp_tag_get_type_name (XmpTag * xmptag)
+xmp_tag_type_get_name (GstXmpTagType tagtype)
{
- switch (xmptag->type) {
+ switch (tagtype) {
case GstXmpTagTypeSeq:
return "rdf:Seq";
case GstXmpTagTypeBag:
xmpinfo->gst_tag = gst_tag;
xmpinfo->tag_name = xmp_tag;
xmpinfo->type = xmp_type;
+ xmpinfo->supertype = GstXmpTagTypeNone;
+ xmpinfo->parse_type = NULL;
xmpinfo->serialize = serialization_func;
xmpinfo->deserialize = deserialization_func;
xmpinfo->children = NULL;
schema = gst_xmp_schema_new ();
xmpinfo = gst_xmp_tag_create (NULL, "Iptc4xmpExt:LocationShown",
GstXmpTagTypeStruct, NULL, NULL);
+ xmpinfo->supertype = GstXmpTagTypeBag;
+ xmpinfo->parse_type = "Resource";
xmpinfo->children = g_slist_prepend (xmpinfo->children,
gst_xmp_tag_create (GST_TAG_GEO_LOCATION_SUBLOCATION,
"LocationDetails:Sublocation", GstXmpTagTypeSimple, NULL, NULL));
if (use_it) {
if (xmp_tag->tag_name)
string_open_tag (data, xmp_tag->tag_name);
+
+ if (xmp_tag->supertype) {
+ string_open_tag (data, xmp_tag_type_get_name (xmp_tag->supertype));
+ if (xmp_tag->parse_type) {
+ g_string_append (data, "<rdf:li rdf:parseType=\"");
+ g_string_append (data, xmp_tag->parse_type);
+ g_string_append_c (data, '"');
+ g_string_append_c (data, '>');
+ } else {
+ string_open_tag (data, "rdf:li");
+ }
+ }
+
/* now write it */
for (iter = xmp_tag->children; iter; iter = g_slist_next (iter)) {
write_one_tag (list, iter->data, user_data);
}
+
+ if (xmp_tag->supertype) {
+ string_close_tag (data, "rdf:li");
+ string_close_tag (data, xmp_tag_type_get_name (xmp_tag->supertype));
+ }
+
if (xmp_tag->tag_name)
string_close_tag (data, xmp_tag->tag_name);
}
} else {
const gchar *typename;
- typename = xmp_tag_get_type_name (xmp_tag);
+ typename = xmp_tag_type_get_name (xmp_tag->type);
string_open_tag (data, typename);
for (i = 0; i < ct; i++) {