mlt_properties_get_value( properties, i ) != NULL &&
strcmp( name, "westley" ) != 0 &&
strcmp( name, "in" ) != 0 &&
- strcmp( name, "out" ) != 0 )
+ strcmp( name, "out" ) != 0 &&
+ strcmp( name, "id" ) != 0 &&
+ strcmp( name, "width" ) != 0 &&
+ strcmp( name, "height" ) != 0 )
{
p = xmlNewChild( node, NULL, "property", NULL );
xmlNewProp( p, "name", mlt_properties_get_name( properties, i ) );
}
}
-static inline void serialise_producer_filters( serialise_context context, mlt_service service, xmlNode *node )
+static inline void serialise_service_filters( serialise_context context, mlt_service service, xmlNode *node )
{
int i;
xmlNode *p;
{
// Get a new id - if already allocated, do nothing
char *id = westley_get_id( context, mlt_filter_service( filter ), westley_filter );
- if ( id == NULL )
- continue;
-
- p = xmlNewChild( node, NULL, "filter", NULL );
- xmlNewProp( p, "id", id );
- serialise_properties( properties, p );
+ if ( id != NULL )
+ {
+ p = xmlNewChild( node, NULL, "filter", NULL );
+ xmlNewProp( p, "id", id );
+ serialise_properties( properties, p );
+ serialise_service_filters( context, mlt_filter_service( filter ), p );
+ }
}
}
}
// Set the id
xmlNewProp( child, "id", id );
serialise_properties( properties, child );
- serialise_producer_filters( context, service, child );
+ serialise_service_filters( context, service, child );
// Add producer to the map
mlt_properties_set_int( context->hide_map, id, mlt_properties_get_int( properties, "hide" ) );
static void serialise_multitrack( serialise_context context, mlt_service service, xmlNode *node )
{
int i;
- xmlNode *child = node;
if ( context->pass == 0 )
{
if ( id == NULL )
return;
- // Create the multitrack node
- child = xmlNewChild( node, NULL, "multitrack", NULL );
-
- // Set the id
- xmlNewProp( child, "id", id );
-
// Serialise the tracks
for ( i = 0; i < mlt_multitrack_count( MLT_MULTITRACK( service ) ); i++ )
{
- xmlNode *track = xmlNewChild( child, NULL, "track", NULL );
+ xmlNode *track = xmlNewChild( node, NULL, "track", NULL );
int hide = 0;
mlt_producer producer = mlt_multitrack_track( MLT_MULTITRACK( service ), i );
if ( hide )
xmlNewProp( track, "hide", hide == 1 ? "video" : ( hide == 2 ? "audio" : "both" ) );
}
- serialise_producer_filters( context, service, child );
+ serialise_service_filters( context, service, node );
}
}
+static void serialise_tractor( serialise_context context, mlt_service service, xmlNode *node );
+
static void serialise_playlist( serialise_context context, mlt_service service, xmlNode *node )
{
int i;
{
char *service_s = mlt_properties_get( mlt_producer_properties( info.producer ), "mlt_service" );
char *resource_s = mlt_properties_get( mlt_producer_properties( info.producer ), "resource" );
- if ( service_s != NULL && strcmp( service_s, "blank" ) != 0 )
+ if ( resource_s != NULL && !strcmp( resource_s, "<tractor>" ) )
+ {
+ serialise_tractor( context, MLT_SERVICE( info.producer ), node );
+ context->pass ++;
+ serialise_tractor( context, MLT_SERVICE( info.producer ), node );
+ context->pass --;
+ }
+ else if ( service_s != NULL && strcmp( service_s, "blank" ) != 0 )
serialise_service( context, MLT_SERVICE( info.producer ), node );
else if ( resource_s != NULL && !strcmp( resource_s, "<playlist>" ) )
serialise_playlist( context, MLT_SERVICE( info.producer ), node );
}
}
- serialise_producer_filters( context, service, child );
+ serialise_service_filters( context, service, child );
}
else if ( strcmp( (const char*) node->name, "tractor" ) != 0 )
{
// Recurse on connected producer
serialise_service( context, mlt_service_producer( service ), child );
- serialise_producer_filters( context, service, child );
+ serialise_service_filters( context, service, child );
}
}
xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) );
serialise_properties( properties, child );
+ serialise_service_filters( context, service, child );
}
}
xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) );
serialise_properties( properties, child );
+ serialise_service_filters( context, service, child );
}
}