]> git.sesse.net Git - mlt/commitdiff
framework: remove global profile, rather share one mlt_profile across a service netwo...
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 2 Feb 2008 06:07:30 +0000 (06:07 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 2 Feb 2008 06:07:30 +0000 (06:07 +0000)
miracle, valerie: profile changes
inigo: added -profile and progress=1 to mimic kdenlive_renderer
modules: profile changes. Since nearly every file was touched, remove superfluous headers and prepare for coming mlt_repository change.

git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1051 d19143bc-622f-0410-bfdd-b5b2a6649095

193 files changed:
src/framework/mlt_consumer.c
src/framework/mlt_consumer.h
src/framework/mlt_factory.c
src/framework/mlt_factory.h
src/framework/mlt_filter.c
src/framework/mlt_frame.c
src/framework/mlt_frame.h
src/framework/mlt_geometry.c
src/framework/mlt_multitrack.c
src/framework/mlt_playlist.c
src/framework/mlt_producer.c
src/framework/mlt_profile.c
src/framework/mlt_profile.h
src/framework/mlt_repository.c
src/framework/mlt_repository.h
src/framework/mlt_service.c
src/framework/mlt_service.h
src/framework/mlt_tractor.c
src/inigo/inigo.c
src/miracle/miracle_connection.c
src/miracle/miracle_unit.c
src/miracle/miracle_unit_commands.c
src/modules/avformat/consumer_avformat.c
src/modules/avformat/consumer_avformat.h [deleted file]
src/modules/avformat/factory.c
src/modules/avformat/filter_avcolour_space.c
src/modules/avformat/filter_avcolour_space.h [deleted file]
src/modules/avformat/filter_avdeinterlace.c
src/modules/avformat/filter_avdeinterlace.h [deleted file]
src/modules/avformat/filter_avresample.c
src/modules/avformat/filter_avresample.h [deleted file]
src/modules/avformat/producer_avformat.c
src/modules/avformat/producer_avformat.h [deleted file]
src/modules/core/consumer_null.c
src/modules/core/consumer_null.h [deleted file]
src/modules/core/factory.c
src/modules/core/filter_brightness.c
src/modules/core/filter_brightness.h [deleted file]
src/modules/core/filter_channelcopy.c
src/modules/core/filter_channelcopy.h [deleted file]
src/modules/core/filter_data.h [deleted file]
src/modules/core/filter_data_feed.c
src/modules/core/filter_data_show.c
src/modules/core/filter_gamma.c
src/modules/core/filter_gamma.h [deleted file]
src/modules/core/filter_greyscale.c
src/modules/core/filter_greyscale.h [deleted file]
src/modules/core/filter_luma.c
src/modules/core/filter_luma.h [deleted file]
src/modules/core/filter_mirror.c
src/modules/core/filter_mirror.h [deleted file]
src/modules/core/filter_mono.c
src/modules/core/filter_mono.h [deleted file]
src/modules/core/filter_obscure.c
src/modules/core/filter_obscure.h [deleted file]
src/modules/core/filter_region.c
src/modules/core/filter_region.h [deleted file]
src/modules/core/filter_rescale.c
src/modules/core/filter_rescale.h [deleted file]
src/modules/core/filter_resize.c
src/modules/core/filter_resize.h [deleted file]
src/modules/core/filter_transition.c
src/modules/core/filter_transition.h [deleted file]
src/modules/core/filter_watermark.c
src/modules/core/filter_watermark.h [deleted file]
src/modules/core/producer_colour.c
src/modules/core/producer_colour.h [deleted file]
src/modules/core/producer_noise.c
src/modules/core/producer_noise.h [deleted file]
src/modules/core/producer_ppm.c
src/modules/core/producer_ppm.h [deleted file]
src/modules/core/transition_composite.c
src/modules/core/transition_composite.h
src/modules/core/transition_luma.c
src/modules/core/transition_luma.h [deleted file]
src/modules/core/transition_mix.c
src/modules/core/transition_mix.h [deleted file]
src/modules/core/transition_region.c
src/modules/core/transition_region.h
src/modules/dv/consumer_libdv.c
src/modules/dv/consumer_libdv.h [deleted file]
src/modules/dv/factory.c
src/modules/dv/producer_libdv.c
src/modules/dv/producer_libdv.h [deleted file]
src/modules/effectv/factory.c
src/modules/effectv/filter_burn.c
src/modules/effectv/filter_burn.h [deleted file]
src/modules/fezzik/factory.c
src/modules/fezzik/producer_fezzik.c
src/modules/fezzik/producer_fezzik.h [deleted file]
src/modules/fezzik/producer_hold.c
src/modules/fezzik/producer_hold.h [deleted file]
src/modules/gtk2/consumer_gtk2.c
src/modules/gtk2/consumer_gtk2.h [deleted file]
src/modules/gtk2/factory.c
src/modules/gtk2/filter_rescale.c
src/modules/gtk2/filter_rescale.h [deleted file]
src/modules/gtk2/producer_pango.c
src/modules/gtk2/producer_pango.h [deleted file]
src/modules/gtk2/producer_pixbuf.c
src/modules/gtk2/producer_pixbuf.h [deleted file]
src/modules/inigo/factory.c
src/modules/inigo/producer_inigo.c
src/modules/inigo/producer_inigo.h [deleted file]
src/modules/jackrack/factory.c
src/modules/jackrack/filter_jackrack.c
src/modules/jackrack/filter_jackrack.h [deleted file]
src/modules/jackrack/filter_ladspa.c
src/modules/jackrack/filter_ladspa.h [deleted file]
src/modules/kdenlive/factory.c
src/modules/kdenlive/filter_boxblur.c
src/modules/kdenlive/filter_boxblur.h [deleted file]
src/modules/kdenlive/filter_wave.c
src/modules/kdenlive/filter_wave.h [deleted file]
src/modules/kdenlive/producer_framebuffer.c
src/modules/kdenlive/producer_framebuffer.h [deleted file]
src/modules/kino/factory.c
src/modules/kino/producer_kino.c
src/modules/kino/producer_kino.h [deleted file]
src/modules/motion_est/factory.c
src/modules/motion_est/filter_autotrack_rectangle.c
src/modules/motion_est/filter_crop_detect.c
src/modules/motion_est/filter_motion_est.c
src/modules/motion_est/filter_motion_est.h
src/modules/motion_est/filter_vismv.c
src/modules/motion_est/producer_slowmotion.c
src/modules/normalize/factory.c
src/modules/normalize/filter_volume.c
src/modules/normalize/filter_volume.h [deleted file]
src/modules/oldfilm/factory.c
src/modules/oldfilm/filter_dust.c
src/modules/oldfilm/filter_dust.h [deleted file]
src/modules/oldfilm/filter_grain.c
src/modules/oldfilm/filter_grain.h [deleted file]
src/modules/oldfilm/filter_lines.c
src/modules/oldfilm/filter_lines.h [deleted file]
src/modules/oldfilm/filter_oldfilm.c
src/modules/oldfilm/filter_oldfilm.h [deleted file]
src/modules/plus/factory.c
src/modules/plus/filter_affine.c
src/modules/plus/filter_affine.h [deleted file]
src/modules/plus/filter_charcoal.c
src/modules/plus/filter_charcoal.h [deleted file]
src/modules/plus/filter_invert.c
src/modules/plus/filter_invert.h [deleted file]
src/modules/plus/filter_sepia.c
src/modules/plus/filter_sepia.h [deleted file]
src/modules/plus/transition_affine.c
src/modules/plus/transition_affine.h [deleted file]
src/modules/qimage/factory.c
src/modules/qimage/producer_qimage.c
src/modules/qimage/producer_qimage.h [deleted file]
src/modules/qimage/qimage_wrapper.cpp
src/modules/resample/factory.c
src/modules/resample/filter_resample.c
src/modules/resample/filter_resample.h [deleted file]
src/modules/sdl/consumer_sdl.c
src/modules/sdl/consumer_sdl.h [deleted file]
src/modules/sdl/consumer_sdl_preview.c
src/modules/sdl/consumer_sdl_still.c
src/modules/sdl/factory.c
src/modules/sdl/producer_sdl_image.c
src/modules/sdl/producer_sdl_image.h [deleted file]
src/modules/sox/configure
src/modules/sox/factory.c
src/modules/sox/filter_sox.c
src/modules/sox/filter_sox.h [deleted file]
src/modules/valerie/consumer_valerie.c
src/modules/valerie/consumer_valerie.h [deleted file]
src/modules/valerie/factory.c
src/modules/vmfx/factory.c
src/modules/vmfx/filter_chroma.c
src/modules/vmfx/filter_chroma.h [deleted file]
src/modules/vmfx/filter_chroma_hold.c
src/modules/vmfx/filter_chroma_hold.h [deleted file]
src/modules/vmfx/filter_mono.c
src/modules/vmfx/filter_mono.h [deleted file]
src/modules/vmfx/filter_shape.c
src/modules/vmfx/filter_shape.h [deleted file]
src/modules/vmfx/producer_pgm.c
src/modules/vmfx/producer_pgm.h [deleted file]
src/modules/vorbis/factory.c
src/modules/vorbis/producer_vorbis.c
src/modules/vorbis/producer_vorbis.h [deleted file]
src/modules/westley/consumer_westley.c
src/modules/westley/consumer_westley.h [deleted file]
src/modules/westley/factory.c
src/modules/westley/producer_westley.c
src/modules/westley/producer_westley.h [deleted file]
src/modules/xine/factory.c
src/modules/xine/filter_deinterlace.c
src/modules/xine/filter_deinterlace.h [deleted file]
src/valerie/valerie_remote.c

index eb7254037ac809bba33ffcd125aab9c1c5aebb2d..04b37618b023175956f9351db1c1be7300123749 100644 (file)
 static void mlt_consumer_frame_render( mlt_listener listener, mlt_properties owner, mlt_service this, void **args );
 static void mlt_consumer_frame_show( mlt_listener listener, mlt_properties owner, mlt_service this, void **args );
 static void mlt_consumer_property_changed( mlt_service owner, mlt_consumer this, char *name );
-static void apply_profile_properties( mlt_profile profile, mlt_properties properties );
-
-static mlt_event g_event_listener = NULL;
+static void apply_profile_properties( mlt_consumer this, mlt_profile profile, mlt_properties properties );
 
 /** Public final methods
 */
 
-int mlt_consumer_init( mlt_consumer this, void *child )
+int mlt_consumer_init( mlt_consumer this, void *child, mlt_profile profile )
 {
        int error = 0;
        memset( this, 0, sizeof( struct mlt_consumer_s ) );
@@ -51,8 +49,16 @@ int mlt_consumer_init( mlt_consumer this, void *child )
                // Get the properties from the service
                mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent );
        
-               // Apply the profile to properties for legacy integration
-               apply_profile_properties( mlt_profile_get(), properties );
+               // Apply profile to properties
+               if ( profile == NULL )
+               {
+                       // Normally the application creates the profile and controls its lifetime
+                       // This is the fallback exception handling
+                       profile = mlt_profile_init( NULL );
+                       mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
+                       mlt_properties_set_data( properties, "_profile", profile, 0, (mlt_destructor)mlt_profile_close, NULL );
+               }
+               apply_profile_properties( this, profile, properties );
 
                // Default rescaler for all consumers
                mlt_properties_set( properties, "rescale", "bilinear" );
@@ -79,7 +85,7 @@ int mlt_consumer_init( mlt_consumer this, void *child )
 
                // Register a property-changed listener to handle the profile property -
                // subsequent properties can override the profile
-               g_event_listener = mlt_events_listen( properties, this, "property-changed", ( mlt_listener )mlt_consumer_property_changed );
+               this->event_listener = mlt_events_listen( properties, this, "property-changed", ( mlt_listener )mlt_consumer_property_changed );
 
                // Create the push mutex and condition
                pthread_mutex_init( &this->put_mutex, NULL );
@@ -89,9 +95,9 @@ int mlt_consumer_init( mlt_consumer this, void *child )
        return error;
 }
 
-static void apply_profile_properties( mlt_profile profile, mlt_properties properties )
+static void apply_profile_properties( mlt_consumer this, mlt_profile profile, mlt_properties properties )
 {
-       mlt_event_block( g_event_listener );
+       mlt_event_block( this->event_listener );
        mlt_properties_set_double( properties, "fps", mlt_profile_fps( profile ) );
        mlt_properties_set_int( properties, "frame_rate_num", profile->frame_rate_num );
        mlt_properties_set_int( properties, "frame_rate_den", profile->frame_rate_den );
@@ -104,7 +110,7 @@ static void apply_profile_properties( mlt_profile profile, mlt_properties proper
        mlt_properties_set_double( properties, "display_ratio", mlt_profile_dar( profile )  );
        mlt_properties_set_int( properties, "display_aspect_num", profile->display_aspect_num );
        mlt_properties_set_int( properties, "display_aspect_num", profile->display_aspect_num );
-       mlt_event_unblock( g_event_listener );
+       mlt_event_unblock( this->event_listener );
 }
 
 static void mlt_consumer_property_changed( mlt_service owner, mlt_consumer this, char *name )
@@ -114,62 +120,107 @@ static void mlt_consumer_property_changed( mlt_service owner, mlt_consumer this,
                // Get the properies
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
 
-               // Locate the profile
-               mlt_profile_select( mlt_properties_get( properties, "profile" ) );
+               // Get the current profile
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
 
-               // Apply to properties
-               apply_profile_properties( mlt_profile_get(), properties );
-       }
+               // Load the new profile
+               mlt_profile new_profile = mlt_profile_init( mlt_properties_get( properties, name ) );
+
+               if ( new_profile )
+               {
+                       // Copy the profile
+                       if ( profile != NULL )
+                       {
+                               free( profile->description );
+                               memcpy( profile, new_profile, sizeof( struct mlt_profile_s ) );
+                               profile->description = strdup( new_profile->description );
+                               mlt_profile_close( new_profile );
+                       }
+                       else
+                       {
+                               profile = new_profile;
+                       }
+
+                       // Apply to properties
+                       apply_profile_properties( this, profile, properties );
+               }
+       }
        else if ( !strcmp( name, "frame_rate_num" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->frame_rate_num = mlt_properties_get_int( properties, "frame_rate_num" );
-               mlt_properties_set_double( properties, "fps", mlt_profile_fps( NULL ) );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               if ( profile )
+               {
+                       profile->frame_rate_num = mlt_properties_get_int( properties, "frame_rate_num" );
+                       mlt_properties_set_double( properties, "fps", mlt_profile_fps( profile ) );
+               }
        }
        else if ( !strcmp( name, "frame_rate_den" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->frame_rate_den = mlt_properties_get_int( properties, "frame_rate_den" );
-               mlt_properties_set_double( properties, "fps", mlt_profile_fps( NULL ) );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               if ( profile )
+               {
+                       profile->frame_rate_den = mlt_properties_get_int( properties, "frame_rate_den" );
+                       mlt_properties_set_double( properties, "fps", mlt_profile_fps( profile ) );
+               }
        }
        else if ( !strcmp( name, "width" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->width = mlt_properties_get_int( properties, "width" );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               if ( profile )
+                       profile->width = mlt_properties_get_int( properties, "width" );
        }
        else if ( !strcmp( name, "height" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->height = mlt_properties_get_int( properties, "height" );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               if ( profile )
+                       profile->height = mlt_properties_get_int( properties, "height" );
        }
        else if ( !strcmp( name, "progressive" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->progressive = mlt_properties_get_int( properties, "progressive" );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               if ( profile )
+                       profile->progressive = mlt_properties_get_int( properties, "progressive" );
        }
        else if ( !strcmp( name, "sample_aspect_num" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->sample_aspect_num = mlt_properties_get_int( properties, "sample_aspect_num" );
-               mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( NULL )  );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               profile->sample_aspect_num = mlt_properties_get_int( properties, "sample_aspect_num" );
+               if ( profile )
+                       mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( profile )  );
        }
        else if ( !strcmp( name, "sample_aspect_den" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->sample_aspect_den = mlt_properties_get_int( properties, "sample_aspect_den" );
-               mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( NULL )  );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               profile->sample_aspect_den = mlt_properties_get_int( properties, "sample_aspect_den" );
+               if ( profile )
+                       mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( profile )  );
        }
        else if ( !strcmp( name, "display_aspect_num" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->display_aspect_num = mlt_properties_get_int( properties, "display_aspect_num" );
-               mlt_properties_set_double( properties, "display_ratio", mlt_profile_dar( NULL )  );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               if ( profile )
+               {
+                       profile->display_aspect_num = mlt_properties_get_int( properties, "display_aspect_num" );
+                       mlt_properties_set_double( properties, "display_ratio", mlt_profile_dar( profile )  );
+               }
        }
        else if ( !strcmp( name, "display_aspect_den" ) )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
-               mlt_profile_get()->display_aspect_den = mlt_properties_get_int( properties, "display_aspect_den" );
-               mlt_properties_set_double( properties, "display_ratio", mlt_profile_dar( NULL )  );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+               if ( profile )
+               {
+                       profile->display_aspect_den = mlt_properties_get_int( properties, "display_aspect_den" );
+                       mlt_properties_set_double( properties, "display_ratio", mlt_profile_dar( profile )  );
+               }
        }
 }
 
@@ -188,14 +239,14 @@ static void mlt_consumer_frame_render( mlt_listener listener, mlt_properties own
 /** Create a new consumer.
 */
 
-mlt_consumer mlt_consumer_new( )
+mlt_consumer mlt_consumer_new( mlt_profile profile )
 {
        // Create the memory for the structure
        mlt_consumer this = malloc( sizeof( struct mlt_consumer_s ) );
 
        // Initialise it
        if ( this != NULL )
-               mlt_consumer_init( this, NULL );
+               mlt_consumer_init( this, NULL, profile );
 
        // Return it
        return this;
@@ -231,7 +282,7 @@ int mlt_consumer_connect( mlt_consumer this, mlt_service producer )
 int mlt_consumer_start( mlt_consumer this )
 {
        // Stop listening to the property-changed event
-       mlt_event_block( g_event_listener );
+       mlt_event_block( this->event_listener );
 
        // Get the properies
        mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
@@ -250,7 +301,8 @@ int mlt_consumer_start( mlt_consumer this )
                if ( mlt_properties_get_data( properties, "test_card_producer", NULL ) == NULL )
                {
                        // Create a test card producer
-                       mlt_producer producer = mlt_factory_producer( NULL, test_card );
+                       mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( this ) );
+                       mlt_producer producer = mlt_factory_producer( profile, NULL, test_card );
 
                        // Do we have a producer
                        if ( producer != NULL )
@@ -363,7 +415,7 @@ mlt_frame mlt_consumer_get_frame( mlt_consumer this )
        }
        else
        {
-               frame = mlt_frame_init( );
+               frame = mlt_frame_init( service );
        }
 
        if ( frame != NULL )
@@ -400,20 +452,6 @@ static inline long time_difference( struct timeval *time1 )
        return time1->tv_sec * 1000000 + time1->tv_usec - time2.tv_sec * 1000000 - time2.tv_usec;
 }
 
-int mlt_consumer_profile( mlt_properties properties, char *profile )
-{
-       mlt_profile p = mlt_profile_select( profile );
-       if ( p )
-       {
-               apply_profile_properties( p, properties );
-               return 1;
-       }
-       else
-       {
-               return 0;
-       }
-}
-
 static void *consumer_read_ahead_thread( void *arg )
 {
        // The argument is the consumer
@@ -711,7 +749,7 @@ void mlt_consumer_stopped( mlt_consumer this )
 {
        mlt_properties_set_int( MLT_CONSUMER_PROPERTIES( this ), "running", 0 );
        mlt_events_fire( MLT_CONSUMER_PROPERTIES( this ), "consumer-stopped", NULL );
-       mlt_event_unblock( g_event_listener );
+       mlt_event_unblock( this->event_listener );
 }
 
 /** Stop the consumer.
index f39fd9a5affc06272029e40d5b3eb6e0ea04fc03..e33eb1ede865bfa8b132fbe4c835161db53f448d 100644 (file)
@@ -22,6 +22,7 @@
 #define _MLT_CONSUMER_H_
 
 #include "mlt_service.h"
+#include "mlt_events.h"
 #include <pthread.h>
 
 /** The interface definition for all consumers.
@@ -53,6 +54,7 @@ struct mlt_consumer_s
        pthread_cond_t put_cond;
        mlt_frame put;
        int put_active;
+       mlt_event event_listener;
 };
 
 /** Public final methods
@@ -61,8 +63,8 @@ struct mlt_consumer_s
 #define MLT_CONSUMER_SERVICE( consumer )       ( &( consumer )->parent )
 #define MLT_CONSUMER_PROPERTIES( consumer )    MLT_SERVICE_PROPERTIES( MLT_CONSUMER_SERVICE( consumer ) )
 
-extern int mlt_consumer_init( mlt_consumer self, void *child );
-extern mlt_consumer mlt_consumer_new( );
+extern int mlt_consumer_init( mlt_consumer self, void *child, mlt_profile profile );
+extern mlt_consumer mlt_consumer_new( mlt_profile profile );
 extern mlt_service mlt_consumer_service( mlt_consumer self );
 extern mlt_properties mlt_consumer_properties( mlt_consumer self );
 extern int mlt_consumer_connect( mlt_consumer self, mlt_service producer );
@@ -75,6 +77,5 @@ extern int mlt_consumer_stop( mlt_consumer self );
 extern int mlt_consumer_is_stopped( mlt_consumer self );
 extern void mlt_consumer_stopped( mlt_consumer self );
 extern void mlt_consumer_close( mlt_consumer );
-extern int mlt_consumer_profile( mlt_properties properties, char *profile );
 
 #endif
index 3d7759c5c22deccaeeeb576f54e1d332d50326d8..cd19b158df71a1af3e8a2ad83744fe032ab94953 100644 (file)
@@ -112,16 +112,6 @@ int mlt_factory_init( const char *prefix )
                mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" );
                mlt_properties_set( global_properties, "MLT_TEST_CARD", getenv( "MLT_TEST_CARD" ) );
                mlt_properties_set_or_default( global_properties, "MLT_PROFILE", getenv( "MLT_PROFILE" ), "dv_pal" );
-
-               // Load the most appropriate profile
-               // MLT_PROFILE preferred
-               if ( getenv( "MLT_PROFILE" ) )
-                       mlt_profile_select( mlt_environment( "MLT_PROFILE" ) );
-               // MLT_NORMALISATION backwards compatibility
-               else if ( strcmp( mlt_environment( "MLT_NORMALISATION" ), "PAL" ) )
-                       mlt_profile_select( "dv_ntsc" );
-               else
-                       mlt_profile_select( "dv_pal" );
        }
 
 
@@ -160,10 +150,20 @@ int mlt_environment_set( const char *name, const char *value )
        return mlt_properties_set( global_properties, name, value );
 }
 
+static void set_common_properties( mlt_properties properties, mlt_profile profile, const char *type, const char *service )
+{
+       mlt_properties_set_int( properties, "_unique_id", ++ unique_id );
+       mlt_properties_set( properties, "mlt_type", type );
+       if ( mlt_properties_get_int( properties, "_mlt_service_hidden" ) == 0 )
+               mlt_properties_set( properties, "mlt_service", service );
+       if ( profile != NULL )
+               mlt_properties_set_data( properties, "_profile", profile, 0, NULL, NULL );
+}
+
 /** Fetch a producer from the repository.
 */
 
-mlt_producer mlt_factory_producer( const char *service, void *input )
+mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, void *input )
 {
        mlt_producer obj = NULL;
 
@@ -177,15 +177,12 @@ mlt_producer mlt_factory_producer( const char *service, void *input )
        // Try to instantiate via the specified service
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( producers, service, input );
+               obj = mlt_repository_fetch( producers, profile, producer_type, service, input );
                mlt_events_fire( event_object, "producer-create-done", service, input, obj, NULL );
                if ( obj != NULL )
                {
                        mlt_properties properties = MLT_PRODUCER_PROPERTIES( obj );
-                       mlt_properties_set_int( properties, "_unique_id", ++ unique_id );
-                       mlt_properties_set( properties, "mlt_type", "producer" );
-                       if ( mlt_properties_get_int( properties, "_mlt_service_hidden" ) == 0 )
-                               mlt_properties_set( properties, "mlt_service", service );
+                       set_common_properties( properties, profile, "producer", service );
                }
        }
        return obj;
@@ -194,7 +191,7 @@ mlt_producer mlt_factory_producer( const char *service, void *input )
 /** Fetch a filter from the repository.
 */
 
-mlt_filter mlt_factory_filter( const char *service, void *input )
+mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, void *input )
 {
        mlt_filter obj = NULL;
 
@@ -203,16 +200,14 @@ mlt_filter mlt_factory_filter( const char *service, void *input )
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( filters, service, input );
+               obj = mlt_repository_fetch( filters, profile, filter_type, service, input );
                mlt_events_fire( event_object, "filter-create-done", service, input, obj, NULL );
        }
 
        if ( obj != NULL )
        {
                mlt_properties properties = MLT_FILTER_PROPERTIES( obj );
-               mlt_properties_set_int( properties, "_unique_id", ++ unique_id );
-               mlt_properties_set( properties, "mlt_type", "filter" );
-               mlt_properties_set( properties, "mlt_service", service );
+               set_common_properties( properties, profile, "filter", service );
        }
        return obj;
 }
@@ -220,7 +215,7 @@ mlt_filter mlt_factory_filter( const char *service, void *input )
 /** Fetch a transition from the repository.
 */
 
-mlt_transition mlt_factory_transition( const char *service, void *input )
+mlt_transition mlt_factory_transition( mlt_profile profile, const char *service, void *input )
 {
        mlt_transition obj = NULL;
 
@@ -229,16 +224,14 @@ mlt_transition mlt_factory_transition( const char *service, void *input )
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( transitions, service, input );
+               obj = mlt_repository_fetch( transitions, profile, filter_type, service, input );
                mlt_events_fire( event_object, "transition-create-done", service, input, obj, NULL );
        }
 
        if ( obj != NULL )
        {
                mlt_properties properties = MLT_TRANSITION_PROPERTIES( obj );
-               mlt_properties_set_int( properties, "_unique_id", ++ unique_id );
-               mlt_properties_set( properties, "mlt_type", "transition" );
-               mlt_properties_set( properties, "mlt_service", service );
+               set_common_properties( properties, profile, "transition", service );
        }
        return obj;
 }
