+static void on_start_consumer( deserialise_context context, const xmlChar *name, const xmlChar **atts)
+{
+ if ( context->pass == 1 )
+ {
+ mlt_consumer consumer = mlt_consumer_new( context->profile );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
+
+ mlt_properties_set_lcnumeric( properties, context->lc_numeric );
+ context_push_service( context, MLT_CONSUMER_SERVICE(consumer), mlt_dummy_consumer_type );
+
+ // Set the properties from attributes
+ for ( ; atts != NULL && *atts != NULL; atts += 2 )
+ mlt_properties_set( properties, (const char*) atts[0], (const char*) atts[1] );
+ }
+}
+
+static void on_end_consumer( deserialise_context context, const xmlChar *name )
+{
+ if ( context->pass == 1 )
+ {
+ // Get the consumer from the stack
+ enum service_type type;
+ mlt_service service = context_pop_service( context, &type );
+
+ if ( service && type == mlt_dummy_consumer_type )
+ {
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
+ qualify_property( context, properties, "resource" );
+ char *resource = mlt_properties_get( properties, "resource" );
+
+ // Instantiate the consumer
+ context->consumer = mlt_factory_consumer( context->profile, mlt_properties_get( properties, "mlt_service" ), resource );
+ if ( context->consumer )
+ {
+ // Track this consumer
+ track_service( context->destructors, MLT_CONSUMER_SERVICE(context->consumer), (mlt_destructor) mlt_consumer_close );
+ mlt_properties_set_lcnumeric( MLT_CONSUMER_PROPERTIES(context->consumer), context->lc_numeric );
+
+ // Propogate the properties
+ qualify_property( context, properties, "target" );
+
+ // Inherit the properties
+ mlt_properties_inherit( MLT_CONSUMER_PROPERTIES(context->consumer), properties );
+ }
+ // Close the dummy
+ mlt_service_close( service );
+ }
+ }
+}
+