int pass;
mlt_properties hide_map;
char *root;
+ char *store;
};
typedef struct serialise_context_s* serialise_context;
}
}
+static inline void serialise_store_properties( serialise_context context, mlt_properties properties, xmlNode *node )
+{
+ int i;
+ xmlNode *p;
+
+ // Enumerate the properties
+ for ( i = 0; context->store != NULL && i < mlt_properties_count( properties ); i++ )
+ {
+ char *name = mlt_properties_get_name( properties, i );
+ if ( !strncmp( name, context->store, strlen( context->store ) ) )
+ {
+ char *value = mlt_properties_get_value( properties, i );
+ if ( value != NULL )
+ {
+ p = xmlNewChild( node, NULL, "property", NULL );
+ xmlNewProp( p, "name", mlt_properties_get_name( properties, i ) );
+ if ( context->root != NULL && strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) )
+ xmlNodeSetContent( p, value + strlen( context->root ) + 1 );
+ else
+ xmlNodeSetContent( p, value );
+ }
+ }
+ }
+}
+
static inline void serialise_service_filters( serialise_context context, mlt_service service, xmlNode *node )
{
int i;
// Set the id
xmlNewProp( child, "id", id );
+ // Store application specific properties
+ serialise_store_properties( context, properties, child );
+
// Add producer to the map
mlt_properties_set_int( context->hide_map, id, mlt_properties_get_int( properties, "hide" ) );
xmlNewProp( child, "in", mlt_properties_get( properties, "in" ) );
xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) );
+ // Store application specific properties
+ serialise_store_properties( context, mlt_service_properties( service ), child );
+
// Recurse on connected producer
serialise_service( context, mlt_service_producer( service ), child );
serialise_service_filters( context, service, child );
}
}
-xmlDocPtr westley_make_doc( mlt_service service )
+xmlDocPtr westley_make_doc( mlt_consumer consumer, mlt_service service )
{
mlt_properties properties = mlt_service_properties( service );
xmlDocPtr doc = xmlNewDoc( "1.0" );
context->root = strdup( "" );
}
+ // Assign the additional 'storage' pattern for properties
+ context->store = mlt_properties_get( mlt_consumer_properties( consumer ), "store" );
+
// Assign a title property
if ( mlt_properties_get( properties, "title" ) != NULL )
xmlNewProp( root, "title", mlt_properties_get( properties, "title" ) );
}
// Make the document
- doc = westley_make_doc( service );
+ doc = westley_make_doc( this, service );
// Handle the output
if ( resource == NULL || !strcmp( resource, "" ) )