@@ -246,7 +239,7 @@ mlt_transition mlt_factory_transition( const char *service, void *input )
 /** Fetch a consumer from the repository
 */
 
-mlt_consumer mlt_factory_consumer( const char *service, void *input )
+mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, void *input )
 {
        mlt_consumer obj = NULL;
 
@@ -258,16 +251,14 @@ mlt_consumer mlt_factory_consumer( const char *service, void *input )
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( consumers, service, input );
+               obj = mlt_repository_fetch( consumers, profile, consumer_type, service, input );
                mlt_events_fire( event_object, "consumer-create-done", service, input, obj, NULL );
        }
 
        if ( obj != NULL )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( obj );
-               mlt_properties_set_int( properties, "_unique_id", ++ unique_id );
-               mlt_properties_set( properties, "mlt_type", "consumer" );
-               mlt_properties_set( properties, "mlt_service", service );
+               set_common_properties( properties, profile, "consumer", service );
        }
        return obj;
 }
@@ -299,6 +290,5 @@ void mlt_factory_close( )
                free( mlt_prefix );
                mlt_prefix = NULL;
                mlt_pool_close( );
-               mlt_profile_close();
        }
 }
index 749a2011bb9da9445f7c5078060ebefc6bfe3fe0..d302521db02008c20cea4da61ec3b434877f69aa 100644 (file)
 #define _MLT_FACTORY_H
 
 #include "mlt_types.h"
+#include "mlt_profile.h"
 
 extern int mlt_factory_init( const char *prefix );
 extern const char *mlt_factory_prefix( );
 extern char *mlt_environment( const char *name );
 extern int mlt_environment_set( const char *name, const char *value );
 extern mlt_properties mlt_factory_event_object( );
-extern mlt_producer mlt_factory_producer( const char *name, void *input );
-extern mlt_filter mlt_factory_filter( const char *name, void *input );
-extern mlt_transition mlt_factory_transition( const char *name, void *input );
-extern mlt_consumer mlt_factory_consumer( const char *name, void *input );
+extern mlt_producer mlt_factory_producer( mlt_profile profile, const char *name, void *input );
+extern mlt_filter mlt_factory_filter( mlt_profile profile, const char *name, void *input );
+extern mlt_transition mlt_factory_transition( mlt_profile profile, const char *name, void *input );
+extern mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *name, void *input );
 extern void mlt_factory_register_for_clean_up( void *ptr, mlt_destructor destructor );
 extern void mlt_factory_close( );
 
index 6723d2f1c0dcc7dc67a3179edd28a22c4b3be993..8a3de98c2cf3d083f8632aa3da9e2eae062251ed 100644 (file)
@@ -182,7 +182,7 @@ static int filter_get_frame( mlt_service service, mlt_frame_ptr frame, int index
                }
                else
                {
-                       *frame = mlt_frame_init( );
+                       *frame = mlt_frame_init( service );
                        return 0;
                }
        }
index a34579edf83b4585d2c085d4db0509f4ebb34bb1..2d22c782b24b7cc4131863866d29688dde27800e 100644 (file)
 /** Constructor for a frame.
 */
 
-mlt_frame mlt_frame_init( )
+mlt_frame mlt_frame_init( mlt_service service )
 {
        // Allocate a frame
        mlt_frame this = calloc( sizeof( struct mlt_frame_s ), 1 );
 
        if ( this != NULL )
        {
+               mlt_profile profile = mlt_service_profile( service );
+
                // Initialise the properties
                mlt_properties properties = &this->parent;
                mlt_properties_init( properties, this );
@@ -46,10 +48,10 @@ mlt_frame mlt_frame_init( )
                // Set default properties on the frame
                mlt_properties_set_position( properties, "_position", 0.0 );
                mlt_properties_set_data( properties, "image", NULL, 0, NULL, NULL );
-               mlt_properties_set_int( properties, "width", mlt_profile_get()->width );
-               mlt_properties_set_int( properties, "height", mlt_profile_get()->height );
-               mlt_properties_set_int( properties, "normalised_width", mlt_profile_get()->width );
-               mlt_properties_set_int( properties, "normalised_height", mlt_profile_get()->height );
+               mlt_properties_set_int( properties, "width", profile? profile->width : 720 );
+               mlt_properties_set_int( properties, "height", profile? profile->height : 576 );
+               mlt_properties_set_int( properties, "normalised_width", profile? profile->width : 720 );
+               mlt_properties_set_int( properties, "normalised_height", profile? profile->height : 576 );
                mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( NULL ) );
                mlt_properties_set_data( properties, "audio", NULL, 0, NULL, NULL );
                mlt_properties_set_data( properties, "alpha", NULL, 0, NULL, NULL );
index 7988037da5125dd311e96eac588b5214dea5fb26..941d8ff44b860f169526fbf2b194fb71ae917f0f 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "mlt_properties.h"
 #include "mlt_deque.h"
+#include "mlt_service.h"
 
 typedef int ( *mlt_get_image )( mlt_frame self, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable );
 typedef int ( *mlt_get_audio )( mlt_frame self, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples );
@@ -46,7 +47,7 @@ struct mlt_frame_s
 #define MLT_FRAME_IMAGE_STACK( frame )         ( ( frame )->stack_image )
 #define MLT_FRAME_AUDIO_STACK( frame )         ( ( frame )->stack_audio )
 
-extern mlt_frame mlt_frame_init( );
+extern mlt_frame mlt_frame_init( mlt_service service );
 extern mlt_properties mlt_frame_properties( mlt_frame self );
 extern int mlt_frame_is_test_card( mlt_frame self );
 extern int mlt_frame_is_test_audio( mlt_frame self );
index 67d98ee9f5759227fdfe05d906127a1af013d810..db9c877c66296298f2cf5770225afbd9785d326e 100644 (file)
@@ -55,8 +55,8 @@ mlt_geometry mlt_geometry_init( )
                if ( this->local != NULL )
                {
                        geometry self = this->local;
-                       self->nw = mlt_profile_get()->width;
-                       self->nh = mlt_profile_get()->height;
+                       self->nw = 720;
+                       self->nh = 576;
                }
                else
                {
index 929d4bd31a31d0a397b45a63a6b8fd6bcdaa724d..4637d62923561980685f044b0e43208b33b9d77f 100644 (file)
@@ -386,7 +386,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int ind
        else
        {
                // Generate a test frame
-               *frame = mlt_frame_init( );
+               *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( parent ) );
 
                // Update position on the frame we're creating
                mlt_frame_set_position( *frame, mlt_producer_position( parent ) );
index 7dbbd7b07c073792d7e6cccfb6f0c41014d7b101..b5e7fb35c9e85cf813a54496cf764ae8add19522 100644 (file)
@@ -1413,8 +1413,8 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        // Check that we have a producer
        if ( producer == NULL )
        {
-               *frame = mlt_frame_init( );
-               return 0;
+               *frame = NULL;
+               return -1;
        }
 
        // Get this mlt_playlist
@@ -1429,7 +1429,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        // Check that we have a producer
        if ( real == NULL )
        {
-               *frame = mlt_frame_init( );
+               *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
                return 0;
        }
 
@@ -1441,7 +1441,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        else
        {
                mlt_producer parent = mlt_producer_cut_parent( ( mlt_producer )real );
-               *frame = mlt_frame_init( );
+               *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( parent ) );
                mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "fx_cut", 1 );
                mlt_frame_push_service( *frame, NULL );
                mlt_frame_push_audio( *frame, NULL );
index 5d3963c5e52e42f0413842b5ef5ee6eab54c0043..7f95e8584bc3be9113f030a169534e1fa71f55aa 100644 (file)
@@ -289,7 +289,8 @@ double mlt_producer_get_speed( mlt_producer this )
 
 double mlt_producer_get_fps( mlt_producer this )
 {
-       return mlt_profile_fps( NULL );
+       mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( this ) );
+       return mlt_profile_fps( profile );
 }
 
 /** Set the in and out points.
@@ -416,7 +417,7 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind
                if ( this->get_frame == NULL || ( !strcmp( eof, "continue" ) && mlt_producer_position( this ) > mlt_producer_get_out( this ) ) )
                {
                        // Generate a test frame
-                       *frame = mlt_frame_init( );
+                       *frame = mlt_frame_init( service );
 
                        // Set the position
                        result = mlt_frame_set_position( *frame, mlt_producer_position( this ) );
@@ -496,7 +497,7 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind
        }
        else
        {
-               *frame = mlt_frame_init( );
+               *frame = mlt_frame_init( service );
                result = 0;
        }
 
@@ -553,14 +554,15 @@ static mlt_producer mlt_producer_clone( mlt_producer this )
        mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
        char *resource = mlt_properties_get( properties, "resource" );
        char *service = mlt_properties_get( properties, "mlt_service" );
+       mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( this ) );
 
        mlt_events_block( mlt_factory_event_object( ), mlt_factory_event_object( ) );
 
        if ( service != NULL )
-               clone = mlt_factory_producer( service, resource );
+               clone = mlt_factory_producer( profile, service, resource );
 
        if ( clone == NULL && resource != NULL )
-               clone = mlt_factory_producer( "fezzik", resource );
+               clone = mlt_factory_producer( profile, mlt_environment( "MLT_PRODUCER" ), resource );
 
        if ( clone != NULL )
                mlt_properties_inherit( MLT_PRODUCER_PROPERTIES( clone ), properties );
index e9565ecfed9a9060f3528a699487f7cce32dab20..778bb538098dadd26aef839b3f38ded2948c57c3 100644 (file)
 
 #define PROFILES_DIR "/share/mlt/profiles/"
 
-static mlt_profile profile = NULL;
-
-/** Get the current profile
-* Builds one for PAL DV if non-existing
-*/
-
-mlt_profile mlt_profile_get( )
-{
-       if ( !profile )
-       {
-               profile = calloc( 1, sizeof( struct mlt_profile_s ) );
-               if ( profile )
-               {
-                       mlt_environment_set( "MLT_PROFILE", "dv_pal" );
-                       profile->description = strdup( "PAL 4:3 DV or DVD" );
-                       profile->frame_rate_num = 25;
-                       profile->frame_rate_den = 1;
-                       profile->width = 720;
-                       profile->height = 576;
-                       profile->progressive = 0;
-                       profile->sample_aspect_num = 59;
-                       profile->sample_aspect_den = 54;
-                       profile->display_aspect_num = 4;
-                       profile->display_aspect_den = 3;
-               }
-       }
-       return profile;
-}
-
-
 /** Load a profile from the system folder
 */
 
-mlt_profile mlt_profile_select( const char *name )
+static mlt_profile mlt_profile_select( const char *name )
 {
        char *filename = NULL;
        const char *prefix = getenv( "MLT_PROFILES_PATH" );
        mlt_properties properties = mlt_properties_load( name );
+       mlt_profile profile = NULL;
        
        // Try to load from file specification
        if ( properties && mlt_properties_get_int( properties, "width" ) )
@@ -93,7 +64,7 @@ mlt_profile mlt_profile_select( const char *name )
        
        // Finish loading
        strcat( filename, name );
-       mlt_profile_load_file( filename );
+       profile = mlt_profile_load_file( filename );
 
        // Cleanup
        mlt_properties_close( properties );
@@ -102,30 +73,74 @@ mlt_profile mlt_profile_select( const char *name )
        return profile;
 }
 
+/** Construct a profile.
+*/
+
+mlt_profile mlt_profile_init( const char *name )
+{
+       mlt_profile profile = NULL;
+
+       // Explicit profile by name gets priority over environment variables
+       if ( name )
+               profile = mlt_profile_select( name );
+
+       // Try to load by environment variable
+       if ( profile == NULL )
+       {
+               // MLT_PROFILE is preferred environment variable
+               if ( getenv( "MLT_PROFILE" ) )
+                       profile = mlt_profile_select( mlt_environment( "MLT_PROFILE" ) );
+               // MLT_NORMALISATION backwards compatibility
+               else if ( strcmp( mlt_environment( "MLT_NORMALISATION" ), "PAL" ) )
+                       profile = mlt_profile_select( "dv_ntsc" );
+               else
+                       profile = mlt_profile_select( "dv_pal" );
+
+               // If still not loaded (no profile files), default to PAL
+               if ( profile == NULL )
+               {
+                       profile = calloc( 1, sizeof( struct mlt_profile_s ) );
+                       if ( profile )
+                       {
+                               mlt_environment_set( "MLT_PROFILE", "dv_pal" );
+                               profile->description = strdup( "PAL 4:3 DV or DVD" );
+                               profile->frame_rate_num = 25;
+                               profile->frame_rate_den = 1;
+                               profile->width = 720;
+                               profile->height = 576;
+                               profile->progressive = 0;
+                               profile->sample_aspect_num = 59;
+                               profile->sample_aspect_den = 54;
+                               profile->display_aspect_num = 4;
+                               profile->display_aspect_den = 3;
+                       }
+               }
+       }
+       return profile;
+}
+
 /** Load a profile from specific file
 */
 
 mlt_profile mlt_profile_load_file( const char *file )
 {
+       mlt_profile profile = NULL;
+
        // Load the profile as properties
        mlt_properties properties = mlt_properties_load( file );
-       if ( properties && mlt_properties_get_int( properties, "width" ) )
+       if ( properties )
        {
-               mlt_profile_load_properties( properties );
-               mlt_properties_close( properties );
+               // Simple check if the profile is valid
+               if ( mlt_properties_get_int( properties, "width" ) )
+               {
+                       profile = mlt_profile_load_properties( properties );
 
-               // Set MLT_PROFILE to basename
-               char *filename = strdup( file );
-               mlt_environment_set( "MLT_PROFILE", basename( filename ) );
-               free( filename );
-       }
-       else
-       {
-               // Cleanup
+                       // Set MLT_PROFILE to basename
+                       char *filename = strdup( file );
+                       mlt_environment_set( "MLT_PROFILE", basename( filename ) );
+                       free( filename );
+               }
                mlt_properties_close( properties );
-               mlt_profile_close();
-               // Failover
-               mlt_profile_get();
        }
 
        // Set MLT_NORMALISATION to appease legacy modules
@@ -151,8 +166,7 @@ mlt_profile mlt_profile_load_file( const char *file )
 
 mlt_profile mlt_profile_load_properties( mlt_properties properties )
 {
-       mlt_profile_close();
-       profile = calloc( 1, sizeof( struct mlt_profile_s ) );
+       mlt_profile profile = calloc( 1, sizeof( struct mlt_profile_s ) );
        if ( profile )
        {
                if ( mlt_properties_get( properties, "name" ) )
@@ -200,7 +214,7 @@ double mlt_profile_fps( mlt_profile aprofile )
        if ( aprofile )
                return ( double ) aprofile->frame_rate_num / aprofile->frame_rate_den;
        else
-               return ( double ) mlt_profile_get()->frame_rate_num / mlt_profile_get()->frame_rate_den;
+               return 0;
 }
 
 /** Get the sample aspect ratio as float
@@ -211,7 +225,7 @@ double mlt_profile_sar( mlt_profile aprofile )
        if ( aprofile )
                return ( double ) aprofile->sample_aspect_num / aprofile->sample_aspect_den;
        else
-               return ( double ) mlt_profile_get()->sample_aspect_num / mlt_profile_get()->sample_aspect_den;
+               return 0;
 }
 
 /** Get the display aspect ratio as float
@@ -222,13 +236,13 @@ double mlt_profile_dar( mlt_profile aprofile )
        if ( aprofile )
                return ( double ) aprofile->display_aspect_num / aprofile->display_aspect_den;
        else
-               return ( double ) mlt_profile_get()->display_aspect_num / mlt_profile_get()->display_aspect_den;
+               return 0;
 }
 
 /** Free up the global profile resources
 */
 
-void mlt_profile_close( )
+void mlt_profile_close( mlt_profile profile )
 {
        if ( profile )
        {
index 0c64e7c02f21da7c0ded81dc4f0ba42c3554e337..6b0c42d9f328d82b31f9fe6e55eefd21a96cd7d6 100644 (file)
@@ -37,13 +37,12 @@ struct mlt_profile_s
        int display_aspect_den;
 };
 
-extern mlt_profile mlt_profile_get( );
-extern mlt_profile mlt_profile_select( const char *name );
+extern mlt_profile mlt_profile_init( const char *name );
 extern mlt_profile mlt_profile_load_file( const char *file );
 extern mlt_profile mlt_profile_load_properties( mlt_properties properties );
 extern mlt_profile mlt_profile_load_string( const char *string );
 extern double mlt_profile_fps( mlt_profile profile );
 extern double mlt_profile_sar( mlt_profile profile );
 extern double mlt_profile_dar( mlt_profile profile );
-extern void mlt_profile_close( );
+extern void mlt_profile_close( mlt_profile profile );
 #endif
index 4241331a369fda4fa8d6b87a325de20c1001e8c2..826268dc0afb7405baeeb51e6894a9ec953daca9 100644 (file)
@@ -63,7 +63,7 @@ static mlt_properties construct_service( mlt_properties object, const char *id )
        return output;
 }
 
-static void *construct_instance( mlt_properties service_properties, const char *symbol, void *input )
+static void *construct_instance( mlt_properties service_properties, mlt_profile profile, mlt_service_type type, const char *symbol, void *input )
 {
        // Extract the service
        char *service = mlt_properties_get( service_properties, "id" );
@@ -75,7 +75,7 @@ static void *construct_instance( mlt_properties service_properties, const char *
        void *object = mlt_properties_get_data( object_properties, "dlopen", NULL );
 
        // Get the dlsym'd symbol
-       void *( *symbol_ptr )( const char *, void * ) = mlt_properties_get_data( object_properties, symbol, NULL );
+       void *( *symbol_ptr )( mlt_profile, mlt_service_type, const char *, void * ) = mlt_properties_get_data( object_properties, symbol, NULL );
 
        // Check that we have object and open if we don't
        if ( object == NULL )
@@ -119,7 +119,7 @@ static void *construct_instance( mlt_properties service_properties, const char *
        }
 
        // Construct the service
-       return symbol_ptr != NULL ? symbol_ptr( service, input ) : NULL;
+       return symbol_ptr != NULL ? symbol_ptr( profile, type, service, input ) : NULL;
 }
 
 mlt_repository mlt_repository_init( mlt_properties object_list, const char *prefix, const char *data, const char *symbol )
@@ -182,7 +182,7 @@ mlt_repository mlt_repository_init( mlt_properties object_list, const char *pref
        return this;
 }
 
-void *mlt_repository_fetch( mlt_repository this, const char *service, void *input )
+void *mlt_repository_fetch( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, void *input )
 {
        // Get the service properties
        mlt_properties service_properties = mlt_properties_get_data( &this->parent, service, NULL );
@@ -194,7 +194,7 @@ void *mlt_repository_fetch( mlt_repository this, const char *service, void *inpu
                char *symbol = mlt_properties_get( &this->parent, "_symbol" );
 
                // Now get an instance of the service
-               return construct_instance( service_properties, symbol, input );
+               return construct_instance( service_properties, profile, type, symbol, input );
        }
 
        return NULL;
index 5332c57735a6aca0366c1ec4256f8181b5d80adf..f4b2e2c3974afc8eb920339b29375a829d149dfd 100644 (file)
@@ -22,6 +22,7 @@
 #define _MLT_REPOSITORY_H_
 
 #include "mlt_types.h"
+#include "mlt_profile.h"
 
 /** Repository structure forward reference.
 */
@@ -32,7 +33,7 @@ typedef struct mlt_repository_s *mlt_repository;
 */
 
 extern mlt_repository mlt_repository_init( mlt_properties object_list, const char *prefix, const char *file, const char *symbol );
-extern void *mlt_repository_fetch( mlt_repository self, const char *service, void *input );
+extern void *mlt_repository_fetch( mlt_repository self, mlt_profile profile, mlt_service_type type, const char *service, void *input );
 extern void mlt_repository_close( mlt_repository self );
 
 #endif
index aedc6effb96801d71a6f0b748da4e20b13dc21b2..49779bc01523222d6e9b921b3dd3192e3fd9a5a1 100644 (file)
@@ -304,7 +304,7 @@ static int service_get_frame( mlt_service this, mlt_frame_ptr frame, int index )
                if ( producer != NULL )
                        return mlt_service_get_frame( producer, frame, index );
        }
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( this );
        return 0;
 }
 
@@ -389,7 +389,7 @@ int mlt_service_get_frame( mlt_service this, mlt_frame_ptr frame, int index )
 
        // Make sure we return a frame
        if ( *frame == NULL )
-               *frame = mlt_frame_init( );
+               *frame = mlt_frame_init( this );
 
        // Unlock the service
        mlt_service_unlock( this );
@@ -489,6 +489,14 @@ mlt_filter mlt_service_filter( mlt_service this, int index )
        return filter;
 }
 
+/** Retrieve the profile.
+*/
+
+mlt_profile mlt_service_profile( mlt_service this )
+{
+       return mlt_properties_get_data( MLT_SERVICE_PROPERTIES( this ), "_profile", NULL );
+}
+
 /** Close the service.
 */
 
index b1bad7e981a71d3be4824f126a44a57a0c4a757f..a2d71a5d9bf793b79dc53fe0caec3c75e5a47770 100644 (file)
@@ -22,6 +22,7 @@
 #define _MLT_SERVICE_H_
 
 #include "mlt_properties.h"
+#include "mlt_profile.h"
 
 /** The interface definition for all services.
 */
@@ -59,6 +60,7 @@ extern int mlt_service_attach( mlt_service self, mlt_filter filter );
 extern int mlt_service_detach( mlt_service self, mlt_filter filter );
 extern void mlt_service_apply_filters( mlt_service self, mlt_frame frame, int index );
 extern mlt_filter mlt_service_filter( mlt_service self, int index );
+extern mlt_profile mlt_service_profile( mlt_service self );
 
 extern void mlt_service_close( mlt_service self );
 
index 0d47b3fa8dc7e028e60447f50260f2281445829b..29ee362fdcceec7164d0ba22c2fa52314cc7c95d 100644 (file)
@@ -311,7 +311,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int tra
                        mlt_producer_set_speed( target, mlt_producer_get_speed( parent ) );
 
                        // We will create one frame and attach everything to it
-                       *frame = mlt_frame_init( );
+                       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( parent ) );
 
                        // Get the properties of the frame
                        frame_properties = MLT_FRAME_PROPERTIES( *frame );
