]> git.sesse.net Git - mlt/commitdiff
Add service metadata to xml module (WIP).
authorDan Dennedy <dan@dennedy.org>
Mon, 30 May 2011 18:58:24 +0000 (11:58 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 30 May 2011 18:58:24 +0000 (11:58 -0700)
src/modules/xml/Makefile
src/modules/xml/consumer_xml.yml [new file with mode: 0644]
src/modules/xml/factory.c
src/modules/xml/producer_xml-string.yml [new file with mode: 0644]
src/modules/xml/producer_xml.yml [new file with mode: 0644]

index cdc0b1fbbc3ff52dd34d47fa6a65c855e16eefc9..8f2a431481d5a722924003890eb57040e722e1bc 100644 (file)
@@ -34,6 +34,7 @@ install: all
        install -m 755 $(TARGET) "$(DESTDIR)$(libdir)/mlt"
        install -d "$(DESTDIR)$(datadir)/mlt/xml"
        install -m 644 mlt-xml.dtd "$(DESTDIR)$(datadir)/mlt/xml"
+       install -m 644 *.yml "$(DESTDIR)$(datadir)/mlt/xml"
 
 ifneq ($(wildcard .depend),)
 include .depend
diff --git a/src/modules/xml/consumer_xml.yml b/src/modules/xml/consumer_xml.yml
new file mode 100644 (file)
index 0000000..1047b20
--- /dev/null
@@ -0,0 +1,12 @@
+schema_version: 0.1
+type: consumer
+identifier: xml
+title: XML
+version: 1
+copyright: Ushodaya Enterprises Limited
+creator: Dan Dennedy
+license: LGPLv2.1
+language: en
+tags:
+  - Audio
+  - Video
index 9de62282679526d0fff42f2c66d737152b63c1ed..5854adbbf94cf7290ab0c9859b63596bb6abecf2 100644 (file)
  */
 
 #include <string.h>
+#include <limits.h>
 #include <framework/mlt.h>
 
 extern mlt_consumer consumer_xml_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_producer producer_xml_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
+static mlt_properties metadata( mlt_service_type type, const char *id, void *data )
+{
+       char file[ PATH_MAX ];
+       snprintf( file, PATH_MAX, "%s/xml/%s", mlt_environment( "MLT_DATA" ), (char*) data );
+       return mlt_properties_parse_yaml( file );
+}
+
 MLT_REPOSITORY
 {
        MLT_REGISTER( consumer_type, "xml", consumer_xml_init );
        MLT_REGISTER( producer_type, "xml", producer_xml_init );
        MLT_REGISTER( producer_type, "xml-string", producer_xml_init );
+
+       MLT_REGISTER_METADATA( consumer_type, "xml", metadata, "consumer_xml.yml" );
+       MLT_REGISTER_METADATA( producer_type, "xml", metadata, "producer_xml.yml" );
+       MLT_REGISTER_METADATA( producer_type, "xml-string", metadata, "producer_xml-string.yml" );
 }
diff --git a/src/modules/xml/producer_xml-string.yml b/src/modules/xml/producer_xml-string.yml
new file mode 100644 (file)
index 0000000..8e0010e
--- /dev/null
@@ -0,0 +1,12 @@
+schema_version: 0.1
+type: producer
+identifier: xml-string
+title: XML String
+version: 1
+copyright: Ushodaya Enterprises Limited
+creator: Dan Dennedy
+license: LGPLv2.1
+language: en
+tags:
+  - Audio
+  - Video
diff --git a/src/modules/xml/producer_xml.yml b/src/modules/xml/producer_xml.yml
new file mode 100644 (file)
index 0000000..ab824d0
--- /dev/null
@@ -0,0 +1,12 @@
+schema_version: 0.1
+type: producer
+identifier: xml
+title: XML File
+version: 1
+copyright: Ushodaya Enterprises Limited
+creator: Dan Dennedy
+license: LGPLv2.1
+language: en
+tags:
+  - Audio
+  - Video