fezzik now accepts service:resource and strips \'avformat:\' before fallback avformat...
[melted] / src / modules / fezzik / producer_fezzik.c
index c85ecf0..e409afc 100644 (file)
@@ -61,6 +61,8 @@ static mlt_producer create_producer( char *file )
                result = mlt_factory_producer( "pixbuf", file );
        else if ( strstr( file, ".png" ) )
                result = mlt_factory_producer( "pixbuf", file );
+       else if ( strstr( file, ".svg" ) )
+               result = mlt_factory_producer( "pixbuf", file );
        else if ( strstr( file, ".txt" ) )
                result = mlt_factory_producer( "pango", file );
        else if ( strstr( file, ".westley" ) )
@@ -79,11 +81,20 @@ static mlt_producer create_producer( char *file )
 
        // 3rd line fallbacks 
        if ( result == NULL )
-               result = mlt_factory_producer( "avformat", file );
+               result = mlt_factory_producer( "avformat", file + 
+                       ( strncmp( file, "avformat:", 9 ) ? 0 : 9 ) );
 
-       // 4th line fallbacks 
+       // 4th - allow explicit construction
        if ( result == NULL )
-               result = mlt_factory_producer( "ffmpeg", file );
+       {
+               char *arg = strchr( file, ':' );
+               if ( arg )
+               {
+                       arg[0] = 0;
+                       arg++;
+               }
+               result = mlt_factory_producer( file, arg );
+       }
 
        return result;
 }
@@ -108,7 +119,9 @@ static mlt_service create_filter( mlt_tractor tractor, mlt_service last, char *e
 mlt_producer producer_fezzik_init( char *arg )
 {
        // Create the producer that the tractor will contain
-       mlt_producer producer = create_producer( arg );
+       mlt_producer producer = NULL;
+       if ( arg != NULL )
+               producer = create_producer( arg );
 
        // Build the tractor if we have a producer and it isn't already westley'd :-)
        if ( producer != NULL && mlt_properties_get( mlt_producer_properties( producer ), "westley" ) == NULL )
@@ -132,7 +145,9 @@ mlt_producer producer_fezzik_init( char *arg )
                        mlt_properties_set_data( properties, "producer", producer, 0, ( mlt_destructor )mlt_producer_close, NULL );
 
                        // Now attach normalising filters
+                       last = create_filter( tractor, last, "deinterlace" );
                        last = create_filter( tractor, last, "rescale" );
+                       last = create_filter( tractor, last, "resize" );
                        last = create_filter( tractor, last, "resample" );
 
                        // Connect the tractor to the last
@@ -148,6 +163,9 @@ mlt_producer producer_fezzik_init( char *arg )
                        // and fezzik doesn't overdo it with throwing rocks...
                        mlt_properties_set( properties, "westley", "was here" );
 
+                       // We need to ensure that all further properties are mirrored in the producer
+                       mlt_properties_mirror( properties, mlt_producer_properties( producer ) );
+
                        // Now, we return the producer of the tractor
                        producer = mlt_tractor_producer( tractor );
                }
@@ -156,4 +174,3 @@ mlt_producer producer_fezzik_init( char *arg )
        // Return the tractor's producer
        return producer;
 }
-