@@ -454,7 +454,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int tra
        else
        {
                // Generate a test card
-               *frame = mlt_frame_init( );
+               *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( parent ) );
                return 0;
        }
 }
index 95aeb4045a55778968d2f2c3d29d1c55de2a9200..da12d01a446a2678e2fc01506c3ac9f5c0563b94 100644 (file)
@@ -156,18 +156,16 @@ static void transport_action( mlt_producer producer, char *value )
        mlt_properties_set_int( properties, "stats_off", 0 );
 }
 
-static mlt_consumer create_consumer( char *id, mlt_producer producer )
+static mlt_consumer create_consumer( mlt_profile profile, char *id )
 {
        char *arg = id != NULL ? strchr( id, ':' ) : NULL;
        if ( arg != NULL )
                *arg ++ = '\0';
-       mlt_consumer consumer = mlt_factory_consumer( id, arg );
+       mlt_consumer consumer = mlt_factory_consumer( profile, id, arg );
        if ( consumer != NULL )
        {
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
                mlt_properties_set_data( properties, "transport_callback", transport_action, 0, NULL, NULL );
-               mlt_properties_set_data( properties, "transport_producer", producer, 0, NULL, NULL );
-               mlt_properties_set_data( MLT_PRODUCER_PROPERTIES( producer ), "transport_consumer", consumer, 0, NULL, NULL );
        }
        return consumer;
 }
@@ -203,11 +201,14 @@ static void transport( mlt_producer producer, mlt_consumer consumer )
 {
        mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
        int silent = mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "silent" );
+       int progress = mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "progress" );
        struct timespec tm = { 0, 40000 };
