int type_len = strlen( type );
// Get the properties of the data show filter
- mlt_properties filter_properties = mlt_filter_properties( filter );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
// Get the profile properties
mlt_properties profile_properties = mlt_properties_get_data( filter_properties, "profile_properties", NULL );
// Obtain the profile_properties if we haven't already
if ( profile_properties == NULL )
{
+ char temp[ 512 ];
+
// Get the profile requested
- char *profile = mlt_properties_get( filter_properties, "profile" );
+ char *profile = mlt_properties_get( filter_properties, "resource" );
- // Load the specified profile or use the default
- if ( profile != NULL )
- {
- profile_properties = mlt_properties_load( profile );
- }
+ // If none is specified, pick up the default for this normalisation
+ if ( profile == NULL )
+ sprintf( temp, "%s/feeds/%s/data_fx.properties", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ) );
+ else if ( strchr( profile, '%' ) )
+ sprintf( temp, "%s/feeds/%s/%s", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ), strchr( profile, '%' ) + 1 );
else
- {
- // Sometimes C can be laborious..
- static char *default_file = "/data_fx.properties";
- char *temp = malloc( strlen( mlt_factory_prefix( ) ) + strlen( default_file ) + 1 );
- if ( temp != NULL )
- {
- strcpy( temp, mlt_factory_prefix( ) );
- strcat( temp, default_file );
- profile_properties = mlt_properties_load( temp );
- free( temp );
- }
- }
+ strcpy( temp, profile );
+
+ // Load the specified profile or use the default
+ profile_properties = mlt_properties_load( temp );
// Store for later retrieval
mlt_properties_set_data( filter_properties, "profile_properties", profile_properties, 0, ( mlt_destructor )mlt_properties_close, NULL );
if ( result == NULL && !strcmp( name, type ) && result == NULL )
result = mlt_factory_filter( value, NULL );
else if ( result != NULL && !strncmp( name, type, type_len ) && name[ type_len ] == '.' )
- mlt_properties_set( mlt_filter_properties( result ), name + type_len + 1, value );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( result ), name + type_len + 1, value );
else if ( result != NULL )
break;
}
int error = 1;
// Get the properties of the data show filter
- mlt_properties filter_properties = mlt_filter_properties( filter );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
// Get the type requested by the feeding filter
char *type = mlt_properties_get( feed, "type" );
// Fetch the filter associated to this type
mlt_filter requested = mlt_properties_get_data( filter_properties, type, NULL );
- // Calculate the length of the feed
- int length = mlt_properties_get_int( feed, "out" ) - mlt_properties_get_int( feed, "in" ) + 1;
-
// If it doesn't exist, then create it now
if ( requested == NULL )
{
if ( requested != NULL )
{
int i = 0;
- mlt_properties properties = mlt_filter_properties( requested );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( requested );
static char *prefix = "properties.";
int len = strlen( prefix );
+ // Determine if this is an absolute or relative feed
+ int absolute = mlt_properties_get_int( feed, "absolute" );
+
+ // Make do with what we have
+ int length = !absolute ?
+ mlt_properties_get_int( feed, "out" ) - mlt_properties_get_int( feed, "in" ) + 1 :
+ mlt_properties_get_int( feed, "out" ) + 1;
+
+ // Repeat period
+ int period = mlt_properties_get_int( properties, "period" );
+ period = period == 0 ? 1 : period;
+
// Pass properties from feed into requested
for ( i = 0; i < mlt_properties_count( properties ); i ++ )
{
{
if ( !strncmp( name + len, "length[", 7 ) )
{
- int period = mlt_properties_get_int( properties, "period" );
- period = period == 0 ? 1 : period;
- mlt_properties_set_position( properties, key, length / period );
+ mlt_properties_set_position( properties, key, ( length - period ) / period );
}
else
{
}
// Set the original position on the frame
- mlt_frame_set_position( frame, mlt_properties_get_int( feed, "position" ) - mlt_properties_get_int( feed, "in" ) );
+ if ( absolute == 0 )
+ mlt_frame_set_position( frame, mlt_properties_get_int( feed, "position" ) - mlt_properties_get_int( feed, "in" ) );
+ else
+ mlt_frame_set_position( frame, mlt_properties_get_int( feed, "position" ) );
// Process the filter
mlt_filter_process( requested, frame );
return error;
}
+void process_queue( mlt_deque data_queue, mlt_frame frame, mlt_filter filter )
+{
+ if ( data_queue != NULL )
+ {
+ // Create a new queue for those that we can't handle
+ mlt_deque temp_queue = mlt_deque_init( );
+
+ // Iterate through each entry on the queue
+ while ( mlt_deque_peek_front( data_queue ) != NULL )
+ {
+ // Get the data feed
+ mlt_properties feed = mlt_deque_pop_front( data_queue );
+
+ if ( mlt_properties_get( MLT_FILTER_PROPERTIES( filter ), "debug" ) != NULL )
+ mlt_properties_debug( feed, mlt_properties_get( MLT_FILTER_PROPERTIES( filter ), "debug" ), stderr );
+
+ // Process the data feed...
+ if ( process_feed( feed, filter, frame ) == 0 )
+ mlt_properties_close( feed );
+ else
+ mlt_deque_push_back( temp_queue, feed );
+ }
+
+ // Now put the unprocessed feeds back on the stack
+ while ( mlt_deque_peek_front( temp_queue ) )
+ {
+ // Get the data feed
+ mlt_properties feed = mlt_deque_pop_front( temp_queue );
+
+ // Put it back on the data queue
+ mlt_deque_push_back( data_queue, feed );
+ }
+
+ // Close the temporary queue
+ mlt_deque_close( temp_queue );
+ }
+}
+
/** Get the image.
*/
mlt_filter filter = mlt_frame_pop_service( frame );
// Get the frame properties
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
- // Fetch the data queue
- mlt_deque data_queue = mlt_properties_get_data( frame_properties, "data_queue", NULL );
+ // Track specific
+ process_queue( mlt_properties_get_data( frame_properties, "data_queue", NULL ), frame, filter );
- // Iterate through each entry on the queue
- while ( data_queue != NULL && mlt_deque_peek_front( data_queue ) != NULL )
- {
- // Get the data feed
- mlt_properties feed = mlt_deque_pop_front( data_queue );
-
- // Process the data feed...
- process_feed( feed, filter, frame );
-
- // Close the feed
- mlt_properties_close( feed );
- }
+ // Global
+ process_queue( mlt_properties_get_data( frame_properties, "global_queue", NULL ), frame, filter );
// Need to get the image
return mlt_frame_get_image( frame, image, format, width, height, 1 );
if ( this != NULL )
{
// Get the properties
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Assign the argument (default to titles)
- mlt_properties_set( properties, "profile", arg == NULL ? NULL : arg );
+ mlt_properties_set( properties, "resource", arg == NULL ? NULL : arg );
// Specify the processing method
this->process = filter_process;