+       int total_length = mlt_producer_get_length( producer );
+       int last_position = 0;
 
        if ( mlt_properties_get_int( properties, "done" ) == 0 && !mlt_consumer_is_stopped( consumer ) )
        {
-               if ( !silent )
+               if ( !silent && !progress )
                {
                        term_init( );
 
@@ -225,7 +226,7 @@ static void transport( mlt_producer producer, mlt_consumer consumer )
 
                while( mlt_properties_get_int( properties, "done" ) == 0 && !mlt_consumer_is_stopped( consumer ) )
                {
-                       int value = silent ? -1 : term_read( );
+                       int value = ( silent || progress )? -1 : term_read( );
 
                        if ( value != -1 )
                        {
@@ -238,7 +239,22 @@ static void transport( mlt_producer producer, mlt_consumer consumer )
 #endif
 
                        if ( !silent && mlt_properties_get_int( properties, "stats_off" ) == 0 )
-                               fprintf( stderr, "Current Position: %10d\r", (int)mlt_producer_position( producer ) );
+                       {
+                               if ( progress )
+                               {
+                                       int current_position = mlt_producer_position( producer );
+                                       if ( current_position > last_position )
+                                       {
+                                               fprintf( stderr, "Current Frame: %10d, percentage: %10d\r",
+                                                       current_position, 100 * current_position / total_length );
+                                               last_position = current_position;
+                                       }
+                               }
+                               else
+                               {
+                                       fprintf( stderr, "Current Position: %10d\r", (int)mlt_producer_position( producer ) );
+                               }
+                       }
 
                        if ( silent )
                                nanosleep( &tm, NULL );
@@ -257,6 +273,7 @@ int main( int argc, char **argv )
        FILE *store = NULL;
        char *name = NULL;
        struct sched_param scp;
+       mlt_profile profile = NULL;
 
        // Use realtime scheduling if possible
        memset( &scp, '\0', sizeof( scp ) );
@@ -268,41 +285,73 @@ int main( int argc, char **argv )
        // Construct the factory
        mlt_factory_init( NULL );
 
-       // Check for serialisation switch first
        for ( i = 1; i < argc; i ++ )
        {
+               // Check for serialisation switch
                if ( !strcmp( argv[ i ], "-serialise" ) )
                {
                        name = argv[ ++ i ];
-                       if ( strstr( name, ".inigo" ) )
+                       if ( name != NULL && strstr( name, ".inigo" ) )
                                store = fopen( name, "w" );
+                       else
+                       {
+                               if ( name == NULL || name[0] == '-' )
+                                       store = stdout;
+                               name = NULL;
+                       }
+               }
+               // Look for the profile option
+               else if ( !strcmp( argv[ i ], "-profile" ) )
+               {
+                       const char *pname = argv[ ++ i ];
+                       if ( pname && pname[0] != '-' )
+                               profile = mlt_profile_init( pname );
                }
        }
 
+       // Create profile if not set explicitly
+       if ( profile == NULL )
+               profile = mlt_profile_init( NULL );
+
+       // Look for the consumer option
+       for ( i = 1; i < argc; i ++ )
+       {
+               if ( !strcmp( argv[ i ], "-consumer" ) )
+               {
+                       consumer = create_consumer( profile, argv[ ++ i ] );
+                       if ( consumer )
+                       {
+                               mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
+                               while ( argv[ i + 1 ] != NULL && strstr( argv[ i + 1 ], "=" ) )
+                                       mlt_properties_parse( properties, argv[ ++ i ] );
+                       }
+               }
+       }
+
+       // If we have no consumer, default to sdl
+       if ( store == NULL && consumer == NULL )
+               consumer = create_consumer( profile, NULL );
+
        // Get inigo producer
        if ( argc > 1 )
-               inigo = mlt_factory_producer( "inigo", &argv[ 1 ] );
+               inigo = mlt_factory_producer( profile, "inigo", &argv[ 1 ] );
 
-       if ( argc > 1 && inigo != NULL && mlt_producer_get_length( inigo ) > 0 )
+       // Set transport properties on consumer and produder
+       if ( consumer != NULL && inigo != NULL )
        {
-               // Get inigo's properties
-               mlt_properties inigo_props = MLT_PRODUCER_PROPERTIES( inigo );
-
-               // Get the last group
-               mlt_properties group = mlt_properties_get_data( inigo_props, "group", 0 );
+               mlt_properties_set_data( MLT_CONSUMER_PROPERTIES( consumer ), "transport_producer", inigo, 0, NULL, NULL );
+               mlt_properties_set_data( MLT_PRODUCER_PROPERTIES( inigo ), "transport_consumer", consumer, 0, NULL, NULL );
+       }
 
+       if ( argc > 1 && inigo != NULL && mlt_producer_get_length( inigo ) > 0 )
+       {
                // Parse the arguments
                for ( i = 1; i < argc; i ++ )
                {
-                       if ( !strcmp( argv[ i ], "-consumer" ) )
-                       {
-                               consumer = create_consumer( argv[ ++ i ], inigo );
-                               while ( argv[ i + 1 ] != NULL && strstr( argv[ i + 1 ], "=" ) )
-                                       mlt_properties_parse( group, argv[ ++ i ] );
-                       }
-                       else if ( !strcmp( argv[ i ], "-serialise" ) )
+                       if ( !strcmp( argv[ i ], "-serialise" ) )
                        {
-                               i ++;
+                               if ( store != stdout )
+                                       i ++;
                        }
                        else
                        {
@@ -322,12 +371,14 @@ int main( int argc, char **argv )
                        }
                }
 
-               // If we have no consumer, default to sdl
-               if ( store == NULL && consumer == NULL )
-                       consumer = create_consumer( NULL, inigo );
-
                if ( consumer != NULL && store == NULL )
                {
+                       // Get inigo's properties
+                       mlt_properties inigo_props = MLT_PRODUCER_PROPERTIES( inigo );
+       
+                       // Get the last group
+                       mlt_properties group = mlt_properties_get_data( inigo_props, "group", 0 );
+       
                        // Apply group settings
                        mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
                        mlt_properties_inherit( properties, group );
@@ -344,7 +395,7 @@ int main( int argc, char **argv )
                        // Stop the consumer
                        mlt_consumer_stop( consumer );
                }
-               else if ( store != NULL )
+               else if ( store != NULL && store != stdout && name != NULL )
                {
                        fprintf( stderr, "Project saved as %s.\n", name );
                        fclose( store );
@@ -352,18 +403,20 @@ int main( int argc, char **argv )
        }
        else
        {
-               fprintf( stderr, "Usage: inigo [ -group [ name=value ]* ]\n"
-                                                "             [ -consumer id[:arg] [ name=value ]* ]\n"
-                                                "             [ -filter filter[:arg] [ name=value ] * ]\n"
-                                                "             [ -attach filter[:arg] [ name=value ] * ]\n"
+               fprintf( stderr, "Usage: inigo [ -profile name ]\n"
+                                                "             [ -serialise [ filename.inigo ] ]\n"
+                                                "             [ -group [ name=value ]* ]\n"
+                                                "             [ -consumer id[:arg] [ name=value ]* [ silent=1 ] [ progress=1 ] ]\n"
+                                                "             [ -filter filter[:arg] [ name=value ]* ]\n"
+                                                "             [ -attach filter[:arg] [ name=value ]* ]\n"
                                                 "             [ -mix length [ -mixer transition ]* ]\n"
-                                                "             [ -transition id[:arg] [ name=value ] * ]\n"
+                                                "             [ -transition id[:arg] [ name=value ]* ]\n"
                                                 "             [ -blank frames ]\n"
                                                 "             [ -track ]\n"
                                                 "             [ -split relative-frame ]\n"
                                                 "             [ -join clips ]\n"
                                                 "             [ -repeat times ]\n"
-                                                "             [ producer [ name=value ] * ]+\n" );
+                                                "             [ producer [ name=value ]* ]+\n" );
        }
 
        // Close the consumer
@@ -375,6 +428,7 @@ int main( int argc, char **argv )
                mlt_producer_close( inigo );
 
        // Close the factory
+       mlt_profile_close( profile );
        mlt_factory_close( );
 
        return 0;
index 30eef7a756ea4a6aeb86a8aa3e41108bc7978dfd..aafb63d3ffd666ee36890d63b64c3bd89e206819 100644 (file)
@@ -250,7 +250,7 @@ void *parser_thread( void *arg )
                                {
                                        if ( mlt_properties_get( owner, "push-parser-off" ) == 0 )
                                        {
-                                               service = ( mlt_service )mlt_factory_producer( "westley-xml", buffer );
+                                               service = ( mlt_service )mlt_factory_producer( NULL, "westley-xml", buffer );
                                                mlt_events_fire( owner, "push-received", &response, command, service, NULL );
                                                if ( response == NULL )
                                                        response = valerie_parser_push( parser, command, service );
index c9471d34191361bf3a8ec39c01c8767bac266056..4974e387170cbac0110a872ecb9facb96679b2fe 100644 (file)
@@ -62,7 +62,7 @@ miracle_unit miracle_unit_init( int index, char *constructor )
        if ( arg != NULL )
                *arg ++ = '\0';
 
-       consumer = mlt_factory_consumer( id, arg );
+       consumer = mlt_factory_consumer( NULL, id, arg );
 
        if ( consumer != NULL )
        {
@@ -146,7 +146,15 @@ void miracle_unit_set_notifier( miracle_unit this, valerie_notifier notifier, ch
 
 static mlt_producer locate_producer( miracle_unit unit, char *file )
 {
-       return mlt_factory_producer( "fezzik", file );
+       // Try to get the profile from the consumer
+       mlt_consumer consumer = mlt_properties_get_data( unit->properties, "consumer", NULL );
+       mlt_profile profile = NULL;
+
+       if ( consumer != NULL )
+       {
+               profile = mlt_service_profile( MLT_CONSUMER_SERVICE( consumer ) );
+       }
+       return mlt_factory_producer( profile, "fezzik", file );
 }
 
 /** Update the generation count.
index 81e439c2a5c21740060a515d64fe9903abce8846..97fb2dd0934aeb3a6e5edc25a08357e682cfcb30 100644 (file)
@@ -279,17 +279,23 @@ int miracle_push( command_argument cmd_arg, mlt_service service )
 
 int miracle_receive( command_argument cmd_arg, char *doc )
 {
-       mlt_producer producer = mlt_factory_producer( "westley-xml", doc );
        miracle_unit unit = miracle_get_unit(cmd_arg->unit);
-       if ( unit != NULL && producer != NULL )
+       if ( unit != NULL )
        {
-               if ( miracle_unit_append_service( unit, MLT_PRODUCER_SERVICE( producer ) ) == valerie_ok )
+               // Get the consumer's profile
+               mlt_consumer consumer = mlt_properties_get_data( unit->properties, "consumer", NULL );
+               mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( consumer ) );
+               mlt_producer producer = mlt_factory_producer( profile, "westley-xml", doc );
+               if ( producer != NULL )
                {
+                       if ( miracle_unit_append_service( unit, MLT_PRODUCER_SERVICE( producer ) ) == valerie_ok )
+                       {
+                               mlt_producer_close( producer );
+                               return RESPONSE_SUCCESS;
+                       }
                        mlt_producer_close( producer );
-                       return RESPONSE_SUCCESS;
                }
        }
-       mlt_producer_close( producer );
        return RESPONSE_BAD_FILE;
 }
 
index 077bd52d20e3260d4c3e3098c43c0c00ba84c2d0..5a1ab27201c5faf0709a8cdee2eae8f2e7f9f9ca 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// Local header files
-#include "consumer_avformat.h"
-
 // mlt Header files
+#include <framework/mlt_consumer.h>
 #include <framework/mlt_frame.h>
 
 // System header files
@@ -136,10 +134,10 @@ static void consumer_close( mlt_consumer this );
 /** Initialise the dv consumer.
 */
 
-mlt_consumer consumer_avformat_init( char *arg )
+mlt_consumer consumer_avformat_init( mlt_profile profile, char *arg )
 {
        // Allocate the consumer
-       mlt_consumer this = mlt_consumer_new( );
+       mlt_consumer this = mlt_consumer_new( profile );
 
        // If memory allocated and initialises without error
        if ( this != NULL )
diff --git a/src/modules/avformat/consumer_avformat.h b/src/modules/avformat/consumer_avformat.h
deleted file mode 100644 (file)
index 51b8a34..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * consumer_avformat.h -- avformat consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _CONSUMER_AVFORMAT_H_
-#define _CONSUMER_AVFORMAT_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_avformat_init( char *file );
-
-#endif
index 5ccb204f4518167d83f104860a46e4ea54f44f4c..c197d901e68029b4e08abafa12584e55f9a1db94 100644 (file)
 #include <string.h>
 #include <pthread.h>
 
-#include <framework/mlt_factory.h>
-#include "producer_avformat.h"
-#include "consumer_avformat.h"
-#include "filter_avcolour_space.h"
-#include "filter_avdeinterlace.h"
-#include "filter_avresample.h"
+#include <framework/mlt.h>
+
+extern mlt_consumer consumer_avformat_init( mlt_profile profile, char *file );
+extern mlt_filter filter_avcolour_space_init( void *arg );
+extern mlt_filter filter_avdeinterlace_init( void *arg );
+extern mlt_filter filter_avresample_init( char *arg );
+extern mlt_producer producer_avformat_init( mlt_profile profile, char *file );
 
 // ffmpeg Header files
 #include <avformat.h>
@@ -91,15 +92,15 @@ static void avformat_init( )
        }
 }
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        avformat_init( );
        if ( !strcmp( id, "avformat" ) )
-               return producer_avformat_init( arg );
+               return producer_avformat_init( profile, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        avformat_init( );
        if ( !strcmp( id, "avcolour_space" ) )
@@ -113,16 +114,16 @@ void *mlt_create_filter( char *id, void *arg )
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        avformat_init( );
        if ( !strcmp( id, "avformat" ) )
-               return consumer_avformat_init( arg );
+               return consumer_avformat_init( profile, arg );
        return NULL;
 }
 
index 9c9747277516029dfb1aa8bff62ed8240c304e12..7e0ce9297cd750d48b608a7fe41bce18059d86c7 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_avcolour_space.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 // ffmpeg Header files
diff --git a/src/modules/avformat/filter_avcolour_space.h b/src/modules/avformat/filter_avcolour_space.h
deleted file mode 100644 (file)
index 75b0659..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_avcolour_space.h -- colourspace filter
- * Copyright (C) 2004-2005 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_AVCOLOUR_SPACE_H
-#define _FILTER_AVCOLOUR_SPACE_H
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_avcolour_space_init( void *arg );
-
-#endif
index d5c04beb0d6e876bb54139987c126ab7d097c85a..25b513593835e23ae5240828802b96d4576c78cd 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_avdeinterlace.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <string.h>
diff --git a/src/modules/avformat/filter_avdeinterlace.h b/src/modules/avformat/filter_avdeinterlace.h
deleted file mode 100644 (file)
index b5b7f16..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_avdeinterlace.h -- deinterlace filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_AVDEINTERLACE_H_
-#define _FILTER_AVDEINTERLACE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_avdeinterlace_init( void *arg );
-
-#endif
index 7525004ba06e166f79e5ed2f010f3fd035936e10..3252246a1c24fbbfe2699465e74ee0d0349282df 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_avresample.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
diff --git a/src/modules/avformat/filter_avresample.h b/src/modules/avformat/filter_avresample.h
deleted file mode 100644 (file)
index 8cfce88..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_avresample.h -- adjust audio sample frequency
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_AVRESAMPLE_H_
-#define _FILTER_AVRESAMPLE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_avresample_init( char *arg );
-
-#endif
index ec20a7a7ccc4ccedd48fe4db76e55b7631bf7663..dda7299ec8f7208ff8b5ab27ea35e52d9feef881 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// Local header files
-#include "producer_avformat.h"
-
 // MLT Header files
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 
 // ffmpeg Header files
@@ -40,13 +38,13 @@ void avformat_lock( );
 void avformat_unlock( );
 
 // Forward references.
-static int producer_open( mlt_producer this, char *file );
+static int producer_open( mlt_producer this, mlt_profile profile, char *file );
 static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index );
 
 /** Constructor for libavformat.
 */
 
-mlt_producer producer_avformat_init( char *file )
+mlt_producer producer_avformat_init( mlt_profile profile, char *file )
 {
        mlt_producer this = NULL;
 
@@ -69,7 +67,7 @@ mlt_producer producer_avformat_init( char *file )
                        this->get_frame = producer_get_frame;
 
                        // Open the file
-                       if ( producer_open( this, file ) != 0 )
+                       if ( producer_open( this, profile, file ) != 0 )
                        {
                                // Clean up
                                mlt_producer_close( this );
@@ -153,7 +151,7 @@ static void producer_codec_close( void *codec )
 /** Open the file.
 */
 
-static int producer_open( mlt_producer this, char *file )
+static int producer_open( mlt_producer this, mlt_profile profile, char *file )
 {
        // Return an error code (0 == no error)
        int error = 0;
@@ -165,7 +163,7 @@ static int producer_open( mlt_producer this, char *file )
        mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
 
        // We will treat everything with the producer fps
-       double fps = mlt_producer_get_fps( this );
+       double fps = mlt_profile_fps( profile );
 
        // Lock the mutex now
        avformat_lock( );
@@ -1045,7 +1043,7 @@ static void producer_set_up_audio( mlt_producer this, mlt_frame frame )
 static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
 {
        // Create an empty frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
 
        // Update timecode on the frame we're creating
        mlt_frame_set_position( *frame, mlt_producer_position( this ) );
diff --git a/src/modules/avformat/producer_avformat.h b/src/modules/avformat/producer_avformat.h
deleted file mode 100644 (file)
index 99e8476..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_avformat.h -- avformat producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_AVFORMAT_H_
-#define _PRODUCER_AVFORMAT_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_avformat_init( char *file );
-
-#endif
index ef1f95403ea0d1d0c94e85498ba646c2dfe8a0af..e96c8cda45a3982ddc7884206abb0013047879ca 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// Local header files
-#include "consumer_null.h"
-
 // mlt Header files
+#include <framework/mlt_consumer.h>
 #include <framework/mlt_frame.h>
 
 // System header files
@@ -40,10 +38,10 @@ static void consumer_close( mlt_consumer this );
 /** Initialise the dv consumer.
 */
 
-mlt_consumer consumer_null_init( char *arg )
+mlt_consumer consumer_null_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Allocate the consumer
-       mlt_consumer this = mlt_consumer_new( );
+       mlt_consumer this = mlt_consumer_new( profile );
 
        // If memory allocated and initialises without error
        if ( this != NULL )
diff --git a/src/modules/core/consumer_null.h b/src/modules/core/consumer_null.h
deleted file mode 100644 (file)
index 9996835..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * consumer_null.h -- null consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _CONSUMER_NULL_H_
-#define _CONSUMER_NULL_H
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_null_init( char *arg );
-
-#endif
index c90a6654dc74c19502b85610b6177c31e813f39d..2c92efb65956fd35a387c9d12a5e290a2c5acc10 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <framework/mlt.h>
 #include <string.h>
 
-#include "producer_colour.h"
-#include "producer_noise.h"
-#include "producer_ppm.h"
-#include "filter_brightness.h"
-#include "filter_channelcopy.h"
-#include "filter_data.h"
-#include "filter_gamma.h"
-#include "filter_greyscale.h"
-#include "filter_luma.h"
-#include "filter_mirror.h"
-#include "filter_mono.h"
-#include "filter_obscure.h"
-#include "filter_rescale.h"
-#include "filter_resize.h"
-#include "filter_region.h"
-#include "filter_transition.h"
-#include "filter_watermark.h"
+extern mlt_consumer consumer_null_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_brightness_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_channelcopy_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_data_feed_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_data_show_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_gamma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_greyscale_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_mirror_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_obscure_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_region_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_rescale_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_resize_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_transition_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_watermark_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_colour_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_noise_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_ppm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 #include "transition_composite.h"
-#include "transition_luma.h"
-#include "transition_mix.h"
+extern mlt_transition transition_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_transition transition_mix_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 #include "transition_region.h"
-#include "consumer_null.h"
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        if ( !strcmp( id, "color" ) )
-               return producer_colour_init( arg );
+               return producer_colour_init( profile, type, id, arg );
        if ( !strcmp( id, "colour" ) )
-               return producer_colour_init( arg );
+               return producer_colour_init( profile, type, id, arg );
        if ( !strcmp( id, "noise" ) )
-               return producer_noise_init( arg );
+               return producer_noise_init( profile, type, id, arg );
        if ( !strcmp( id, "ppm" ) )
-               return producer_ppm_init( arg );
+               return producer_ppm_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        if ( !strcmp( id, "brightness" ) )
-               return filter_brightness_init( arg );
+               return filter_brightness_init( profile, type, id, arg );
        if ( !strcmp( id, "channelcopy" ) )
-               return filter_channelcopy_init( arg );
+               return filter_channelcopy_init( profile, type, id, arg );
        if ( !strcmp( id, "data_feed" ) )
-               return filter_data_feed_init( arg );
+               return filter_data_feed_init( profile, type, id, arg );
        if ( !strcmp( id, "data_show" ) )
-               return filter_data_show_init( arg );
+               return filter_data_show_init( profile, type, id, arg );
        if ( !strcmp( id, "gamma" ) )
-               return filter_gamma_init( arg );
+               return filter_gamma_init( profile, type, id, arg );
        if ( !strcmp( id, "greyscale" ) )
-               return filter_greyscale_init( arg );
+               return filter_greyscale_init( profile, type, id, arg );
        if ( !strcmp( id, "luma" ) )
-               return filter_luma_init( arg );
+               return filter_luma_init( profile, type, id, arg );
        if ( !strcmp( id, "mirror" ) )
-               return filter_mirror_init( arg );
+               return filter_mirror_init( profile, type, id, arg );
        if ( !strcmp( id, "mono" ) )
-               return filter_mono_init( arg );
+               return filter_mono_init( profile, type, id, arg );
        if ( !strcmp( id, "obscure" ) )
-               return filter_obscure_init( arg );
+               return filter_obscure_init( profile, type, id, arg );
        if ( !strcmp( id, "region" ) )
-               return filter_region_init( arg );
+               return filter_region_init( profile, type, id, arg );
        if ( !strcmp( id, "rescale" ) )
-               return filter_rescale_init( arg );
+               return filter_rescale_init( profile, type, id, arg );
        if ( !strcmp( id, "resize" ) )
-               return filter_resize_init( arg );
-       else if ( !strcmp( id, "transition" ) )
-               return filter_transition_init( arg );
+               return filter_resize_init( profile, type, id, arg );
+       if ( !strcmp( id, "transition" ) )
+               return filter_transition_init( profile, type, id, arg );
        if ( !strcmp( id, "watermark" ) )
-               return filter_watermark_init( arg );
+               return filter_watermark_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        if ( !strcmp( id, "composite" ) )
-               return transition_composite_init( arg );
+               return transition_composite_init( profile, type, id, arg );
        if ( !strcmp( id, "luma" ) )
-               return transition_luma_init( arg );
+               return transition_luma_init( profile, type, id, arg );
        if ( !strcmp( id, "mix" ) )
-               return transition_mix_init( arg );
+               return transition_mix_init( profile, type, id, arg );
        if ( !strcmp( id, "region" ) )
-               return transition_region_init( arg );
+               return transition_region_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        if ( !strcmp( id, "null" ) )
-               return consumer_null_init( arg );
+               return consumer_null_init( profile, type, id, arg );
        return NULL;
 }
index 4b2db03a68361f16184cc77245055b65c36b6358..d597e8ab1df4113ef2c240ac3ac8169b84e48365 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_brightness.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -90,7 +89,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_brightness_init( char *arg )
+mlt_filter filter_brightness_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_brightness.h b/src/modules/core/filter_brightness.h
deleted file mode 100644 (file)
index 9bfa502..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_brightness.h -- gamma filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_BRIGHTNESS_H_
-#define _FILTER_BRIGHTNESS_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_brightness_init( char *arg );
-
-#endif
index 03073708130b455552521c879e8c703fe758d120..d4dd697cf67ea0e4016b886e618c781c33688eb7 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_channelcopy.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -82,7 +81,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_channelcopy_init( char *arg )
+mlt_filter filter_channelcopy_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_channelcopy.h b/src/modules/core/filter_channelcopy.h
deleted file mode 100644 (file)
index 9407e2d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_channelcopy.h -- copy audio channel from one to another
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_CHANNELCOPY_H_
-#define _FILTER_CHANNELCOPY_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_channelcopy_init( char *arg );
-
-#endif
diff --git a/src/modules/core/filter_data.h b/src/modules/core/filter_data.h
deleted file mode 100644 (file)
index 3e9d249..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * filter_data.h -- data feed and show filters
- * Copyright (C) 2004-2005 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _MLT_FILTER_DATA_H_
-#define _MLT_FILTER_DATA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_data_feed_init( char * );
-extern mlt_filter filter_data_show_init( char * );
-
-#endif
-
index bc9860539ed0cd455916e8e366e8c1d28735f287..e3cf81d34b2e744dd27c149fba43144085ad8c12 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include "filter_data.h"
 #include <framework/mlt.h>
 
 /** This filter should be used in conjuction with the data_show filter.
@@ -155,7 +154,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_data_feed_init( char *arg )
+mlt_filter filter_data_feed_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create the filter
        mlt_filter this = mlt_filter_new( );
index 3dfd7cb914cb4c830088a622bfee090ece6f946d..7c9ab3d606c0dbd9da87e364a81be7007b0a56ee 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_data.h"
 #include <framework/mlt.h>
 #include <stdlib.h>
 #include <string.h>
@@ -72,7 +71,7 @@ static mlt_filter obtain_filter( mlt_filter filter, char *type )
                        char *value = mlt_properties_get_value( profile_properties, i );
        
                        if ( result == NULL && !strcmp( name, type ) && result == NULL )
-                               result = mlt_factory_filter( value, NULL );
+                               result = mlt_factory_filter( mlt_service_profile( MLT_FILTER_SERVICE( 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 );
                        else if ( result != NULL )
@@ -321,7 +320,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_data_show_init( char *arg )
+mlt_filter filter_data_show_init( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        // Create the filter
        mlt_filter this = mlt_filter_new( );
index 710cbaa06eb6709830eec1e78ec979593dce38ec..e4fe15b3dd491c4c0389519f79dcd88618722ef2 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_gamma.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -77,7 +76,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_gamma_init( char *arg )
+mlt_filter filter_gamma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_gamma.h b/src/modules/core/filter_gamma.h
deleted file mode 100644 (file)
index 91c1339..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_gamma.h -- gamma filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_GAMMA_H_
-#define _FILTER_GAMMA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_gamma_init( char *arg );
-
-#endif
index d799e72d1ac320e8af2e1950686101655a1965d6..fd618c09aa02140c0e42dfbebde81b196f4fc466 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_greyscale.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -53,7 +52,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_greyscale_init( void *arg )
+mlt_filter filter_greyscale_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_greyscale.h b/src/modules/core/filter_greyscale.h
deleted file mode 100644 (file)
index c1056aa..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_greyscale.h -- greyscale filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_GREYSCALE_H_
-#define _FILTER_GREYSCALE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_greyscale_init( void *arg );
-
-#endif
index 0e2afdb2e4dea1c506b1ed1aad5d2a7e6ddfbacf..f2e11567097ea915aff94c5f2a260b5c0e93eadf 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_luma.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_factory.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_producer.h>
@@ -48,7 +47,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
        if ( luma == NULL )
        {
                char *resource = mlt_properties_get( properties, "resource" );
-               luma = mlt_factory_transition( "luma", resource );
+               mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
+               luma = mlt_factory_transition( profile, "luma", resource );
                if ( luma != NULL )
                {
                        mlt_properties luma_properties = MLT_TRANSITION_PROPERTIES( luma );
@@ -61,7 +61,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
 
        if ( b_frame == NULL || mlt_properties_get_int( b_frame_props, "width" ) != *width || mlt_properties_get_int( b_frame_props, "height" ) != *height )
        {
-               b_frame = mlt_frame_init( );
+               b_frame = mlt_frame_init( MLT_FILTER_SERVICE( filter ) );
                mlt_properties_set_data( properties, "frame", b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
        }
 
@@ -114,7 +114,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_luma_init( void *arg )
+mlt_filter filter_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_luma.h b/src/modules/core/filter_luma.h
deleted file mode 100644 (file)
index 2350051..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_luma.h -- luma filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_LUMA_H_
-#define _FILTER_LUMA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_luma_init( void *arg );
-
-#endif
index 9608d2b48fdc57573a15f15595114c472519ebaf..3dd6dbfc11cc1428bc68b64bcd5fcd8c620fbcbe 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_mirror.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -312,7 +311,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_mirror_init( void *arg )
+mlt_filter filter_mirror_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Construct a new filter
        mlt_filter this = mlt_filter_new( );
diff --git a/src/modules/core/filter_mirror.h b/src/modules/core/filter_mirror.h
deleted file mode 100644 (file)
index f8b56d2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_mirror.h -- mirror filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_MIRROR_H_
-#define _FILTER_MIRROR_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_mirror_init( void *arg );
-
-#endif
index 1c6b51294d374f46c8bec857286460546dde04b3..882d6f34bc15f2a0368f8d94f6cb02a6a9c7c692 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_mono.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -80,7 +79,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_mono_init( char *arg )
+mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_mono.h b/src/modules/core/filter_mono.h
deleted file mode 100644 (file)
index e0cfb69..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_mono.h -- mix all channels to a mono signal across n channels
- * Copyright (C) 2003-2006 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_MONO_H_
-#define _FILTER_MONO_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_mono_init( char *arg );
-
-#endif
index ccd108a3e70af7e3b24882da07863ab6f6c9abd5..7256f6ccac9b9bb4782429081ef843e4f85f63d0 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_obscure.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -295,7 +294,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_obscure_init( void *arg )
+mlt_filter filter_obscure_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_obscure.h b/src/modules/core/filter_obscure.h
deleted file mode 100644 (file)
index 48b3850..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_obscure.h -- obscure filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_OBSCURE_H_
-#define _FILTER_OBSCURE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_obscure_init( void *arg );
-
-#endif
index 392faecaefef2e18eb4da338df1f39b395d28ba8..8fd8e8d6ab84e78a236e06dd2c58471471c39b04 100644 (file)
@@ -18,9 +18,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_region.h"
 #include "transition_region.h"
 
+#include <framework/mlt_filter.h>
 #include <framework/mlt.h>
 
 #include <stdio.h>
@@ -42,7 +42,8 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
        if ( transition == NULL )
        {
                // Create the transition
-               transition = mlt_factory_transition( "region", NULL );
+               mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( this ) );
+               transition = mlt_factory_transition( profile, "region", NULL );
 
                // Register with the filter
                mlt_properties_set_data( properties, "_transition", transition, 0, ( mlt_destructor )mlt_transition_close, NULL );
@@ -61,7 +62,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_region_init( void *arg )
+mlt_filter filter_region_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create a new filter
        mlt_filter this = mlt_filter_new( );
diff --git a/src/modules/core/filter_region.h b/src/modules/core/filter_region.h
deleted file mode 100644 (file)
index de30722..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_region.h -- region filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_REGION_H_
-#define _FILTER_REGION_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_region_init( void *arg );
-
-#endif
index e823616666b093a0ab77e15eea713513561994b0..6251ca89a8d0097b92758f90f1409cb16721b2c2 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_rescale.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -295,7 +294,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_rescale_init( char *arg )
+mlt_filter filter_rescale_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create a new scaler
        mlt_filter this = mlt_filter_new( );
diff --git a/src/modules/core/filter_rescale.h b/src/modules/core/filter_rescale.h
deleted file mode 100644 (file)
index 068b706..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_rescale.h -- scale the producer video frame size to match the consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_RESCALE_H_
-#define _FILTER_RESCALE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_rescale_init( char *arg );
-
-#endif
index 005be7dbd50aaf698ccad9998f553429b693f0b4..128c86b8b4594ce0ff86976d560a97ef05345783 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_resize.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -189,7 +188,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_resize_init( char *arg )
+mlt_filter filter_resize_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 );
        if ( mlt_filter_init( this, this ) == 0 )
diff --git a/src/modules/core/filter_resize.h b/src/modules/core/filter_resize.h
deleted file mode 100644 (file)
index 4e81f81..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_resize.h -- resizing filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_RESIZE_H_
-#define _FILTER_RESIZE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_resize_init( char *arg );
-
-#endif
index 297b6c0a20c1b463d78b2e4d4b949bf487061b99..cd3f4623053ecaf0eb3c6e2e850ef70a536938f4 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_transition.h"
+#include <framework/mlt_filter.h>
 #include <framework/mlt_factory.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_transition.h>
@@ -59,7 +59,8 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
        if ( transition == NULL )
        {
                char *name = mlt_properties_get( MLT_FILTER_PROPERTIES( this ), "transition" );
-               transition = mlt_factory_transition( name, NULL );
+               mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( this ) );
+               transition = mlt_factory_transition( profile, name, NULL );
                mlt_properties_set_data( MLT_FILTER_PROPERTIES( this ), "instance", transition, 0, ( mlt_destructor )mlt_transition_close, NULL );
        }
 
@@ -101,7 +102,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_transition_init( char *arg )
+mlt_filter filter_transition_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_transition.h b/src/modules/core/filter_transition.h
deleted file mode 100644 (file)
index 043636c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_transition.h -- Convert any transition into a filter
- * Copyright (C) 2005 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_TRANSITION_H_
-#define _FILTER_TRANSITION_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_transition_init( char *arg );
-
-#endif
index 41aa7f85bd3b62cba6b305f247459e716b423b56..ce1b0f170ad57244013ddad68410f3cc1a42888a 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_watermark.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_factory.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_producer.h>
@@ -59,7 +58,8 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
        if ( composite == NULL )
        {
                // Create composite via the factory
-               composite = mlt_factory_transition( "composite", NULL );
+               mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( this ) );
+               composite = mlt_factory_transition( profile, "composite", NULL );
 
                // Register the composite for reuse/destruction
                if ( composite != NULL )
@@ -89,7 +89,8 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                char *factory = mlt_properties_get( properties, "factory" );
 
                // Create the producer
-               producer = mlt_factory_producer( factory, resource );
+               mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( this ) );
+               producer = mlt_factory_producer( profile, factory, resource );
 
                // If we have one
                if ( producer != NULL )
@@ -245,7 +246,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_watermark_init( void *arg )
+mlt_filter filter_watermark_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/core/filter_watermark.h b/src/modules/core/filter_watermark.h
deleted file mode 100644 (file)
index 57c6aa6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_watermark.h -- watermark filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_WATERMARK_H_
-#define _FILTER_WATERMARK_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_watermark_init( void *arg );
-
-#endif
index 7eeaac74b4ce111fb1186d6773130f6c184de5f0..c044f416d072cb33788aa50f3662683571fd4f99 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_colour.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_pool.h>
 
@@ -35,7 +35,7 @@ typedef struct
 static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index );
 static void producer_close( mlt_producer parent );
 
-mlt_producer producer_colour_init( char *colour )
+mlt_producer producer_colour_init( mlt_profile profile, mlt_service_type type, const char *id, char *colour )
 {
        mlt_producer producer = calloc( 1, sizeof( struct mlt_producer_s ) );
        if ( producer != NULL && mlt_producer_init( producer, NULL ) == 0 )
@@ -211,7 +211,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
 static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index )
 {
        // Generate a frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
        if ( *frame != NULL )
        {
diff --git a/src/modules/core/producer_colour.h b/src/modules/core/producer_colour.h
deleted file mode 100644 (file)
index 63e27bb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_colour.h -- raster image loader based upon gdk-pixbuf
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_COLOUR_H_
-#define _PRODUCER_COLOUR_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_colour_init( char *filename );
-
-#endif
index 996721d572120df5fec26df276dd7c20994ee37b..825f5912493f3def1b37289bad2838681275c373 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_noise.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_pool.h>
 
@@ -47,7 +47,7 @@ static void producer_close( mlt_producer this );
 /** Initialise.
 */
 
-mlt_producer producer_noise_init( void *arg )
+mlt_producer producer_noise_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create a new producer object
        mlt_producer this = mlt_producer_new( );
@@ -138,7 +138,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
 static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
 {
        // Generate a frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
 
        // Check that we created a frame and initialise it
        if ( *frame != NULL )
diff --git a/src/modules/core/producer_noise.h b/src/modules/core/producer_noise.h
deleted file mode 100644 (file)
index a3c6e4d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_noise.h -- noise generating producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_NOISE_H_
-#define _PRODUCER_NOISE_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_noise_init( void *arg );
-
-#endif
index dbd74ac635fdd6d741d96c8a0e89a6d3f5d9c3cc..0121579065dcc265bfaeab8fceb88fc2333bfd7c 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_ppm.h"
-
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 
 #include <stdlib.h>
@@ -39,7 +38,7 @@ struct producer_ppm_s
 static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index );
 static void producer_close( mlt_producer parent );
 
-mlt_producer producer_ppm_init( void *command )
+mlt_producer producer_ppm_init( mlt_profile profile, mlt_service_type type, const char *id, char *command )
 {
        producer_ppm this = calloc( sizeof( struct producer_ppm_s ), 1 );
        if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 )
@@ -208,7 +207,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        int height;
 
        // Construct a test frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
        // Are we at the position expected?
        producer_ppm_position( this, mlt_producer_frame( producer ) );
diff --git a/src/modules/core/producer_ppm.h b/src/modules/core/producer_ppm.h
deleted file mode 100644 (file)
index 45e3c66..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_ppm.h -- simple ppm test case
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_PPM_H_
-#define _PRODUCER_PPM_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_ppm_init( void *command );
-
-#endif
index fdad2cfec6e1fa140aebb428621ec05108baf045..4010e4f270ccbcc03d012754f30e4cdfea419cb5 100644 (file)
@@ -581,7 +581,7 @@ scale_luma ( uint16_t *dest_buf, int dest_width, int dest_height, const uint16_t
        }
 }
 
-static uint16_t* get_luma( mlt_properties properties, int width, int height )
+static uint16_t* get_luma( mlt_transition this, mlt_properties properties, int width, int height )
 {
        // The cached luma map information
        int luma_width = mlt_properties_get_int( properties, "_luma.width" );
@@ -647,7 +647,8 @@ static uint16_t* get_luma( mlt_properties properties, int width, int height )
                                char *factory = mlt_properties_get( properties, "factory" );
        
                                // Create the producer
-                               mlt_producer producer = mlt_factory_producer( factory, resource );
+                               mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( this ) );
+                               mlt_producer producer = mlt_factory_producer( profile, factory, resource );
        
                                // If we have one
                                if ( producer != NULL )
@@ -857,7 +858,7 @@ static mlt_geometry composite_calculate( mlt_transition this, struct geometry_s
 mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_position frame_position )
 {
        // Create a frame to return
-       mlt_frame b_frame = mlt_frame_init( );
+       mlt_frame b_frame = mlt_frame_init( MLT_TRANSITION_SERVICE( this ) );
 
        // Get the properties of the a frame
        mlt_properties a_props = MLT_FRAME_PROPERTIES( a_frame );
@@ -1099,7 +1100,7 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                        int field;
                        
                        int32_t luma_softness = mlt_properties_get_double( properties, "softness" ) * ( 1 << 16 );
-                       uint16_t *luma_bitmap = get_luma( properties, width_b, height_b );
+                       uint16_t *luma_bitmap = get_luma( this, properties, width_b, height_b );
                        char *operator = mlt_properties_get( properties, "operator" );
 
                        alpha_b = alpha_b == NULL ? mlt_frame_get_alpha_mask( b_frame ) : alpha_b;
@@ -1190,7 +1191,7 @@ static mlt_frame composite_process( mlt_transition this, mlt_frame a_frame, mlt_
 /** Constructor for the filter.
 */
 
-mlt_transition transition_composite_init( char *arg )
+mlt_transition transition_composite_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_transition this = calloc( sizeof( struct mlt_transition_s ), 1 );
        if ( this != NULL && mlt_transition_init( this, NULL ) == 0 )
index 70d2abd682c964066c0be86a572a92cc32ee8005..6523b95b4f5e3d007e48fd55c283d874174013de 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <framework/mlt_transition.h>
 
-extern mlt_transition transition_composite_init( char *arg );
+extern mlt_transition transition_composite_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
 // Courtesy functionality - allows regionalised filtering
 extern mlt_frame composite_copy_region( mlt_transition, mlt_frame, mlt_position );
index 4b87b2ae675b7b8b7079ac04eeb67eab2f0acb09..a553836c14216bda80e8825f471663e39b1aa1e7 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "transition_luma.h"
 #include <framework/mlt.h>
 
 #include <stdio.h>
@@ -431,7 +430,8 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                        char *factory = mlt_properties_get( properties, "factory" );
 
                        // Create the producer
-                       mlt_producer producer = mlt_factory_producer( factory, resource );
+                       mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( transition ) );
+                       mlt_producer producer = mlt_factory_producer( profile, factory, resource );
 
                        // If we have one
                        if ( producer != NULL )
@@ -563,7 +563,7 @@ static mlt_frame transition_process( mlt_transition transition, mlt_frame a_fram
 /** Constructor for the filter.
 */
 
-mlt_transition transition_luma_init( char *lumafile )
+mlt_transition transition_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *lumafile )
 {
        mlt_transition transition = mlt_transition_new( );
        if ( transition != NULL )
diff --git a/src/modules/core/transition_luma.h b/src/modules/core/transition_luma.h
deleted file mode 100644 (file)
index 1b78c5e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * transition_luma.h -- a generic dissolve/wipe processor
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _TRANSITION_LUMA_H_
-#define _TRANSITION_LUMA_H_
-
-#include <framework/mlt_transition.h>
-
-extern mlt_transition transition_luma_init( char *lumafile );
-
-#endif
index 1dfda2e8236032513fc069273342dd279ec946cc..d3bad10c0fc33c471dd3265fa86537c3c5c22b5e 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "transition_mix.h"
+#include <framework/mlt_transition.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -150,7 +150,7 @@ static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt
 /** Constructor for the transition.
 */
 
-mlt_transition transition_mix_init( char *arg )
+mlt_transition transition_mix_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_transition this = calloc( sizeof( struct mlt_transition_s ), 1 );
        if ( this != NULL && mlt_transition_init( this, NULL ) == 0 )
diff --git a/src/modules/core/transition_mix.h b/src/modules/core/transition_mix.h
deleted file mode 100644 (file)
index 2987fd9..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * transition_mix.h -- mix two audio streams
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _TRANSITION_MIX_H_
-#define _TRANSITION_MIX_H_
-
-#include <framework/mlt_transition.h>
-
-extern mlt_transition transition_mix_init( char *arg );
-
-#endif
index 59c856daa60e585685d4f529aa1d4a027138735e..77878dd1f83b9a5ac9c2cad13bd77f149832fa2b 100644 (file)
@@ -46,7 +46,8 @@ static int create_instance( mlt_transition this, char *name, char *value, int co
                *arg ++ = '\0';
 
        // Create the filter
-       filter = mlt_factory_filter( type, arg );
+       mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( this ) );
+       filter = mlt_factory_filter( profile, type, arg );
 
        // If we have a filter, then initialise and store it
        if ( filter != NULL )
@@ -167,7 +168,8 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
        if ( composite == NULL )
        {
                // Create composite via the factory
-               composite = mlt_factory_transition( "composite", NULL );
+               mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( this ) );
+               composite = mlt_factory_transition( profile, "composite", NULL );
 
                // If we have one
                if ( composite != NULL )
@@ -344,8 +346,9 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                                        mlt_properties_set( properties, "producer.resource", "<svg width='100' height='100'><circle cx='50' cy='50' r='50' fill='black'/></svg>" );
                                }
 
-                               // Create the producer 
-                               producer = mlt_factory_producer( factory, resource );
+                               // Create the producer
+                               mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( this ) );
+                               producer = mlt_factory_producer( profile, factory, resource );
 
                                // If we have one
                                if ( producer != NULL )
@@ -422,7 +425,7 @@ static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt
 /** Constructor for the transition.
 */
 
-mlt_transition transition_region_init( void *arg )
+mlt_transition transition_region_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create a new transition
        mlt_transition this = mlt_transition_new( );
index 98abdc4c93c2a4767023348077416619d86e9565..f08ad0e1307e0a4bc828567fd3ed8b4160613747 100644 (file)
@@ -23,6 +23,6 @@
 
 #include <framework/mlt_transition.h>
 
-extern mlt_transition transition_region_init( void *arg );
+extern mlt_transition transition_region_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
 #endif
index f6c468e33715ca0e4544586ac62e402fb5f0a933..2ee9b2066ce9751f918a9b2d6fef07ca6e55d16d 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// Local header files
-#include "consumer_libdv.h"
-#include "producer_libdv.h"
-
 // mlt Header files
+#include <framework/mlt_consumer.h>
 #include <framework/mlt_frame.h>
 
 // System header files
@@ -34,6 +31,9 @@
 // libdv header files
 #include <libdv/dv.h>
 
+#define FRAME_SIZE_525_60      10 * 150 * 80
+#define FRAME_SIZE_625_50      12 * 150 * 80
+
 // Forward references.
 static int consumer_start( mlt_consumer this );
 static int consumer_stop( mlt_consumer this );
@@ -47,13 +47,13 @@ static void consumer_close( mlt_consumer this );
 /** Initialise the dv consumer.
 */
 
-mlt_consumer consumer_libdv_init( char *arg )
+mlt_consumer consumer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Allocate the consumer
        mlt_consumer this = calloc( 1, sizeof( struct mlt_consumer_s ) );
 
        // If memory allocated and initialises without error
-       if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 )
+       if ( this != NULL && mlt_consumer_init( this, NULL, profile ) == 0 )
        {
                // Get properties from the consumer
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
diff --git a/src/modules/dv/consumer_libdv.h b/src/modules/dv/consumer_libdv.h
deleted file mode 100644 (file)
index 5d46416..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_libdv.h -- a DV encoder based on libdv
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _CONSUMER_LIBDV_H_
-#define _CONSUMER_LIBDV_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_libdv_init( char *filename );
-
-#endif
index 26f40050f92634fdad51839aa000a208a02fe0c6..694032cf5293ca53c038e856939899587ba1f1f2 100644 (file)
 
 #include <string.h>
 
-#include "producer_libdv.h"
-#include "consumer_libdv.h"
+#include <framework/mlt_consumer.h>
+#include <framework/mlt_producer.h>
 
-void *mlt_create_producer( char *id, void *arg )
+extern mlt_consumer consumer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+
+
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "libdv" ) )
-               return producer_libdv_init( arg );
+               return producer_libdv_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "libdv" ) )
-               return consumer_libdv_init( arg );
+               return consumer_libdv_init( profile, type, id, arg );
        return NULL;
 }
 
index a7c10b34dc3a1e8cdf88470c1f2c9e4ad2577f0f..b593b5337bd3cf0ad5242831096d4963df998958 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_libdv.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_deque.h>
 #include <framework/mlt_factory.h>
@@ -32,6 +32,9 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#define FRAME_SIZE_525_60      10 * 150 * 80
+#define FRAME_SIZE_625_50      12 * 150 * 80
+
 /** To conserve resources, we maintain a stack of dv decoders.
 */
 
@@ -131,7 +134,7 @@ static void producer_close( mlt_producer parent );
 
 static int producer_collect_info( producer_libdv this );
 
-mlt_producer producer_libdv_init( char *filename )
+mlt_producer producer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *filename )
 {
        producer_libdv this = calloc( sizeof( struct producer_libdv_s ), 1 );
 
@@ -156,7 +159,8 @@ mlt_producer producer_libdv_init( char *filename )
                         strncasecmp( strrchr( filename, '.' ), ".mov", 4 ) == 0 ) )
                {
                        // Load via an alternative mechanism
-                       this->alternative = mlt_factory_producer( "kino", filename );
+                       mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( producer ) );
+                       this->alternative = mlt_factory_producer( profile, "kino", filename );
 
                        // If it's unavailable, then clean up
                        if ( this->alternative == NULL )
@@ -427,7 +431,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                data = mlt_pool_alloc( FRAME_SIZE_625_50 );
 
                // Create an empty frame
-               *frame = mlt_frame_init( );
+               *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
                // Seek and fetch
                if ( this->fd != 0 && 
diff --git a/src/modules/dv/producer_libdv.h b/src/modules/dv/producer_libdv.h
deleted file mode 100644 (file)
index a6b1b1a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * producer_libdv.h -- a DV decoder based on libdv
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_LIBDV_H_
-#define _PRODUCER_LIBDV_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_libdv_init( char *filename );
-
-#define FRAME_SIZE_525_60      10 * 150 * 80
-#define FRAME_SIZE_625_50      12 * 150 * 80
-
-#endif
index 06320d8cd6e142612d1daac2692752cc0951dbee..2092b40aa719602e7fd5741201e07c7d98fe2afc 100644 (file)
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <framework/mlt.h>
 #include <string.h>
 
-#include "filter_burn.h"
+extern mlt_filter filter_burn_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "BurningTV" ) )
-               return filter_burn_init( arg );
+               return filter_burn_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index d5a579b56c1bd863967e4399d83154773941f95c..967e263091554e73beb82ba331e86a41d4540bfd 100644 (file)
@@ -26,8 +26,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_burn.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -196,7 +195,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_burn_init( char *arg )
+mlt_filter filter_burn_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/effectv/filter_burn.h b/src/modules/effectv/filter_burn.h
deleted file mode 100644 (file)
index 8c8e731..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * filter_brun.h -- burning filter
- * Copyright (C) 2007 Stephane Fillod
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_BURN_H_
-#define _FILTER_BURN_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_burn_init( char *arg );
-
-#endif
index bda4980b59b4773f611487cbddafd05a473fd3ac..33bfb079ea1e5d7bb55771445ba82874b300602f 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <framework/mlt.h>
 #include <string.h>
 
-#include "producer_fezzik.h"
-#include "producer_hold.h"
+extern mlt_producer producer_fezzik_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "fezzik" ) )
-               return producer_fezzik_init( arg );
+               return producer_fezzik_init( profile, type, id, arg );
        if ( !strcmp( id, "hold" ) )
-               return producer_hold_init( arg );
+               return producer_hold_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 0d461686e5152e08d83974ef86fb8e5842df7776..f5350c82aac18339d9b6df9ad5c6768fd1ce1137 100644 (file)
@@ -18,8 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_fezzik.h"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -31,7 +29,7 @@
 static mlt_properties dictionary = NULL;
 static mlt_properties normalisers = NULL;
 
-static mlt_producer create_from( char *file, char *services )
+static mlt_producer create_from( mlt_profile profile, char *file, char *services )
 {
        mlt_producer producer = NULL;
        char *temp = strdup( services );
@@ -41,7 +39,7 @@ static mlt_producer create_from( char *file, char *services )
                char *p = strchr( service, ',' );
                if ( p != NULL )
                        *p ++ = '\0';
-               producer = mlt_factory_producer( service, file );
+               producer = mlt_factory_producer( profile, service, file );
                service = p;
        }
        while ( producer == NULL && service != NULL );
@@ -49,7 +47,7 @@ static mlt_producer create_from( char *file, char *services )
        return producer;
 }
 
-static mlt_producer create_producer( char *file )
+static mlt_producer create_producer( mlt_profile profile, char *file )
 {
        mlt_producer result = NULL;
 
@@ -60,7 +58,7 @@ static mlt_producer create_producer( char *file )
                char *service = temp;
                char *resource = strchr( temp, ':' );
                *resource ++ = '\0';
-               result = mlt_factory_producer( service, resource );
+               result = mlt_factory_producer( profile, service, resource );
                free( temp );
        }
 
@@ -92,7 +90,7 @@ static mlt_producer create_producer( char *file )
                {
                        char *name = mlt_properties_get_name( dictionary, i );
                        if ( fnmatch( name, lookup, 0 ) == 0 )
-                               result = create_from( file, mlt_properties_get_value( dictionary, i ) );
+                               result = create_from( profile, file, mlt_properties_get_value( dictionary, i ) );
                }
 
                free( lookup );
@@ -100,18 +98,18 @@ static mlt_producer create_producer( char *file )
 
        // Finally, try just loading as service
        if ( result == NULL )
-               result = mlt_factory_producer( file, NULL );
+               result = mlt_factory_producer( profile, file, NULL );
 
        return result;
 }
 
-static void create_filter( mlt_producer producer, char *effect, int *created )
+static void create_filter( mlt_profile profile, mlt_producer producer, char *effect, int *created )
 {
        char *id = strdup( effect );
        char *arg = strchr( id, ':' );
        if ( arg != NULL )
                *arg ++ = '\0';
-       mlt_filter filter = mlt_factory_filter( id, arg );
+       mlt_filter filter = mlt_factory_filter( profile, id, arg );
        if ( filter != NULL )
        {
                mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik", 1 );
@@ -122,7 +120,7 @@ static void create_filter( mlt_producer producer, char *effect, int *created )
        free( id );
 }
 
-static void attach_normalisers( mlt_producer producer )
+static void attach_normalisers( mlt_profile profile, mlt_producer producer )
 {
        // Loop variable
        int i;
@@ -147,28 +145,28 @@ static void attach_normalisers( mlt_producer producer )
                char *value = mlt_properties_get_value( normalisers, i );
                mlt_tokeniser_parse_new( tokeniser, value, "," );
                for ( j = 0; !created && j < mlt_tokeniser_count( tokeniser ); j ++ )
-                       create_filter( producer, mlt_tokeniser_get_string( tokeniser, j ), &created );
+                       create_filter( profile, producer, mlt_tokeniser_get_string( tokeniser, j ), &created );
        }
 
        // Close the tokeniser
        mlt_tokeniser_close( tokeniser );
 }
 
-mlt_producer producer_fezzik_init( char *arg )
+mlt_producer producer_fezzik_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create the producer 
        mlt_producer producer = NULL;
        mlt_properties properties = NULL;
 
        if ( arg != NULL )
-               producer = create_producer( arg );
+               producer = create_producer( profile, arg );
 
        if ( producer != NULL )
                properties = MLT_PRODUCER_PROPERTIES( producer );
 
        // Attach filters if we have a producer and it isn't already westley'd :-)
        if ( producer != NULL && mlt_properties_get( properties, "westley" ) == NULL && mlt_properties_get( properties, "_westley" ) == NULL )
-               attach_normalisers( producer );
+               attach_normalisers( profile, producer );
 
        // Now make sure we don't lose our identity
        if ( properties != NULL )
diff --git a/src/modules/fezzik/producer_fezzik.h b/src/modules/fezzik/producer_fezzik.h
deleted file mode 100644 (file)
index fbf5cee..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_fezzik.h -- a normalising producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_FEZZIK_H_
-#define _PRODUCER_FEZZIK_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_fezzik_init( char *args );
-
-#endif
index 9632932d1be76578616fa21ddfb0ff5c3908a17f..f30aa0c3fcf54ad59ccb87472265c157f18b38da 100644 (file)
@@ -18,8 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_hold.h"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -36,13 +34,13 @@ static void producer_close( mlt_producer this );
        and get_image requested.
 */
 
-mlt_producer producer_hold_init( char *arg )
+mlt_producer producer_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Construct a new holding producer
        mlt_producer this = mlt_producer_new( );
 
        // Construct the requested producer via fezzik
-       mlt_producer producer = mlt_factory_producer( "fezzik", arg );
+       mlt_producer producer = mlt_factory_producer( profile, "fezzik", arg );
 
        // Initialise the frame holding capabilities
        if ( this != NULL && producer != NULL )
@@ -143,7 +141,7 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
        mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
 
        // Construct a new frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
 
        // If we have a frame, then stack the producer itself and the get_image method
        if ( *frame != NULL )
diff --git a/src/modules/fezzik/producer_hold.h b/src/modules/fezzik/producer_hold.h
deleted file mode 100644 (file)
index fe63637..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_hold.h -- a frame holding producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_HOLD_H_
-#define _PRODUCER_HOLD_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_hold_init( char *args );
-
-#endif
index d1232b011c249b6cfafee26a95f11a44021cc31e..dc1619e334ede17dc62b42225a76a04f37822f20 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "consumer_gtk2.h"
-
 #include <stdlib.h>
 #include <framework/mlt_consumer.h>
 #include <framework/mlt_factory.h>
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
+#include <gtk/gtk.h>
 
-mlt_consumer consumer_gtk2_preview_init( GtkWidget *widget )
+mlt_consumer consumer_gtk2_preview_init( mlt_profile profile, GtkWidget *widget )
 {
        // Create an sdl preview consumer
        mlt_consumer consumer = NULL;
@@ -41,7 +40,7 @@ mlt_consumer consumer_gtk2_preview_init( GtkWidget *widget )
        }
 
        // Create an sdl preview consumer
-       consumer = mlt_factory_consumer( "sdl_preview", NULL );
+       consumer = mlt_factory_consumer( profile, "sdl_preview", NULL );
 
        // Now assign the lock/unlock callbacks
        if ( consumer != NULL )
diff --git a/src/modules/gtk2/consumer_gtk2.h b/src/modules/gtk2/consumer_gtk2.h
deleted file mode 100644 (file)
index 35707a3..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * consumer_gtk2.h -- A consumer for GTK2 apps
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _CONSUMER_GTK2_PREVIEW_H
-#define _CONSUMER_GTK2_PREVIEW_H
-
-#include <framework/mlt_consumer.h>
-#include <gtk/gtk.h>
-
-extern mlt_consumer consumer_gtk2_preview_init( GtkWidget *widget );
-
-#endif
index be50416909f8d5cf1b05061a3a497740bb7ef8b5..8b5e1123002c225a83c9f2100c2a877223b02e9d 100644 (file)
 
 #include "config.h"
 #include <string.h>
+#include <framework/mlt.h>
+#include <gdk/gdk.h>
 
 #ifdef USE_PIXBUF
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include "producer_pixbuf.h"
-#include "filter_rescale.h"
+extern mlt_producer producer_pixbuf_init( char *filename );
+extern mlt_filter filter_rescale_init( mlt_profile profile, char *arg );
 #endif
 
 #ifdef USE_GTK2
-#include "consumer_gtk2.h"
+extern mlt_consumer consumer_gtk2_preview_init( mlt_profile profile, void *widget );
 #endif
 
 #ifdef USE_PANGO
-#include "producer_pango.h"
+extern mlt_producer producer_pango_init( const char *filename );
 #endif
 
 static void initialise( )
@@ -45,7 +46,7 @@ static void initialise( )
        }
 }
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        initialise( );
 
@@ -62,30 +63,30 @@ void *mlt_create_producer( char *id, void *arg )
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        initialise( );
 
 #ifdef USE_PIXBUF
        if ( !strcmp( id, "gtkrescale" ) )
-               return filter_rescale_init( arg );
+               return filter_rescale_init( profile, arg );
 #endif
 
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        initialise( );
 
 #ifdef USE_GTK2
        if ( !strcmp( id, "gtk2_preview" ) )
-               return consumer_gtk2_preview_init( arg );
+               return consumer_gtk2_preview_init( profile, arg );
 #endif
 
        return NULL;
index 774c0d682f515c6ac9b073cf5df2387a41c085d1..e3b6d17a8f81a3d64978f1ad5c2181548dbfb821 100644 (file)
@@ -18,9 +18,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_rescale.h"
 #include "pixops.h"
 
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_factory.h>
 
@@ -135,10 +135,10 @@ static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format iform
 /** Constructor for the filter.
 */
 
-mlt_filter filter_rescale_init( char *arg )
+mlt_filter filter_rescale_init( mlt_profile profile, char *arg )
 {
        // Create a new scaler
-       mlt_filter this = mlt_factory_filter( "rescale", arg );
+       mlt_filter this = mlt_factory_filter( profile, "rescale", arg );
 
        // If successful, then initialise it
        if ( this != NULL )
diff --git a/src/modules/gtk2/filter_rescale.h b/src/modules/gtk2/filter_rescale.h
deleted file mode 100644 (file)
index 068b706..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_rescale.h -- scale the producer video frame size to match the consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_RESCALE_H_
-#define _FILTER_RESCALE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_rescale_init( char *arg );
-
-#endif
index 52bf2ff20bb12454769a6ffd752b64c900429b61..2368d3ecc13cfae3c0b19e061b7e1a657ea16ec7 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_pango.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_geometry.h>
 #include <stdlib.h>
 #include <pthread.h>
 #include <ctype.h>
 
+typedef struct producer_pango_s *producer_pango;
+
+typedef enum
+{
+       pango_align_left = 0,
+       pango_align_center,
+       pango_align_right
+} pango_align;
+
 static pthread_mutex_t pango_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 struct producer_pango_s
@@ -544,7 +553,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        producer_pango this = producer->child;
 
        // Generate a frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
        // Obtain properties of frame and producer
        mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
diff --git a/src/modules/gtk2/producer_pango.h b/src/modules/gtk2/producer_pango.h
deleted file mode 100644 (file)
index 8295131..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * producer_pango.h -- a pango-based titler
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_PANGO_H_
-#define _PRODUCER_PANGO_H_
-
-#include <framework/mlt_producer.h>
-
-typedef struct producer_pango_s *producer_pango;
-
-typedef enum
-{
-       pango_align_left = 0,
-       pango_align_center,
-       pango_align_right
-} pango_align;
-
-extern mlt_producer producer_pango_init( const char *filename );
-
-#endif
index a5c559c21c6febf0be434b3ed4a9af3e35c088a5..052f01b1e48dc2ad251a6f7c42fb36252448a07b 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_pixbuf.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
@@ -254,7 +254,7 @@ static void refresh_image( mlt_frame frame, int width, int height )
 
        if ( update_cache )
        {
-               mlt_frame cached = mlt_frame_init( );
+               mlt_frame cached = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
                mlt_properties cached_props = MLT_FRAME_PROPERTIES( cached );
                mlt_properties_set_int( cached_props, "width", this->width );
                mlt_properties_set_int( cached_props, "height", this->height );
@@ -448,7 +448,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        }
 
        // Generate a frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
        if ( *frame != NULL && this->count > 0 )
        {
diff --git a/src/modules/gtk2/producer_pixbuf.h b/src/modules/gtk2/producer_pixbuf.h
deleted file mode 100644 (file)
index 47d9624..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_pixbuf.h -- raster image loader based upon gdk-pixbuf
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef _PRODUCER_PIXBUF_H_
-#define _PRODUCER_PIXBUF_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_pixbuf_init( char *filename );
-
-#endif
index f4488fe6a0d012c20957063b58600853d4c978fc..ef8efcd18c84696db7e87987df9d6dd37c0e26d9 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "producer_inigo.h"
+extern mlt_producer producer_inigo_file_init( mlt_profile profile, char *file );
+extern mlt_producer producer_inigo_init( mlt_profile profile, char **argv );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        if ( !strcmp( id, "inigo_file" ) )
-               return producer_inigo_file_init( arg );
+               return producer_inigo_file_init( profile, arg );
        if ( !strcmp( id, "inigo" ) )
-               return producer_inigo_init( arg );
+               return producer_inigo_init( profile, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 6de55781299f453dd609778084d769a97ea7b0a4..1970f9c212b7bc4249d3f46e94e0998468089eaf 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_inigo.h"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include <framework/mlt.h>
 
-mlt_producer producer_inigo_file_init( char *file )
+mlt_producer producer_inigo_init( mlt_profile profile, char **argv );
+
+mlt_producer producer_inigo_file_init( mlt_profile profile, char *file )
 {
        FILE *input = fopen( file, "r" );
        char **args = calloc( sizeof( char * ), 1000 );
@@ -43,7 +43,7 @@ mlt_producer producer_inigo_file_init( char *file )
                }
        }
 
-       mlt_producer result = producer_inigo_init( args );
+       mlt_producer result = producer_inigo_init( profile, args );
 
        if ( result != NULL )
        {
@@ -67,9 +67,9 @@ static void track_service( mlt_field field, void *service, mlt_destructor destru
        mlt_properties_set_int( properties, "registered", ++ registered );
 }
 
-static mlt_producer create_producer( mlt_field field, char *file )
+static mlt_producer create_producer( mlt_profile profile, mlt_field field, char *file )
 {
-       mlt_producer result = mlt_factory_producer( "fezzik", file );
+       mlt_producer result = mlt_factory_producer( profile, "fezzik", file );
 
        if ( result != NULL )
                track_service( field, result, ( mlt_destructor )mlt_producer_close );
@@ -77,26 +77,26 @@ static mlt_producer create_producer( mlt_field field, char *file )
        return result;
 }
 
-static mlt_filter create_attach( mlt_field field, char *id, int track )
+static mlt_filter create_attach( mlt_profile profile, mlt_field field, char *id, int track )
 {
        char *temp = strdup( id );
        char *arg = strchr( temp, ':' );
        if ( arg != NULL )
                *arg ++ = '\0';
-       mlt_filter filter = mlt_factory_filter( temp, arg );
+       mlt_filter filter = mlt_factory_filter( profile, temp, arg );
        if ( filter != NULL )
                track_service( field, filter, ( mlt_destructor )mlt_filter_close );
        free( temp );
        return filter;
 }
 
-static mlt_filter create_filter( mlt_field field, char *id, int track )
+static mlt_filter create_filter( mlt_profile profile, mlt_field field, char *id, int track )
 {
        char *temp = strdup( id );
        char *arg = strchr( temp, ':' );
        if ( arg != NULL )
                *arg ++ = '\0';
-       mlt_filter filter = mlt_factory_filter( temp, arg );
+       mlt_filter filter = mlt_factory_filter( profile, temp, arg );
        if ( filter != NULL )
        {
                mlt_field_plant_filter( field, filter, track );
@@ -106,12 +106,12 @@ static mlt_filter create_filter( mlt_field field, char *id, int track )
        return filter;
 }
 
-static mlt_transition create_transition( mlt_field field, char *id, int track )
+static mlt_transition create_transition( mlt_profile profile, mlt_field field, char *id, int track )
 {
        char *arg = strchr( id, ':' );
        if ( arg != NULL )
                *arg ++ = '\0';
-       mlt_transition transition = mlt_factory_transition( id, arg );
+       mlt_transition transition = mlt_factory_transition( profile, id, arg );
        if ( transition != NULL )
        {
                mlt_field_plant_transition( field, transition, track, track + 1 );
@@ -120,7 +120,7 @@ static mlt_transition create_transition( mlt_field field, char *id, int track )
        return transition;
 }
 
-mlt_producer producer_inigo_init( char **argv )
+mlt_producer producer_inigo_init( mlt_profile profile, char **argv )
 {
        int i;
        int track = 0;
@@ -162,7 +162,7 @@ mlt_producer producer_inigo_init( char **argv )
                        int type = !strcmp( argv[ i ], "-attach" ) ? 0 : 
                                           !strcmp( argv[ i ], "-attach-cut" ) ? 1 : 
                                           !strcmp( argv[ i ], "-attach-track" ) ? 2 : 3;
-                       mlt_filter filter = create_attach( field, argv[ ++ i ], track );
+                       mlt_filter filter = create_attach( profile, field, argv[ ++ i ], track );
                        if ( producer != NULL && !mlt_producer_is_cut( producer ) )
                        {
                                mlt_playlist_clip_info info;
@@ -315,7 +315,7 @@ mlt_producer producer_inigo_init( char **argv )
                                mlt_transition transition = NULL;
                                if ( arg != NULL )
                                        *arg ++ = '\0';
-                               transition = mlt_factory_transition( id, arg );
+                               transition = mlt_factory_transition( profile, id, arg );
                                if ( transition != NULL )
                                {
                                        properties = MLT_TRANSITION_PROPERTIES( transition );
@@ -334,7 +334,7 @@ mlt_producer producer_inigo_init( char **argv )
                }
                else if ( !strcmp( argv[ i ], "-filter" ) )
                {
-                       mlt_filter filter = create_filter( field, argv[ ++ i ], track );
+                       mlt_filter filter = create_filter( profile, field, argv[ ++ i ], track );
                        if ( filter != NULL )
                        {
                                properties = MLT_FILTER_PROPERTIES( filter );
@@ -343,7 +343,7 @@ mlt_producer producer_inigo_init( char **argv )
                }
                else if ( !strcmp( argv[ i ], "-transition" ) )
                {
-                       mlt_transition transition = create_transition( field, argv[ ++ i ], track - 1 );
+                       mlt_transition transition = create_transition( profile, field, argv[ ++ i ], track - 1 );
                        if ( transition != NULL )
                        {
                                properties = MLT_TRANSITION_PROPERTIES( transition );
@@ -396,7 +396,7 @@ mlt_producer producer_inigo_init( char **argv )
                                mlt_playlist_append( playlist, producer );
                        if ( title == NULL && strstr( argv[ i ], "<?xml" ) != argv[ i ] )
                                title = argv[ i ];
-                       producer = create_producer( field, argv[ i ] );
+                       producer = create_producer( profile, field, argv[ i ] );
                        if ( producer != NULL )
                        {
                                properties = MLT_PRODUCER_PROPERTIES( producer );
@@ -409,6 +409,8 @@ mlt_producer producer_inigo_init( char **argv )
                                i += 2;
                        else if ( !strcmp( argv[ i ], "-consumer" ) )
                                i += 2;
+                       else if ( !strcmp( argv[ i ], "-profile" ) )
+                               i += 2;
 
                        while ( argv[ i ] != NULL && strchr( argv[ i ], '=' ) )
                                i ++;
diff --git a/src/modules/inigo/producer_inigo.h b/src/modules/inigo/producer_inigo.h
deleted file mode 100644 (file)
index 207c0df..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * producer_inigo.h -- simple inigo test case
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_INIGO_H_
-#define _PRODUCER_INIGO_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_inigo_file_init( char *args );
-extern mlt_producer producer_inigo_init( char **args );
-
-#endif
index a5fb16e952c1bd321855182fef146bf23dae30c1..e3121f26e82b70cfedde4c61207c27373590e5c5 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_jackrack.h"
-#include "filter_ladspa.h"
+extern mlt_filter filter_jackrack_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_ladspa_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "jackrack" ) )
-               return filter_jackrack_init( arg );
+               return filter_jackrack_init( profile, type, id, arg );
        else if ( !strcmp( id, "ladspa" ) )
-               return filter_ladspa_init( arg );
+               return filter_ladspa_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 0715ec153b64eaebbc47ce19b17b96f9a09409b4..0c9fe9bff83e93d4b97fbb63375bddb3319b74ae 100644 (file)
@@ -18,8 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_jackrack.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -337,7 +336,7 @@ static void filter_close( mlt_filter this )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_jackrack_init( char *arg )
+mlt_filter filter_jackrack_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/jackrack/filter_jackrack.h b/src/modules/jackrack/filter_jackrack.h
deleted file mode 100644 (file)
index 2215f05..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_jackrack.h -- filter audio through Jack and/or LADSPA plugins
- * Copyright (C) 2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_JACKRACK_H_
-#define _FILTER_JACKRACK_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_jackrack_init( char *arg );
-
-#endif
index b9b362dd62c8fde5d02e46598930bc44d0a9021b..7eff6fab18569214bac84a51de069680c615dd51 100644 (file)
@@ -18,8 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_ladspa.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -175,7 +174,7 @@ static void filter_close( mlt_filter this )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_ladspa_init( char *arg )
+mlt_filter filter_ladspa_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/jackrack/filter_ladspa.h b/src/modules/jackrack/filter_ladspa.h
deleted file mode 100644 (file)
index 04fc9ed..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_ladspa.h -- filter audio through LADSPA plugins
- * Copyright (C) 2004-2005 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_LADSPA_H_
-#define _FILTER_LADSPA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_ladspa_init( char *arg );
-
-#endif
index 1d83b20f4abcfcea7700db134e49230640af113b..1cc4dc6a262e7bd0f8d2108de90c2e36e01cdd11 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "producer_framebuffer.h"
-#include "filter_boxblur.h"
-#include "filter_wave.h"
+extern mlt_filter filter_boxblur_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_wave_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_framebuffer_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "framebuffer" ) )
-               return producer_framebuffer_init( arg );
+               return producer_framebuffer_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "boxblur" ) )
-               return filter_boxblur_init( arg );
+               return filter_boxblur_init( profile, type, id, arg );
        if ( !strcmp( id, "wave" ) )
-               return filter_wave_init( arg );
+               return filter_wave_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 30d9d58eff6d4cb6b8463057504d8fa3f85a11c4..f2316d0c29eab544d6514c4622b56b675f23ec4b 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * filter_boxblur.c -- blur filter
- * Author: Leny Grisel <leny.grisel@laposte.net>
+ * Copyright (C) ?-2007 Leny Grisel <leny.grisel@laposte.net>
+ * Copyright (C) 2007 Jean-Baptiste Mardelle <jb@ader.ch>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -17,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_boxblur.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -216,7 +216,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_boxblur_init( char *arg )
+mlt_filter filter_boxblur_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/kdenlive/filter_boxblur.h b/src/modules/kdenlive/filter_boxblur.h
deleted file mode 100644 (file)
index f51f953..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * filter_boxblur.h -- box blur filter
- * Author: Leny Grisel <leny.grisel@laposte.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_BOXBLUR_H_
-#define _FILTER_BOXBLUR_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_boxblur_init( char *arg );
-
-#endif
index ac7a9829c40d8be69b256cffdc674e5b2a3ead31..d01944f1521107f4c3081561ec6abef4599fc019 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * wave.c -- wave filter
- * Author: Leny Grisel <leny.grisel@laposte.net>
+ * Copyright (C) ?-2007 Leny Grisel <leny.grisel@laposte.net>
+ * Copyright (C) 2007 Jean-Baptiste Mardelle <jb@ader.ch>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -17,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_wave.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -121,7 +121,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_wave_init( char *arg )
+mlt_filter filter_wave_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/kdenlive/filter_wave.h b/src/modules/kdenlive/filter_wave.h
deleted file mode 100644 (file)
index 10fda12..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * filter_wave.h -- wave filter
- * Author: Leny Grisel <leny.grisel@laposte.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_WAVE_H_
-#define _FILTER_WAVE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_wave_init( char *arg );
-
-#endif
index 4bdf92a04474199ed122e7665600009daef8bffb..bb25ae3fcf1c3133dac84dbd3af651d1b3a6b3cc 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_framebuffer.h"
 #include <framework/mlt.h>
 
 #include <stdio.h>
@@ -109,8 +108,8 @@ static int framebuffer_get_image( mlt_frame this, uint8_t **image, mlt_image_for
 static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
 {
        // Construct a new frame
-       *frame = mlt_frame_init( );
-       mlt_properties properties = MLT_PRODUCER_PROPERTIES(this);
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
+       mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
 
        if( frame != NULL )
        {
@@ -193,12 +192,12 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
 }
 
 
-mlt_producer producer_framebuffer_init( char *arg )
+mlt_producer producer_framebuffer_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
 
        mlt_producer this = NULL;
        this = calloc( 1, sizeof( struct mlt_producer_s ) );
-        mlt_producer_init( this, NULL );
+       mlt_producer_init( this, NULL );
 
        // Wrap fezzik
        mlt_producer real_producer;
@@ -227,7 +226,7 @@ mlt_producer producer_framebuffer_init( char *arg )
        count = strcspn( ptr, ":" );
        ptr[count] = '\0';
 
-       real_producer = mlt_factory_producer( "fezzik", props );
+       real_producer = mlt_factory_producer( profile, "fezzik", props );
 
        ptr += count + 1;
        ptr += strspn( ptr, ":" );
diff --git a/src/modules/kdenlive/producer_framebuffer.h b/src/modules/kdenlive/producer_framebuffer.h
deleted file mode 100644 (file)
index 6c91cd2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * producer_framebuffer.h -- slowmotion and reverse playing
- * Copyright (C) 2007 Jean-Baptiste Mardelle <jb@ader.ch>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_FRAMEBUFFER_H_
-#define _PRODUCER_FRAMEBUFFER_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_framebuffer_init( char *arg );
-
-#endif
index bbae505562a80278dd84807efa3c81162644fe2a..9316abb8ae0c2711cb017cc646c776d7b4cd7885 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "producer_kino.h"
+extern mlt_producer producer_kino_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "kino" ) )
-               return producer_kino_init( arg );
+               return producer_kino_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 3d45f40c807fd10e4ba459432f8bcda3f46aacda..7f94a9e78f149e350c2d0bda90128a6a8ca02930 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 #include <stdlib.h>
-#include "producer_kino.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_deque.h>
 #include <framework/mlt_factory.h>
@@ -41,7 +41,7 @@ struct producer_kino_s
 static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index );
 static void producer_close( mlt_producer parent );
 
-mlt_producer producer_kino_init( char *filename )
+mlt_producer producer_kino_init( mlt_profile profile, mlt_service_type type, const char *id, char *filename )
 {
        kino_wrapper wrapper = kino_wrapper_init( );
 
@@ -91,7 +91,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        uint64_t position = mlt_producer_frame( producer );
        
        // Create an empty frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
        // Seek and fetch
        if ( kino_wrapper_get_frame( this->wrapper, data, position ) )
diff --git a/src/modules/kino/producer_kino.h b/src/modules/kino/producer_kino.h
deleted file mode 100644 (file)
index 9f6f69a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_kino.h -- a DV file format parser
- * Copyright (C) 2005 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _PRODUCER_KINO_H_
-#define _PRODUCER_KINO_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_kino_init( char *filename );
-
-#endif
index bd00ccba118dcf7eab74f2049aadf23f8f5e433b..493d37f446c8384038e917daf106d731b733abcb 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_motion_est.h"
+extern mlt_filter filter_motion_est_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_vismv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_crop_detect_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_autotrack_rectangle_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_slowmotion_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-extern mlt_filter filter_motion_est_init(char *);
-extern mlt_filter filter_vismv_init(char *);
-extern mlt_filter filter_crop_detect_init(char *);
-extern mlt_filter filter_autotrack_rectangle_init(char *);
-extern mlt_producer producer_slowmotion_init(char *);
-
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "motion_est" ) )
-               return filter_motion_est_init( arg );
+               return filter_motion_est_init( profile, type, id, arg );
        if ( !strcmp( id, "vismv" ) )
-               return filter_vismv_init( arg );
+               return filter_vismv_init( profile, type, id, arg );
        if ( !strcmp( id, "crop_detect" ) )
-               return filter_crop_detect_init( arg );
+               return filter_crop_detect_init( profile, type, id, arg );
        if ( !strcmp( id, "autotrack_rectangle" ) )
-               return filter_autotrack_rectangle_init( arg );
+               return filter_autotrack_rectangle_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "slowmotion" ) )
-               return producer_slowmotion_init( arg );
+               return producer_slowmotion_init( profile, type, id, arg );
        return NULL;
 }
index bf1b2e1d58943dea4269162d91986483c182630c..0d526e4547bb3a266a2502edfaa40ba1fac80fa4 100644 (file)
@@ -268,7 +268,8 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
                mlt_filter vismv = mlt_properties_get_data( MLT_FILTER_PROPERTIES(this), "_vismv", NULL );
                if( vismv == NULL )
                {
-                       vismv = mlt_factory_filter( "vismv", NULL );
+                       mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( this ) );
+                       vismv = mlt_factory_filter( profile, "vismv", NULL );
                        mlt_properties_set_data( MLT_FILTER_PROPERTIES(this), "_vismv", vismv, 0, (mlt_destructor)mlt_filter_close, NULL );
                }
 
@@ -280,7 +281,8 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
                mlt_filter obscure = mlt_properties_get_data( MLT_FILTER_PROPERTIES(this), "_obscure", NULL );
                if( obscure == NULL )
                {
-                       obscure = mlt_factory_filter( "obscure", NULL );
+                       mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( this ) );
+                       obscure = mlt_factory_filter( profile, "obscure", NULL );
                        mlt_properties_set_data( MLT_FILTER_PROPERTIES(this), "_obscure", obscure, 0, (mlt_destructor)mlt_filter_close, NULL );
                }
 
@@ -294,7 +296,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 */
 
 
-mlt_filter filter_autotrack_rectangle_init( char *arg )
+mlt_filter filter_autotrack_rectangle_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
@@ -308,7 +310,7 @@ mlt_filter filter_autotrack_rectangle_init( char *arg )
                        mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "geometry", "100,100:100x100" );
 
                // create an instance of the motion_est and obscure filter
-               mlt_filter motion_est = mlt_factory_filter( "motion_est", NULL );
+               mlt_filter motion_est = mlt_factory_filter( profile, "motion_est", NULL );
                if( motion_est != NULL )
                        mlt_properties_set_data( MLT_FILTER_PROPERTIES(this), "_motion_est", motion_est, 0, (mlt_destructor)mlt_filter_close, NULL );
                else {
index af58f359b539117c23306abf0770d282e95e84c8..8165141a380ae20b2f29989096d06dbdb29936e9 100644 (file)
@@ -221,7 +221,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 
 /** Constructor for the filter.
 */
-mlt_filter filter_crop_detect_init( char *arg )
+mlt_filter filter_crop_detect_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
index 31254d6155a72c8f704a1517ab35464e72624f69..f81a2b8324ecb51c1c8fd02aa7bcc49cae8aef5e 100644 (file)
@@ -1074,7 +1074,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 
 /** Constructor for the filter.
 */
-mlt_filter filter_motion_est_init( char *arg )
+mlt_filter filter_motion_est_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
index f84e958eb3425771e440d42ad41388d759bd79fc..296287e5380d14dd17d0dd3dff0014a5a83adba3 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <framework/mlt_filter.h>
 
-extern mlt_filter filter_motion_est_init( char *arg );
+extern mlt_filter filter_motion_est_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
 #define MAX_MSAD 0xffff
 
index 23d1ffe2a16f1d475742ec3721e48903dfe61253..eb0d9870a0488afaa508127ded5404ec11ffa964 100644 (file)
@@ -120,7 +120,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 */
 
 
-mlt_filter filter_vismv_init( char *arg )
+mlt_filter filter_vismv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
index c6b6eec2424cc4e2eeb19fd42c9a69c56f802f7f..e66db091eb7b18c8223c4f99423707826bfb144e 100644 (file)
@@ -251,7 +251,8 @@ static int slowmotion_get_image( mlt_frame this, uint8_t **image, mlt_image_form
                        mlt_filter watermark = mlt_properties_get_data( producer_properties, "watermark", NULL );
 
                        if( watermark == NULL ) {
-                               watermark = mlt_factory_filter( "watermark", NULL );
+                               mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( producer ) );
+                               watermark = mlt_factory_filter( profile, "watermark", NULL );
                                mlt_properties_set_data( producer_properties, "watermark", watermark, 0, (mlt_destructor)mlt_filter_close, NULL );
                                mlt_producer_attach( producer, watermark );
                        }
@@ -282,7 +283,7 @@ static int slowmotion_get_image( mlt_frame this, uint8_t **image, mlt_image_form
 static int slowmotion_get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
 {
        // Construct a new frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
 
        mlt_properties properties = MLT_PRODUCER_PROPERTIES(this);
 
@@ -362,15 +363,15 @@ static int slowmotion_get_frame( mlt_producer this, mlt_frame_ptr frame, int ind
        return 0;
 }
 
-mlt_producer producer_slowmotion_init( char *arg )
+mlt_producer producer_slowmotion_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_producer this = mlt_producer_new( );
 
        // Wrap fezzik
-       mlt_producer real_producer = mlt_factory_producer( "fezzik", arg );
+       mlt_producer real_producer = mlt_factory_producer( profile, "fezzik", arg );
 
        // We need to apply the motion estimation filter manually
-       mlt_filter filter = mlt_factory_filter( "motion_est", NULL );
+       mlt_filter filter = mlt_factory_filter( profile, "motion_est", NULL );
 
        if ( this != NULL && real_producer != NULL && filter != NULL)
        {
index 2e07e23d77e66bbed2ab82e76eb9a92ed5091bc0..24862506ee4a2b110cdcfd3bd78399c71d4f1eaf 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_volume.h"
+extern mlt_filter filter_volume_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "volume" ) )
-               return filter_volume_init( arg );
+               return filter_volume_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 6fa708d2f0e5448eaa64a74672e3d7b005dd051f..e745363057b7c6b2c8e309749d9d7975cb4ff7f1 100644 (file)
@@ -18,8 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_volume.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -441,7 +440,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_volume_init( char *arg )
+mlt_filter filter_volume_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 );
        if ( this != NULL && mlt_filter_init( this, NULL ) == 0 )
diff --git a/src/modules/normalize/filter_volume.h b/src/modules/normalize/filter_volume.h
deleted file mode 100644 (file)
index d5fb569..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_volume.h -- adjust audio volume
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_VOLUME_H_
-#define _FILTER_VOLUME_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_volume_init( char *arg );
-
-#endif
index 893c6d28d3caeb8db4120b9ba06ea5800d7fff41..fab7729124956d243705eb6436f2dc9f349d4e3a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * factory.c -- the factory method interfaces
- * Copyright (C) 2007 Jean-Baptiste Mardelle
+ * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_oldfilm.h"
-#include "filter_grain.h"
-#include "filter_dust.h"
-#include "filter_lines.h"
+extern mlt_filter filter_dust_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_grain_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_lines_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_oldfilm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "oldfilm" ) )
-                return filter_oldfilm_init( arg );
-        if ( !strcmp( id, "dust" ) )
-                return filter_dust_init( arg );
-        if ( !strcmp( id, "lines" ) )
-                return filter_lines_init( arg );
-        if ( !strcmp( id, "grain" ) )
-                return filter_grain_init( arg );
+               return filter_oldfilm_init( profile, type, id, arg );
+       if ( !strcmp( id, "dust" ) )
+               return filter_dust_init( profile, type, id, arg );
+       if ( !strcmp( id, "lines" ) )
+               return filter_lines_init( profile, type, id, arg );
+       if ( !strcmp( id, "grain" ) )
+               return filter_grain_init( profile, type, id, arg );
 
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 8b6c852fd5b80b9fa20fecd849eb7dc3703ecc07..c13381332da8ae90d3257a93f51617aeed37c407 100644 (file)
@@ -17,8 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_dust.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -90,7 +89,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 }
 
 
-mlt_filter filter_dust_init( char *arg )
+mlt_filter filter_dust_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/oldfilm/filter_dust.h b/src/modules/oldfilm/filter_dust.h
deleted file mode 100644 (file)
index 5072b19..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * filter_dust.h -- dust filter
- * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_DUST_H_
-#define _FILTER_DUST_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_dust_init( char *arg );
-
-#endif
index 1795dac2f6cb9a401bbc6e95be443bdf3b8d8958..7557dd4079c6cb31d8914a43180e0a5bc51f3c9e 100644 (file)
@@ -17,8 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_grain.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -61,7 +60,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
        return frame;
 }
 
-mlt_filter filter_grain_init( char *arg )
+mlt_filter filter_grain_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/oldfilm/filter_grain.h b/src/modules/oldfilm/filter_grain.h
deleted file mode 100644 (file)
index 2b3d618..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * filter_grain.h -- grain filter
- * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_GRAIN_H_
-#define _FILTER_GRAIN_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_grain_init( char *arg );
-
-#endif
index c840ae0eb6fc01b983c263b7c87826fb88da48f4..5094916a8b4260482b29fe343e5ace8213e611ac 100644 (file)
@@ -17,8 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_lines.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -86,7 +85,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
        return frame;
 }
 
-mlt_filter filter_lines_init( char *arg )
+mlt_filter filter_lines_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/oldfilm/filter_lines.h b/src/modules/oldfilm/filter_lines.h
deleted file mode 100644 (file)
index 3f6f3bd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * filter_lines.h -- lines filter
- * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_LINES_H_
-#define _FILTER_LINES_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_lines_init( char *arg );
-
-#endif
index 9935c70c0844b7c12eb6653dbe2989ea6e0dd9ea..18fcd120bc0e2567c43610bef3c15343b06de402 100644 (file)
@@ -17,8 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_oldfilm.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -81,7 +80,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
        return frame;
 }
 
-mlt_filter filter_oldfilm_init( char *arg )
+mlt_filter filter_oldfilm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/oldfilm/filter_oldfilm.h b/src/modules/oldfilm/filter_oldfilm.h
deleted file mode 100644 (file)
index af309b3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * filter_oldfilm.h -- oldfilm filter
- * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_OLDFILM_H_
-#define _FILTER_OLDFILM_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_oldfilm_init( char *arg );
-
-#endif
index 2e3d74d8222cc63800d5f4af6f8a32881617c8c1..2ff28657ebe6ce732bbd1023ced00fb010f8e2c4 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_affine.h"
-#include "filter_charcoal.h"
-#include "filter_invert.h"
-#include "filter_sepia.h"
-#include "transition_affine.h"
+extern mlt_filter filter_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_charcoal_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_invert_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_sepia_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_transition transition_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "affine" ) )
-               return filter_affine_init( arg );
+               return filter_affine_init( profile, type, id, arg );
        if ( !strcmp( id, "charcoal" ) )
-               return filter_charcoal_init( arg );
+               return filter_charcoal_init( profile, type, id, arg );
        if ( !strcmp( id, "invert" ) )
-               return filter_invert_init( arg );
+               return filter_invert_init( profile, type, id, arg );
        if ( !strcmp( id, "sepia" ) )
-               return filter_sepia_init( arg );
+               return filter_sepia_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "affine" ) )
-               return transition_affine_init( arg );
+               return transition_affine_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index f1fad0258157967eabdad53c0ef128c304c8efce..0f28ed59d26fb3d74ceb8b8db647068c14a3f06e 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_affine.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt.h>
 
 #include <stdio.h>
@@ -50,13 +49,15 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                if ( producer == NULL )
                {
                        char *background = mlt_properties_get( properties, "background" );
-                       producer = mlt_factory_producer( "fezzik", background );
+                       mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
+                       producer = mlt_factory_producer( profile, "fezzik", background );
                        mlt_properties_set_data( properties, "producer", producer, 0, (mlt_destructor)mlt_producer_close, NULL );
                }
 
                if ( transition == NULL )
                {
-                       transition = mlt_factory_transition( "affine", NULL );
+                       mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
+                       transition = mlt_factory_transition( profile, "affine", NULL );
                        mlt_properties_set_data( properties, "transition", transition, 0, (mlt_destructor)mlt_transition_close, NULL );
                }
 
@@ -118,7 +119,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_affine_init( char *arg )
+mlt_filter filter_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/plus/filter_affine.h b/src/modules/plus/filter_affine.h
deleted file mode 100644 (file)
index 19bf6b0..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_affine.h -- affine filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_AFFINEH_
-#define _FILTER_AFFINEH_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_affine_init( char *arg );
-
-#endif
index 3f58697e807c4a8c436a183823c67e09a741d6b9..e99981a56add6ddeb096bb95e24eb8574224f39b 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_charcoal.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -159,7 +158,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_charcoal_init( char *arg )
+mlt_filter filter_charcoal_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/plus/filter_charcoal.h b/src/modules/plus/filter_charcoal.h
deleted file mode 100644 (file)
index 3321b6f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_charcoal.h -- charcoal filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_CHARCOAL_H_
-#define _FILTER_CHARCOAL_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_charcoal_init( char *arg );
-
-#endif
index cf1c77e188e9475b3e64953ca2a415f86f36c96e..4385fc8674fba567cdf788160ded5ed198becf79 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_invert.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -80,7 +79,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_invert_init( char *arg )
+mlt_filter filter_invert_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/plus/filter_invert.h b/src/modules/plus/filter_invert.h
deleted file mode 100644 (file)
index bab0ba3..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_invert.h -- invert filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_INVERT_H_
-#define _FILTER_INVERT_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_invert_init( char *arg );
-
-#endif
index 21c3b668896229017911e8478eaffe14e5adf116..aa20b23a71a8c3546b8b02c5a790bf43243d168e 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_sepia.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -87,7 +86,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_sepia_init( char *arg )
+mlt_filter filter_sepia_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/plus/filter_sepia.h b/src/modules/plus/filter_sepia.h
deleted file mode 100644 (file)
index 86b6ecc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_sepia.h -- sepia filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_SEPIA_H_
-#define _FILTER_SEPIA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_sepia_init( char *arg );
-
-#endif
index 0da43552b4c405e55c6762c7bce922fb17a9f669..98b6392e5d9814aba187275e805de1533581406b 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "transition_affine.h"
+#include <framework/mlt_transition.h>
 #include <framework/mlt.h>
 
 #include <stdio.h>
@@ -592,7 +592,7 @@ static mlt_frame transition_process( mlt_transition transition, mlt_frame a_fram
 /** Constructor for the filter.
 */
 
-mlt_transition transition_affine_init( char *arg )
+mlt_transition transition_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_transition transition = mlt_transition_new( );
        if ( transition != NULL )
diff --git a/src/modules/plus/transition_affine.h b/src/modules/plus/transition_affine.h
deleted file mode 100644 (file)
index 2fc07c8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * transition_affine.h -- compose one image over another using affine transforms
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _TRANSITION_AFFINE_H_
-#define _TRANSITION_AFFINE_H_
-
-#include <framework/mlt_transition.h>
-
-extern mlt_transition transition_affine_init( char *arg );
-
-#endif
index 5f0a5070bf7bc4207c85a48261463e3a9382cefc..f9d58860fd33bf0ca9b7d23f2ce3624096ee39bd 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "producer_qimage.h"
+extern mlt_producer producer_qimage_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "qimage" ) )
-               return producer_qimage_init( arg );
+               return producer_qimage_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 302bca0cfdf43f45463a67a7c28419fc92e529ab..6008b7e6ef53fb663bd3194d053516d0ace84d2f 100644 (file)
@@ -21,7 +21,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "producer_qimage.h"
+#include <framework/mlt_producer.h>
 #include "qimage_wrapper.h"
 
 #include <stdio.h>
@@ -35,7 +35,7 @@
 static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index );
 static void producer_close( mlt_producer parent );
 
-mlt_producer producer_qimage_init( char *filename )
+mlt_producer producer_qimage_init( mlt_profile profile, mlt_service_type type, const char *id, char *filename )
 {
        producer_qimage this = calloc( sizeof( struct producer_qimage_s ), 1 );
        if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 )
@@ -241,7 +241,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
        }
 
        // Generate a frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
        if ( *frame != NULL && this->count > 0 )
        {
diff --git a/src/modules/qimage/producer_qimage.h b/src/modules/qimage/producer_qimage.h
deleted file mode 100644 (file)
index 6a2248d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_qimage.h -- a QT/QImage based producer for MLT
- * Copyright (C) 2006 Visual Media
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _PRODUCER_QIMAGE_H_
-#define _PRODUCER_QIMAGE_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_qimage_init( char *filename );
-
-#endif
index af6838eb2e1d71ed065fee5192b9f1a1660cfe12..63cff87bf87a950a675a01e6f6be58677af8a7c6 100644 (file)
@@ -243,7 +243,7 @@ void refresh_qimage( mlt_frame frame, int width, int height )
 
        if ( update_cache )
        {
-               mlt_frame cached = mlt_frame_init( );
+               mlt_frame cached = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
                mlt_properties cached_props = MLT_FRAME_PROPERTIES( cached );
                mlt_properties_set_int( cached_props, "width", current_width );
                mlt_properties_set_int( cached_props, "height", current_height );
index 42385a7c4e52c7823af23b14f993d1689e181750..769e96e952d2b804f39bc18b06ed685412d98c99 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_resample.h"
+extern mlt_filter filter_resample_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "resample" ) )
-               return filter_resample_init( arg );
+               return filter_resample_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 09be434623c8620a9c0ffad557bd2da97a05bb99..6838465275902eae6f158b4e7f8f317f8f66b49f 100644 (file)
@@ -18,8 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_resample.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -173,7 +172,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_resample_init( char *arg )
+mlt_filter filter_resample_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/resample/filter_resample.h b/src/modules/resample/filter_resample.h
deleted file mode 100644 (file)
index 6ce7eb4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_resample.h -- adjust audio sample frequency
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_RESAMPLE_H_
-#define _FILTER_RESAMPLE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_resample_init( char *arg );
-
-#endif
index 9d663fd325d7ef88a12b6ca1b37bb3297dcc29ac..0736b9d3e95f96ea0a75fbd905ac68739e71341a 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "consumer_sdl.h"
+#include <framework/mlt_consumer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_deque.h>
 #include <framework/mlt_factory.h>
@@ -81,13 +81,13 @@ static void consumer_sdl_event( mlt_listener listener, mlt_properties owner, mlt
        via the argument, but keep it simple.
 */
 
-mlt_consumer consumer_sdl_init( char *arg )
+mlt_consumer consumer_sdl_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create the consumer object
        consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 );
 
        // If no malloc'd and consumer init ok
-       if ( this != NULL && mlt_consumer_init( &this->parent, this ) == 0 )
+       if ( this != NULL && mlt_consumer_init( &this->parent, this, profile ) == 0 )
        {
                // Create the queue
                this->queue = mlt_deque_init( );
@@ -188,7 +188,8 @@ int consumer_start( mlt_consumer parent )
                // Attach a colour space converter
                if ( preview_off && !this->filtered )
                {
-                       mlt_filter filter = mlt_factory_filter( "avcolour_space", NULL );
+                       mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( parent ) );
+                       mlt_filter filter = mlt_factory_filter( profile, "avcolour_space", NULL );
                        mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "forced", mlt_image_yuv422 );
                        mlt_service_attach( MLT_CONSUMER_SERVICE( parent ), filter );
                        mlt_filter_close( filter );
diff --git a/src/modules/sdl/consumer_sdl.h b/src/modules/sdl/consumer_sdl.h
deleted file mode 100644 (file)
index 1c85893..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * consumer_sdl.h -- A Simple DirectMedia Layer consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _CONSUMER_SDL_H_
-#define _CONSUMER_SDL_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_sdl_init( char * );
-extern mlt_consumer consumer_sdl_still_init( char * );
-extern mlt_consumer consumer_sdl_preview_init( char * );
-
-#endif
index 479774e23631dcecf0b7a09aa9428c9349dcc1b4..73661e24912742d25507f751ed321362fdb9d15b 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "consumer_sdl.h"
+#include <framework/mlt_consumer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_factory.h>
 #include <framework/mlt_producer.h>
@@ -60,10 +60,10 @@ static void consumer_frame_show_cb( mlt_consumer sdl, mlt_consumer this, mlt_fra
 static void consumer_sdl_event_cb( mlt_consumer sdl, mlt_consumer this, SDL_Event *event );
 static void consumer_refresh_cb( mlt_consumer sdl, mlt_consumer this, char *name );
 
-mlt_consumer consumer_sdl_preview_init( char *arg )
+mlt_consumer consumer_sdl_preview_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 );
-       if ( this != NULL && mlt_consumer_init( &this->parent, this ) == 0 )
+       if ( this != NULL && mlt_consumer_init( &this->parent, this, profile ) == 0 )
        {
                // Get the parent consumer object
                mlt_consumer parent = &this->parent;
@@ -83,8 +83,8 @@ mlt_consumer consumer_sdl_preview_init( char *arg )
                }
 
                // Create child consumers
-               this->play = mlt_factory_consumer( "sdl", arg );
-               this->still = mlt_factory_consumer( "sdl_still", arg );
+               this->play = mlt_factory_consumer( profile, "sdl", arg );
+               this->still = mlt_factory_consumer( profile, "sdl_still", arg );
                mlt_properties_set( MLT_CONSUMER_PROPERTIES( parent ), "real_time", "0" );
                mlt_properties_set( MLT_CONSUMER_PROPERTIES( parent ), "rescale", "nearest" );
                parent->close = consumer_close;
index 9250f8dc4d68f844d85183ceb718082d4f3b26f8..942726c1c6a9ef2a2ce9d65ce879697b94f8220c 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "consumer_sdl.h"
+#include <framework/mlt_consumer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_deque.h>
 #include <framework/mlt_factory.h>
@@ -72,13 +72,13 @@ static void consumer_sdl_event( mlt_listener listener, mlt_properties owner, mlt
        via the argument, but keep it simple.
 */
 
-mlt_consumer consumer_sdl_still_init( char *arg )
+mlt_consumer consumer_sdl_still_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create the consumer object
        consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 );
 
        // If no malloc'd and consumer init ok
-       if ( this != NULL && mlt_consumer_init( &this->parent, this ) == 0 )
+       if ( this != NULL && mlt_consumer_init( &this->parent, this, profile ) == 0 )
        {
                // Get the parent consumer object
                mlt_consumer parent = &this->parent;
@@ -154,7 +154,8 @@ static int consumer_start( mlt_consumer parent )
                // Attach a colour space converter
                if ( !this->filtered )
                {
-                       mlt_filter filter = mlt_factory_filter( "avcolour_space", NULL );
+                       mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( parent ) );
+                       mlt_filter filter = mlt_factory_filter( profile, "avcolour_space", NULL );
                        mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "forced", mlt_image_yuv422 );
                        mlt_service_attach( MLT_CONSUMER_SERVICE( parent ), filter );
                        mlt_filter_close( filter );
index 1a081a25029e15746a7382991172d7431b84bd01..6ec79c003083a3d158cf165759b9882457c0b032 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "consumer_sdl.h"
+extern mlt_consumer consumer_sdl_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_consumer consumer_sdl_still_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_consumer consumer_sdl_preview_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
 #ifdef WITH_SDL_IMAGE
-#include "producer_sdl_image.h"
+extern mlt_producer producer_sdl_image_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 #endif
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
 #ifdef WITH_SDL_IMAGE
        if ( !strcmp( id, "sdl_image" ) )
-               return producer_sdl_image_init( arg );
+               return producer_sdl_image_init( profile, type, id, arg );
 #endif
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "sdl" ) )
-               return consumer_sdl_init( arg );
+               return consumer_sdl_init( profile, type, id, arg );
        if ( !strcmp( id, "sdl_still" ) )
-               return consumer_sdl_still_init( arg );
+               return consumer_sdl_still_init( profile, type, id, arg );
        if ( !strcmp( id, "sdl_preview" ) )
-               return consumer_sdl_preview_init( arg );
+               return consumer_sdl_preview_init( profile, type, id, arg );
        return NULL;
 }
 
index fd464d0c34514210c23f4c786ac332a14345c2ab..ee881023f83defdfbfd955778e0023cf32fda5f1 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "producer_sdl_image.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_pool.h>
 
@@ -174,7 +174,7 @@ static SDL_Surface *load_image( mlt_producer producer )
 static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index )
 {
        // Generate a frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
        if ( *frame != NULL )
        {
@@ -217,7 +217,7 @@ static void producer_close( mlt_producer producer )
        free( producer );
 }
 
-mlt_producer producer_sdl_image_init( char *file )
+mlt_producer producer_sdl_image_init( mlt_profile profile, mlt_service_type type, const char *id, char *file )
 {
        mlt_producer producer = calloc( 1, sizeof( struct mlt_producer_s ) );
        if ( producer != NULL && mlt_producer_init( producer, NULL ) == 0 )
diff --git a/src/modules/sdl/producer_sdl_image.h b/src/modules/sdl/producer_sdl_image.h
deleted file mode 100644 (file)
index f464365..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_sdl_image.h -- Image loader which wraps SDL_image
- * Copyright (C) 2005 Visual Media FX
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef PRODUCER_SDL_IMAGE_H_
-#define PRODUCER_SDL_IMAGE_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_sdl_image_init( char *filename );
-
-#endif
index e306c0b99b6167af294bb96dd45f55c1a89b94b5..16197741d2eab2856af66b2d56837d00266b3920 100755 (executable)
@@ -31,7 +31,7 @@ then
                        # chop bin
                        soxdir=$(dirname $soxdir)
                        echo "CFLAGS += -DSOX14 -I$soxdir/include" > config.mak
-                       echo "LDFLAGS += -L$soxdir/$LIBDIR -lsox -lsfx" >> config.mak
+                       echo "LDFLAGS += -L$soxdir/$LIBDIR -lsox" >> config.mak
                fi
        fi
 
index e50fb7f7647aee034859493e241867fcc1fd1205..fc6448d2b47d90a1dbd98e8c290bf38640882b06 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_sox.h"
+extern mlt_filter filter_sox_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "sox" ) )
-               return filter_sox_init( arg );
+               return filter_sox_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index a5fa7f9a46eea37a5c11b16791c388eaaac82094..c1676bc377339686c673de48ec5080a63165e126 100644 (file)
@@ -18,8 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "filter_sox.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_tokeniser.h>
 
@@ -416,7 +415,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_sox_init( char *arg )
+mlt_filter filter_sox_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/sox/filter_sox.h b/src/modules/sox/filter_sox.h
deleted file mode 100644 (file)
index 9efc36c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_sox.h -- apply any number of SOX effects using libst
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _FILTER_SOX_H_
-#define _FILTER_SOX_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_sox_init( char *arg );
-
-#endif
index 76a8a1c1901bb9024b5df9e9951333b81f6d29ca..4d4c9a34b8ddc2c9a3d9f1f3670f6e714c22ddff 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "consumer_valerie.h"
 #include <valerie/valerie.h>
 #include <valerie/valerie_remote.h>
 #include <framework/mlt.h>
@@ -34,13 +33,13 @@ static int consumer_start( mlt_consumer this );
 /** This is what will be called by the factory
 */
 
-mlt_consumer consumer_valerie_init( char *arg )
+mlt_consumer consumer_valerie_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create the consumer object
        mlt_consumer this = calloc( sizeof( struct mlt_consumer_s ), 1 );
 
        // If no malloc'd and consumer init ok
-       if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 )
+       if ( this != NULL && mlt_consumer_init( this, NULL, profile ) == 0 )
        {
                if ( arg != NULL && strchr( arg, ':' ) )
                {
diff --git a/src/modules/valerie/consumer_valerie.h b/src/modules/valerie/consumer_valerie.h
deleted file mode 100644 (file)
index ccb1978..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * consumer_valerie.h -- pushes a service via valerie
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@telenet.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _CONSUMER_VALERIE_H_
-#define _CONSUMER_VALERIE_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_valerie_init( char * );
-
-#endif
index e93c41f3dfa59c66432c9018f2c4022e7c7bd06d..affef35ffec51a2eef2c113b481bcf454e97603e 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "consumer_valerie.h"
+extern mlt_consumer consumer_valerie_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "valerie" ) )
-               return consumer_valerie_init( arg );
+               return consumer_valerie_init( profile, type, id, arg );
        return NULL;
 }
 
index 313408f46dddf82c0971d0d31315ae8c21eb7c1b..7dac57669c9901d3561f1b1e264fa21e7f60753b 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_chroma.h"
-#include "filter_chroma_hold.h"
-#include "filter_mono.h"
-#include "filter_shape.h"
-#include "producer_pgm.h"
+extern mlt_filter filter_chroma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_chroma_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_shape_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_pgm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "pgm" ) )
-               return producer_pgm_init( arg );
+               return producer_pgm_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "chroma" ) )
-               return filter_chroma_init( arg );
+               return filter_chroma_init( profile, type, id, arg );
        if ( !strcmp( id, "chroma_hold" ) )
-               return filter_chroma_hold_init( arg );
+               return filter_chroma_hold_init( profile, type, id, arg );
        if ( !strcmp( id, "threshold" ) )
-               return filter_mono_init( arg );
+               return filter_mono_init( profile, type, id, arg );
        if ( !strcmp( id, "shape" ) )
-               return filter_shape_init( arg );
+               return filter_shape_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index f857f00585be5f4382156dee24cfd7515a0a1e3b..7616856c12ad2ac4f154ad0c97e1544d7e7a095f 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_chroma.h"
+#include <framework/mlt_filter.h>
 #include <stdlib.h>
 #include <math.h>
 #include <framework/mlt_factory.h>
@@ -86,7 +86,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_chroma_init( char *arg )
+mlt_filter filter_chroma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/vmfx/filter_chroma.h b/src/modules/vmfx/filter_chroma.h
deleted file mode 100644 (file)
index 7d87857..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_chroma.h -- Maps a chroma key to the alpha channel
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_CHROMA_H_
-#define _FILTER_CHROMA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_chroma_init( char *arg );
-
-#endif
index f3ede3f9757cc287af18313e678a52870f326c32..4fe52b215ba5c71f1462d54bb449a647f8aaae32 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_chroma.h"
+#include <framework/mlt_filter.h>
 #include <stdlib.h>
 #include <framework/mlt_factory.h>
 #include <framework/mlt_frame.h>
@@ -87,7 +87,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_chroma_hold_init( char *arg )
+mlt_filter filter_chroma_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/vmfx/filter_chroma_hold.h b/src/modules/vmfx/filter_chroma_hold.h
deleted file mode 100644 (file)
index 5f39360..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_chroma.h -- Maps a chroma key to the alpha channel
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_CHROMA_HOLD_H_
-#define _FILTER_CHROMA_HOLD_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_chroma_hold_init( char *arg );
-
-#endif
index 88467ce28fc5db91dd278c277a845002ba8c3deb..2afab5d3d772f22429c6cde7e1585bcd4beca632 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_mono.h"
+#include <framework/mlt_filter.h>
 #include <string.h>
 #include <framework/mlt_factory.h>
 #include <framework/mlt_frame.h>
@@ -83,7 +83,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_mono_init( char *arg )
+mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/vmfx/filter_mono.h b/src/modules/vmfx/filter_mono.h
deleted file mode 100644 (file)
index 35dbd7e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_shape.h -- Arbitrary alpha channel shaping
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_MONO_H_
-#define _FILTER_MONO_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_mono_init( char *arg );
-
-#endif
index e900e050339f517732b2e483468268c6e1581c67..fad32f4bdfdcb0c0fa2c2dcfc50a768b2f5f4257 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_shape.h"
+#include <framework/mlt.h>
 #include <string.h>
 #include <framework/mlt_factory.h>
 #include <framework/mlt_frame.h>
@@ -163,7 +163,8 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
                        extension = strrchr( resource, '.' );
                }
 
-               producer = mlt_factory_producer( NULL, resource );
+               mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( this ) );
+               producer = mlt_factory_producer( profile, NULL, resource );
                if ( producer != NULL )
                        mlt_properties_set( MLT_PRODUCER_PROPERTIES( producer ), "eof", "loop" );
                mlt_properties_set_data( MLT_FILTER_PROPERTIES( this ), "instance", producer, 0, ( mlt_destructor )mlt_producer_close, NULL );
@@ -212,7 +213,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_shape_init( char *arg )
+mlt_filter filter_shape_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/vmfx/filter_shape.h b/src/modules/vmfx/filter_shape.h
deleted file mode 100644 (file)
index 1cc347d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_shape.h -- Arbitrary alpha channel shaping
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_SHAPE_H_
-#define _FILTER_SHAPE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_shape_init( char *arg );
-
-#endif
index e9d333be4b0d8cd97c02cefb402024ec72d095e8..6713317cff4a1de08aac8922c40f1f9cb0a75abe 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "producer_pgm.h"
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 #include <stdlib.h>
 #include <string.h>
@@ -27,7 +27,7 @@ static int read_pgm( char *name, uint8_t **image, int *width, int *height, int *
 static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index );
 static void producer_close( mlt_producer parent );
 
-mlt_producer producer_pgm_init( void *resource )
+mlt_producer producer_pgm_init( mlt_profile profile, mlt_service_type type, const char *id, char *resource )
 {
        mlt_producer this = NULL;
        uint8_t *image = NULL;
@@ -177,7 +177,7 @@ static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_forma
 static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index )
 {
        // Construct a test frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
        // Get the frames properties
        mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
diff --git a/src/modules/vmfx/producer_pgm.h b/src/modules/vmfx/producer_pgm.h
deleted file mode 100644 (file)
index 29836c4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_pgm.h -- PGM producer
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PRODUCER_PGM_H_
-#define PRODUCER_PGM_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_pgm_init( void * );
-
-#endif
index e39504923b911306d25538846b470013015165ec..080e151843a1fb4229fd50aff824fd0a1091be38 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "producer_vorbis.h"
+extern mlt_producer producer_vorbis_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "vorbis" ) )
-               return producer_vorbis_init( arg );
+               return producer_vorbis_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
index 982808bcf59d1521e73f5d11ff121e2c9f120b1c..60166524a7fefcf67f4f5da7e2eef6e72a4acf1e 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// Local header files
-#include "producer_vorbis.h"
-
 // MLT Header files
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 
 // vorbis Header files
@@ -69,7 +67,7 @@ static sw_metadata *vorbis_metadata_from_str (char * str)
 /** Constructor for libvorbis.
 */
 
-mlt_producer producer_vorbis_init( char *file )
+mlt_producer producer_vorbis_init( mlt_profile profile, mlt_service_type type, const char *id, char *file )
 {
        mlt_producer this = NULL;
 
@@ -342,7 +340,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
 static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
 {
        // Create an empty frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
 
        // Update timecode on the frame we're creating
        mlt_frame_set_position( *frame, mlt_producer_position( this ) );
diff --git a/src/modules/vorbis/producer_vorbis.h b/src/modules/vorbis/producer_vorbis.h
deleted file mode 100644 (file)
index d58c5c3..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_vorbis.h -- vorbis producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_VORBIS_H_
-#define _PRODUCER_VORBIS_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_vorbis_init( char *file );
-
-#endif
index 29e787cff78cfc393ee942804cceea32ac6c2e89..696bbffc6acf955fa0573753a646e3f9f2a766c8 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "consumer_westley.h"
 #include <framework/mlt.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -146,13 +145,13 @@ static char *westley_get_id( serialise_context context, mlt_service service, wes
        via the argument, but keep it simple.
 */
 
-mlt_consumer consumer_westley_init( char *arg )
+mlt_consumer consumer_westley_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        // Create the consumer object
        mlt_consumer this = calloc( sizeof( struct mlt_consumer_s ), 1 );
 
        // If no malloc'd and consumer init ok
-       if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 )
+       if ( this != NULL && mlt_consumer_init( this, NULL, profile ) == 0 )
        {
                // Allow thread to be started/stopped
                this->start = consumer_start;
diff --git a/src/modules/westley/consumer_westley.h b/src/modules/westley/consumer_westley.h
deleted file mode 100644 (file)
index 8e6e6a8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * consumer_westley.h -- a libxml2 serialiser of mlt service networks
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _CONSUMER_WESTLEY_H_
-#define _CONSUMER_WESTLEY_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_westley_init( char * );
-
-#endif
index aedda3090a6d3ce704e06595733fda1a94219797..91ed5d14d6e298c837dc71c4be48c3970fd428fe 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "consumer_westley.h"
-#include "producer_westley.h"
+extern mlt_consumer consumer_westley_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_westley_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "westley" ) )
-               return producer_westley_init( 0, arg );
+               return producer_westley_init( profile, type, id, arg );
        if ( !strcmp( id, "westley-xml" ) )
-               return producer_westley_init( 1, arg );
+               return producer_westley_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "westley" ) )
-               return consumer_westley_init( arg );
+               return consumer_westley_init( profile, type, id, arg );
        return NULL;
 }
 
index b440761693fb0323eacad8577139bc21a671f0c0..52509a064ae65f0f7ce9989b28887ed351d830d2 100644 (file)
@@ -21,7 +21,6 @@
 // TODO: destroy unreferenced producers (they are currently destroyed
 //       when the returned producer is closed).
 
-#include "producer_westley.h"
 #include <framework/mlt.h>
 #include <stdlib.h>
 #include <string.h>
@@ -82,6 +81,7 @@ struct deserialise_context_s
        const xmlChar *publicId;
        const xmlChar *systemId;
        mlt_properties params;
+       mlt_profile profile;
 };
 typedef struct deserialise_context_s *deserialise_context;
 
@@ -504,18 +504,18 @@ static void on_end_producer( deserialise_context context, const xmlChar *name )
                                strcat( temp, ":" );
                                strncat( temp, resource, 1023 - strlen( temp ) );
                        }
-                       producer = MLT_SERVICE( mlt_factory_producer( "fezzik", temp ) );
+                       producer = MLT_SERVICE( mlt_factory_producer( context->profile, "fezzik", temp ) );
                }
 
                // Just in case the plugin requested doesn't exist...
                if ( producer == NULL && resource != NULL )
-                       producer = MLT_SERVICE( mlt_factory_producer( "fezzik", resource ) );
+                       producer = MLT_SERVICE( mlt_factory_producer( context->profile, "fezzik", resource ) );
        
                if ( producer == NULL )
-                       producer = MLT_SERVICE( mlt_factory_producer( "fezzik", "+INVALID.txt" ) );
+                       producer = MLT_SERVICE( mlt_factory_producer( context->profile, "fezzik", "+INVALID.txt" ) );
 
                if ( producer == NULL )
-                       producer = MLT_SERVICE( mlt_factory_producer( "fezzik", "colour:red" ) );
+                       producer = MLT_SERVICE( mlt_factory_producer( context->profile, "fezzik", "colour:red" ) );
 
                // Track this producer
                track_service( context->destructors, producer, (mlt_destructor) mlt_producer_close );
@@ -844,7 +844,7 @@ static void on_end_filter( deserialise_context context, const xmlChar *name )
 
        if ( service != NULL && type == mlt_dummy_filter_type )
        {
-               mlt_service filter = MLT_SERVICE( mlt_factory_filter( mlt_properties_get( properties, "mlt_service" ), NULL ) );
+               mlt_service filter = MLT_SERVICE( mlt_factory_filter( context->profile, mlt_properties_get( properties, "mlt_service" ), NULL ) );
                mlt_properties filter_props = MLT_SERVICE_PROPERTIES( filter );
 
                track_service( context->destructors, filter, (mlt_destructor) mlt_filter_close );
@@ -919,7 +919,8 @@ static void on_end_transition( deserialise_context context, const xmlChar *name
 
        if ( service != NULL && type == mlt_dummy_transition_type )
        {
-               mlt_service effect = MLT_SERVICE( mlt_factory_transition(mlt_properties_get(properties,"mlt_service"), NULL ) );
+               char *id = mlt_properties_get( properties, "mlt_service" );
+               mlt_service effect = MLT_SERVICE( mlt_factory_transition( context->profile, id, NULL ) );
                mlt_properties effect_props = MLT_SERVICE_PROPERTIES( effect );
 
                track_service( context->destructors, effect, (mlt_destructor) mlt_transition_close );
@@ -1332,7 +1333,7 @@ static int file_exists( char *file )
        return exists;
 }
 
-mlt_producer producer_westley_init( int info, char *data )
+mlt_producer producer_westley_init( mlt_profile profile, mlt_service_type servtype, const char *id, char *data )
 {
        xmlSAXHandler *sax = calloc( 1, sizeof( xmlSAXHandler ) );
        struct deserialise_context_s *context = calloc( 1, sizeof( struct deserialise_context_s ) );
@@ -1341,6 +1342,7 @@ mlt_producer producer_westley_init( int info, char *data )
        struct _xmlParserCtxt *xmlcontext;
        int well_formed = 0;
        char *filename = NULL;
+       int info = strcmp( id, "westley-xml" ) ? 0 : 1;
 
        if ( data == NULL || !strcmp( data, "" ) || ( info == 0 && !file_exists( data ) ) )
                return NULL;
@@ -1352,6 +1354,7 @@ mlt_producer producer_westley_init( int info, char *data )
        context->producer_map = mlt_properties_new();
        context->destructors = mlt_properties_new();
        context->params = mlt_properties_new();
+       context->profile = profile;
 
        // Decode URL and parse parameters
        mlt_properties_set( context->producer_map, "root", "" );
diff --git a/src/modules/westley/producer_westley.h b/src/modules/westley/producer_westley.h
deleted file mode 100644 (file)
index cf40e67..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * producer_westley.h -- a libxml2 parser of mlt service networks
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef _PRODUCER_WESTLEY_H_
-#define _PRODUCER_WESTLEY_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_westley_init( int type, char *data );
-
-#endif
index 5c19826af9e11ddccdf6ee8a64bc79f7cd750a45..bdcf50db787ed356e737424c29c6ef4e2d1c5a5e 100644 (file)
  */
 
 #include <string.h>
+#include <framework/mlt.h>
 
-#include "filter_deinterlace.h"
+extern mlt_filter filter_deinterlace_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        if ( !strcmp( id, "deinterlace" ) )
-               return filter_deinterlace_init( arg );
+               return filter_deinterlace_init( profile, type, id, arg );
        return NULL;
 }
 
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
 
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        return NULL;
 }
-
index ef69b8af0145df755b178ad55cb18163754b0e57..01871cf3348ce23a1b355d86be4b1213a4c3a1d9 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_deinterlace.h"
+#include <framework/mlt_filter.h>
 #include "deinterlace.h"
 
 #include <framework/mlt_frame.h>
@@ -93,7 +93,7 @@ static mlt_frame deinterlace_process( mlt_filter this, mlt_frame frame )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_deinterlace_init( void *arg )
+mlt_filter filter_deinterlace_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
diff --git a/src/modules/xine/filter_deinterlace.h b/src/modules/xine/filter_deinterlace.h
deleted file mode 100644 (file)
index cfcd2fc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * filter_deinterlace.h -- deinterlace filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_DEINTERLACE_H_
-#define _FILTER_DEINTERLACE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_deinterlace_init( void *arg );
-
-#endif
index 04ad67aaa2ae1e6ca50bb724ffc37da622665460..580b0bef600ed294a4d262dddcce7ca25fec4ae3 100644 (file)
@@ -228,7 +228,7 @@ static valerie_response valerie_remote_push( valerie_remote remote, char *comman
        valerie_response response = NULL;
        if ( service != NULL )
        {
-               mlt_consumer consumer = mlt_factory_consumer( "westley", "buffer" );
+               mlt_consumer consumer = mlt_factory_consumer( NULL, "westley", "buffer" );
                mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
                char *buffer = NULL;
                // Temporary hack