From d33f444d4ef4c7bc4074d07a49eca0ab7d108394 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Sat, 2 Feb 2008 06:07:30 +0000 Subject: [PATCH] framework: remove global profile, rather share one mlt_profile across a service network and make it available from anywhere through mlt_service_profile(). 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 --- src/framework/mlt_consumer.c | 138 +++++++++++------- src/framework/mlt_consumer.h | 7 +- src/framework/mlt_factory.c | 54 +++---- src/framework/mlt_factory.h | 9 +- src/framework/mlt_filter.c | 2 +- src/framework/mlt_frame.c | 12 +- src/framework/mlt_frame.h | 3 +- src/framework/mlt_geometry.c | 4 +- src/framework/mlt_multitrack.c | 2 +- src/framework/mlt_playlist.c | 8 +- src/framework/mlt_producer.c | 12 +- src/framework/mlt_profile.c | 118 ++++++++------- src/framework/mlt_profile.h | 5 +- src/framework/mlt_repository.c | 10 +- src/framework/mlt_repository.h | 3 +- src/framework/mlt_service.c | 12 +- src/framework/mlt_service.h | 2 + src/framework/mlt_tractor.c | 4 +- src/inigo/inigo.c | 124 +++++++++++----- src/miracle/miracle_connection.c | 2 +- src/miracle/miracle_unit.c | 12 +- src/miracle/miracle_unit_commands.c | 16 +- src/modules/avformat/consumer_avformat.c | 8 +- src/modules/avformat/consumer_avformat.h | 28 ---- src/modules/avformat/factory.c | 25 ++-- src/modules/avformat/filter_avcolour_space.c | 3 +- src/modules/avformat/filter_avcolour_space.h | 28 ---- src/modules/avformat/filter_avdeinterlace.c | 3 +- src/modules/avformat/filter_avdeinterlace.h | 28 ---- src/modules/avformat/filter_avresample.c | 3 +- src/modules/avformat/filter_avresample.h | 28 ---- src/modules/avformat/producer_avformat.c | 16 +- src/modules/avformat/producer_avformat.h | 28 ---- src/modules/core/consumer_null.c | 8 +- src/modules/core/consumer_null.h | 28 ---- src/modules/core/factory.c | 100 ++++++------- src/modules/core/filter_brightness.c | 5 +- src/modules/core/filter_brightness.h | 28 ---- src/modules/core/filter_channelcopy.c | 5 +- src/modules/core/filter_channelcopy.h | 28 ---- src/modules/core/filter_data.h | 30 ---- src/modules/core/filter_data_feed.c | 3 +- src/modules/core/filter_data_show.c | 5 +- src/modules/core/filter_gamma.c | 5 +- src/modules/core/filter_gamma.h | 28 ---- src/modules/core/filter_greyscale.c | 5 +- src/modules/core/filter_greyscale.h | 28 ---- src/modules/core/filter_luma.c | 10 +- src/modules/core/filter_luma.h | 28 ---- src/modules/core/filter_mirror.c | 5 +- src/modules/core/filter_mirror.h | 28 ---- src/modules/core/filter_mono.c | 5 +- src/modules/core/filter_mono.h | 28 ---- src/modules/core/filter_obscure.c | 5 +- src/modules/core/filter_obscure.h | 28 ---- src/modules/core/filter_region.c | 7 +- src/modules/core/filter_region.h | 28 ---- src/modules/core/filter_rescale.c | 5 +- src/modules/core/filter_rescale.h | 28 ---- src/modules/core/filter_resize.c | 5 +- src/modules/core/filter_resize.h | 28 ---- src/modules/core/filter_transition.c | 7 +- src/modules/core/filter_transition.h | 28 ---- src/modules/core/filter_watermark.c | 11 +- src/modules/core/filter_watermark.h | 28 ---- src/modules/core/producer_colour.c | 6 +- src/modules/core/producer_colour.h | 28 ---- src/modules/core/producer_noise.c | 6 +- src/modules/core/producer_noise.h | 28 ---- src/modules/core/producer_ppm.c | 7 +- src/modules/core/producer_ppm.h | 28 ---- src/modules/core/transition_composite.c | 11 +- src/modules/core/transition_composite.h | 2 +- src/modules/core/transition_luma.c | 6 +- src/modules/core/transition_luma.h | 28 ---- src/modules/core/transition_mix.c | 4 +- src/modules/core/transition_mix.h | 28 ---- src/modules/core/transition_region.c | 13 +- src/modules/core/transition_region.h | 2 +- src/modules/dv/consumer_libdv.c | 12 +- src/modules/dv/consumer_libdv.h | 28 ---- src/modules/dv/factory.c | 20 ++- src/modules/dv/producer_libdv.c | 12 +- src/modules/dv/producer_libdv.h | 31 ---- src/modules/effectv/factory.c | 13 +- src/modules/effectv/filter_burn.c | 5 +- src/modules/effectv/filter_burn.h | 27 ---- src/modules/fezzik/factory.c | 17 ++- src/modules/fezzik/producer_fezzik.c | 28 ++-- src/modules/fezzik/producer_fezzik.h | 28 ---- src/modules/fezzik/producer_hold.c | 8 +- src/modules/fezzik/producer_hold.h | 28 ---- src/modules/gtk2/consumer_gtk2.c | 7 +- src/modules/gtk2/consumer_gtk2.h | 29 ---- src/modules/gtk2/factory.c | 23 +-- src/modules/gtk2/filter_rescale.c | 6 +- src/modules/gtk2/filter_rescale.h | 28 ---- src/modules/gtk2/producer_pango.c | 13 +- src/modules/gtk2/producer_pango.h | 37 ----- src/modules/gtk2/producer_pixbuf.c | 6 +- src/modules/gtk2/producer_pixbuf.h | 28 ---- src/modules/inigo/factory.c | 16 +- src/modules/inigo/producer_inigo.c | 38 ++--- src/modules/inigo/producer_inigo.h | 29 ---- src/modules/jackrack/factory.c | 17 ++- src/modules/jackrack/filter_jackrack.c | 5 +- src/modules/jackrack/filter_jackrack.h | 28 ---- src/modules/jackrack/filter_ladspa.c | 5 +- src/modules/jackrack/filter_ladspa.h | 28 ---- src/modules/kdenlive/factory.c | 21 +-- src/modules/kdenlive/filter_boxblur.c | 8 +- src/modules/kdenlive/filter_boxblur.h | 27 ---- src/modules/kdenlive/filter_wave.c | 8 +- src/modules/kdenlive/filter_wave.h | 27 ---- src/modules/kdenlive/producer_framebuffer.c | 11 +- src/modules/kdenlive/producer_framebuffer.h | 27 ---- src/modules/kino/factory.c | 13 +- src/modules/kino/producer_kino.c | 6 +- src/modules/kino/producer_kino.h | 28 ---- src/modules/motion_est/factory.c | 27 ++-- .../motion_est/filter_autotrack_rectangle.c | 10 +- src/modules/motion_est/filter_crop_detect.c | 2 +- src/modules/motion_est/filter_motion_est.c | 2 +- src/modules/motion_est/filter_motion_est.h | 2 +- src/modules/motion_est/filter_vismv.c | 2 +- src/modules/motion_est/producer_slowmotion.c | 11 +- src/modules/normalize/factory.c | 13 +- src/modules/normalize/filter_volume.c | 5 +- src/modules/normalize/filter_volume.h | 28 ---- src/modules/oldfilm/factory.c | 33 +++-- src/modules/oldfilm/filter_dust.c | 5 +- src/modules/oldfilm/filter_dust.h | 27 ---- src/modules/oldfilm/filter_grain.c | 5 +- src/modules/oldfilm/filter_grain.h | 27 ---- src/modules/oldfilm/filter_lines.c | 5 +- src/modules/oldfilm/filter_lines.h | 27 ---- src/modules/oldfilm/filter_oldfilm.c | 5 +- src/modules/oldfilm/filter_oldfilm.h | 27 ---- src/modules/plus/factory.c | 29 ++-- src/modules/plus/filter_affine.c | 11 +- src/modules/plus/filter_affine.h | 28 ---- src/modules/plus/filter_charcoal.c | 5 +- src/modules/plus/filter_charcoal.h | 28 ---- src/modules/plus/filter_invert.c | 5 +- src/modules/plus/filter_invert.h | 28 ---- src/modules/plus/filter_sepia.c | 5 +- src/modules/plus/filter_sepia.h | 28 ---- src/modules/plus/transition_affine.c | 4 +- src/modules/plus/transition_affine.h | 28 ---- src/modules/qimage/factory.c | 13 +- src/modules/qimage/producer_qimage.c | 6 +- src/modules/qimage/producer_qimage.h | 28 ---- src/modules/qimage/qimage_wrapper.cpp | 2 +- src/modules/resample/factory.c | 13 +- src/modules/resample/filter_resample.c | 5 +- src/modules/resample/filter_resample.h | 28 ---- src/modules/sdl/consumer_sdl.c | 9 +- src/modules/sdl/consumer_sdl.h | 30 ---- src/modules/sdl/consumer_sdl_preview.c | 10 +- src/modules/sdl/consumer_sdl_still.c | 9 +- src/modules/sdl/factory.c | 23 +-- src/modules/sdl/producer_sdl_image.c | 6 +- src/modules/sdl/producer_sdl_image.h | 28 ---- src/modules/sox/configure | 2 +- src/modules/sox/factory.c | 13 +- src/modules/sox/filter_sox.c | 5 +- src/modules/sox/filter_sox.h | 28 ---- src/modules/valerie/consumer_valerie.c | 5 +- src/modules/valerie/consumer_valerie.h | 28 ---- src/modules/valerie/factory.c | 13 +- src/modules/vmfx/factory.c | 29 ++-- src/modules/vmfx/filter_chroma.c | 4 +- src/modules/vmfx/filter_chroma.h | 28 ---- src/modules/vmfx/filter_chroma_hold.c | 4 +- src/modules/vmfx/filter_chroma_hold.h | 28 ---- src/modules/vmfx/filter_mono.c | 4 +- src/modules/vmfx/filter_mono.h | 28 ---- src/modules/vmfx/filter_shape.c | 7 +- src/modules/vmfx/filter_shape.h | 28 ---- src/modules/vmfx/producer_pgm.c | 6 +- src/modules/vmfx/producer_pgm.h | 28 ---- src/modules/vorbis/factory.c | 13 +- src/modules/vorbis/producer_vorbis.c | 8 +- src/modules/vorbis/producer_vorbis.h | 28 ---- src/modules/westley/consumer_westley.c | 5 +- src/modules/westley/consumer_westley.h | 28 ---- src/modules/westley/factory.c | 19 +-- src/modules/westley/producer_westley.c | 19 ++- src/modules/westley/producer_westley.h | 28 ---- src/modules/xine/factory.c | 14 +- src/modules/xine/filter_deinterlace.c | 4 +- src/modules/xine/filter_deinterlace.h | 28 ---- src/valerie/valerie_remote.c | 2 +- 193 files changed, 894 insertions(+), 2610 deletions(-) delete mode 100644 src/modules/avformat/consumer_avformat.h delete mode 100644 src/modules/avformat/filter_avcolour_space.h delete mode 100644 src/modules/avformat/filter_avdeinterlace.h delete mode 100644 src/modules/avformat/filter_avresample.h delete mode 100644 src/modules/avformat/producer_avformat.h delete mode 100644 src/modules/core/consumer_null.h delete mode 100644 src/modules/core/filter_brightness.h delete mode 100644 src/modules/core/filter_channelcopy.h delete mode 100644 src/modules/core/filter_data.h delete mode 100644 src/modules/core/filter_gamma.h delete mode 100644 src/modules/core/filter_greyscale.h delete mode 100644 src/modules/core/filter_luma.h delete mode 100644 src/modules/core/filter_mirror.h delete mode 100644 src/modules/core/filter_mono.h delete mode 100644 src/modules/core/filter_obscure.h delete mode 100644 src/modules/core/filter_region.h delete mode 100644 src/modules/core/filter_rescale.h delete mode 100644 src/modules/core/filter_resize.h delete mode 100644 src/modules/core/filter_transition.h delete mode 100644 src/modules/core/filter_watermark.h delete mode 100644 src/modules/core/producer_colour.h delete mode 100644 src/modules/core/producer_noise.h delete mode 100644 src/modules/core/producer_ppm.h delete mode 100644 src/modules/core/transition_luma.h delete mode 100644 src/modules/core/transition_mix.h delete mode 100644 src/modules/dv/consumer_libdv.h delete mode 100644 src/modules/dv/producer_libdv.h delete mode 100644 src/modules/effectv/filter_burn.h delete mode 100644 src/modules/fezzik/producer_fezzik.h delete mode 100644 src/modules/fezzik/producer_hold.h delete mode 100644 src/modules/gtk2/consumer_gtk2.h delete mode 100644 src/modules/gtk2/filter_rescale.h delete mode 100644 src/modules/gtk2/producer_pango.h delete mode 100644 src/modules/gtk2/producer_pixbuf.h delete mode 100644 src/modules/inigo/producer_inigo.h delete mode 100644 src/modules/jackrack/filter_jackrack.h delete mode 100644 src/modules/jackrack/filter_ladspa.h delete mode 100644 src/modules/kdenlive/filter_boxblur.h delete mode 100644 src/modules/kdenlive/filter_wave.h delete mode 100644 src/modules/kdenlive/producer_framebuffer.h delete mode 100644 src/modules/kino/producer_kino.h delete mode 100644 src/modules/normalize/filter_volume.h delete mode 100644 src/modules/oldfilm/filter_dust.h delete mode 100644 src/modules/oldfilm/filter_grain.h delete mode 100644 src/modules/oldfilm/filter_lines.h delete mode 100644 src/modules/oldfilm/filter_oldfilm.h delete mode 100644 src/modules/plus/filter_affine.h delete mode 100644 src/modules/plus/filter_charcoal.h delete mode 100644 src/modules/plus/filter_invert.h delete mode 100644 src/modules/plus/filter_sepia.h delete mode 100644 src/modules/plus/transition_affine.h delete mode 100644 src/modules/qimage/producer_qimage.h delete mode 100644 src/modules/resample/filter_resample.h delete mode 100644 src/modules/sdl/consumer_sdl.h delete mode 100644 src/modules/sdl/producer_sdl_image.h delete mode 100644 src/modules/sox/filter_sox.h delete mode 100644 src/modules/valerie/consumer_valerie.h delete mode 100644 src/modules/vmfx/filter_chroma.h delete mode 100644 src/modules/vmfx/filter_chroma_hold.h delete mode 100644 src/modules/vmfx/filter_mono.h delete mode 100644 src/modules/vmfx/filter_shape.h delete mode 100644 src/modules/vmfx/producer_pgm.h delete mode 100644 src/modules/vorbis/producer_vorbis.h delete mode 100644 src/modules/westley/consumer_westley.h delete mode 100644 src/modules/westley/producer_westley.h delete mode 100644 src/modules/xine/filter_deinterlace.h diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c index eb725403..04b37618 100644 --- a/src/framework/mlt_consumer.c +++ b/src/framework/mlt_consumer.c @@ -33,14 +33,12 @@ 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. diff --git a/src/framework/mlt_consumer.h b/src/framework/mlt_consumer.h index f39fd9a5..e33eb1ed 100644 --- a/src/framework/mlt_consumer.h +++ b/src/framework/mlt_consumer.h @@ -22,6 +22,7 @@ #define _MLT_CONSUMER_H_ #include "mlt_service.h" +#include "mlt_events.h" #include /** 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 diff --git a/src/framework/mlt_factory.c b/src/framework/mlt_factory.c index 3d7759c5..cd19b158 100644 --- a/src/framework/mlt_factory.c +++ b/src/framework/mlt_factory.c @@ -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(); } } diff --git a/src/framework/mlt_factory.h b/src/framework/mlt_factory.h index 749a2011..d302521d 100644 --- a/src/framework/mlt_factory.h +++ b/src/framework/mlt_factory.h @@ -22,16 +22,17 @@ #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( ); diff --git a/src/framework/mlt_filter.c b/src/framework/mlt_filter.c index 6723d2f1..8a3de98c 100644 --- a/src/framework/mlt_filter.c +++ b/src/framework/mlt_filter.c @@ -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; } } diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index a34579ed..2d22c782 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -32,13 +32,15 @@ /** 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 ); diff --git a/src/framework/mlt_frame.h b/src/framework/mlt_frame.h index 7988037d..941d8ff4 100644 --- a/src/framework/mlt_frame.h +++ b/src/framework/mlt_frame.h @@ -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 ); diff --git a/src/framework/mlt_geometry.c b/src/framework/mlt_geometry.c index 67d98ee9..db9c877c 100644 --- a/src/framework/mlt_geometry.c +++ b/src/framework/mlt_geometry.c @@ -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 { diff --git a/src/framework/mlt_multitrack.c b/src/framework/mlt_multitrack.c index 929d4bd3..4637d629 100644 --- a/src/framework/mlt_multitrack.c +++ b/src/framework/mlt_multitrack.c @@ -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 ) ); diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index 7dbbd7b0..b5e7fb35 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -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 ); diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index 5d3963c5..7f95e858 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -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 ); diff --git a/src/framework/mlt_profile.c b/src/framework/mlt_profile.c index e9565ecf..778bb538 100644 --- a/src/framework/mlt_profile.c +++ b/src/framework/mlt_profile.c @@ -28,44 +28,15 @@ #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 ) { diff --git a/src/framework/mlt_profile.h b/src/framework/mlt_profile.h index 0c64e7c0..6b0c42d9 100644 --- a/src/framework/mlt_profile.h +++ b/src/framework/mlt_profile.h @@ -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 diff --git a/src/framework/mlt_repository.c b/src/framework/mlt_repository.c index 4241331a..826268dc 100644 --- a/src/framework/mlt_repository.c +++ b/src/framework/mlt_repository.c @@ -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; diff --git a/src/framework/mlt_repository.h b/src/framework/mlt_repository.h index 5332c577..f4b2e2c3 100644 --- a/src/framework/mlt_repository.h +++ b/src/framework/mlt_repository.h @@ -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 diff --git a/src/framework/mlt_service.c b/src/framework/mlt_service.c index aedc6eff..49779bc0 100644 --- a/src/framework/mlt_service.c +++ b/src/framework/mlt_service.c @@ -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. */ diff --git a/src/framework/mlt_service.h b/src/framework/mlt_service.h index b1bad7e9..a2d71a5d 100644 --- a/src/framework/mlt_service.h +++ b/src/framework/mlt_service.h @@ -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 ); diff --git a/src/framework/mlt_tractor.c b/src/framework/mlt_tractor.c index 0d47b3fa..29ee362f 100644 --- a/src/framework/mlt_tractor.c +++ b/src/framework/mlt_tractor.c @@ -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; } } diff --git a/src/inigo/inigo.c b/src/inigo/inigo.c index 95aeb404..da12d01a 100644 --- a/src/inigo/inigo.c +++ b/src/inigo/inigo.c @@ -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; diff --git a/src/miracle/miracle_connection.c b/src/miracle/miracle_connection.c index 30eef7a7..aafb63d3 100644 --- a/src/miracle/miracle_connection.c +++ b/src/miracle/miracle_connection.c @@ -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 ); diff --git a/src/miracle/miracle_unit.c b/src/miracle/miracle_unit.c index c9471d34..4974e387 100644 --- a/src/miracle/miracle_unit.c +++ b/src/miracle/miracle_unit.c @@ -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. diff --git a/src/miracle/miracle_unit_commands.c b/src/miracle/miracle_unit_commands.c index 81e439c2..97fb2dd0 100644 --- a/src/miracle/miracle_unit_commands.c +++ b/src/miracle/miracle_unit_commands.c @@ -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; } diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c index 077bd52d..5a1ab272 100644 --- a/src/modules/avformat/consumer_avformat.c +++ b/src/modules/avformat/consumer_avformat.c @@ -18,10 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// Local header files -#include "consumer_avformat.h" - // mlt Header files +#include #include // 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 index 51b8a343..00000000 --- a/src/modules/avformat/consumer_avformat.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * consumer_avformat.h -- avformat consumer - * 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_AVFORMAT_H_ -#define _CONSUMER_AVFORMAT_H_ - -#include - -extern mlt_consumer consumer_avformat_init( char *file ); - -#endif diff --git a/src/modules/avformat/factory.c b/src/modules/avformat/factory.c index 5ccb204f..c197d901 100644 --- a/src/modules/avformat/factory.c +++ b/src/modules/avformat/factory.c @@ -21,12 +21,13 @@ #include #include -#include -#include "producer_avformat.h" -#include "consumer_avformat.h" -#include "filter_avcolour_space.h" -#include "filter_avdeinterlace.h" -#include "filter_avresample.h" +#include + +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 @@ -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; } diff --git a/src/modules/avformat/filter_avcolour_space.c b/src/modules/avformat/filter_avcolour_space.c index 9c974727..7e0ce929 100644 --- a/src/modules/avformat/filter_avcolour_space.c +++ b/src/modules/avformat/filter_avcolour_space.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_avcolour_space.h" - +#include #include // 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 index 75b06599..00000000 --- a/src/modules/avformat/filter_avcolour_space.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_avcolour_space.h -- colourspace filter - * Copyright (C) 2004-2005 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 _FILTER_AVCOLOUR_SPACE_H -#define _FILTER_AVCOLOUR_SPACE_H - -#include - -extern mlt_filter filter_avcolour_space_init( void *arg ); - -#endif diff --git a/src/modules/avformat/filter_avdeinterlace.c b/src/modules/avformat/filter_avdeinterlace.c index d5c04beb..25b51359 100644 --- a/src/modules/avformat/filter_avdeinterlace.c +++ b/src/modules/avformat/filter_avdeinterlace.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_avdeinterlace.h" - +#include #include #include diff --git a/src/modules/avformat/filter_avdeinterlace.h b/src/modules/avformat/filter_avdeinterlace.h deleted file mode 100644 index b5b7f164..00000000 --- a/src/modules/avformat/filter_avdeinterlace.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_avdeinterlace.h -- deinterlace filter - * 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 _FILTER_AVDEINTERLACE_H_ -#define _FILTER_AVDEINTERLACE_H_ - -#include - -extern mlt_filter filter_avdeinterlace_init( void *arg ); - -#endif diff --git a/src/modules/avformat/filter_avresample.c b/src/modules/avformat/filter_avresample.c index 7525004b..3252246a 100644 --- a/src/modules/avformat/filter_avresample.c +++ b/src/modules/avformat/filter_avresample.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_avresample.h" - +#include #include #include diff --git a/src/modules/avformat/filter_avresample.h b/src/modules/avformat/filter_avresample.h deleted file mode 100644 index 8cfce883..00000000 --- a/src/modules/avformat/filter_avresample.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_avresample.h -- adjust audio sample frequency - * 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 _FILTER_AVRESAMPLE_H_ -#define _FILTER_AVRESAMPLE_H_ - -#include - -extern mlt_filter filter_avresample_init( char *arg ); - -#endif diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index ec20a7a7..dda7299e 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -18,10 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// Local header files -#include "producer_avformat.h" - // MLT Header files +#include #include // 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 index 99e84767..00000000 --- a/src/modules/avformat/producer_avformat.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_avformat.h -- avformat producer - * 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 _PRODUCER_AVFORMAT_H_ -#define _PRODUCER_AVFORMAT_H_ - -#include - -extern mlt_producer producer_avformat_init( char *file ); - -#endif diff --git a/src/modules/core/consumer_null.c b/src/modules/core/consumer_null.c index ef1f9540..e96c8cda 100644 --- a/src/modules/core/consumer_null.c +++ b/src/modules/core/consumer_null.c @@ -18,10 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// Local header files -#include "consumer_null.h" - // mlt Header files +#include #include // 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 index 9996835f..00000000 --- a/src/modules/core/consumer_null.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * consumer_null.h -- null consumer - * 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_NULL_H_ -#define _CONSUMER_NULL_H - -#include - -extern mlt_consumer consumer_null_init( char *arg ); - -#endif diff --git a/src/modules/core/factory.c b/src/modules/core/factory.c index c90a6654..2c92efb6 100644 --- a/src/modules/core/factory.c +++ b/src/modules/core/factory.c @@ -18,95 +18,97 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#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; } diff --git a/src/modules/core/filter_brightness.c b/src/modules/core/filter_brightness.c index 4b2db03a..d597e8ab 100644 --- a/src/modules/core/filter_brightness.c +++ b/src/modules/core/filter_brightness.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_brightness.h" - +#include #include #include @@ -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 index 9bfa502c..00000000 --- a/src/modules/core/filter_brightness.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_brightness.h -- gamma filter - * 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 _FILTER_BRIGHTNESS_H_ -#define _FILTER_BRIGHTNESS_H_ - -#include - -extern mlt_filter filter_brightness_init( char *arg ); - -#endif diff --git a/src/modules/core/filter_channelcopy.c b/src/modules/core/filter_channelcopy.c index 03073708..d4dd697c 100644 --- a/src/modules/core/filter_channelcopy.c +++ b/src/modules/core/filter_channelcopy.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_channelcopy.h" - +#include #include #include @@ -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 index 9407e2d2..00000000 --- a/src/modules/core/filter_channelcopy.h +++ /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 - * - * 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 - -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 index 3e9d2499..00000000 --- a/src/modules/core/filter_data.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * filter_data.h -- data feed and show filters - * Copyright (C) 2004-2005 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 _MLT_FILTER_DATA_H_ -#define _MLT_FILTER_DATA_H_ - -#include - -extern mlt_filter filter_data_feed_init( char * ); -extern mlt_filter filter_data_show_init( char * ); - -#endif - diff --git a/src/modules/core/filter_data_feed.c b/src/modules/core/filter_data_feed.c index bc986053..e3cf81d3 100644 --- a/src/modules/core/filter_data_feed.c +++ b/src/modules/core/filter_data_feed.c @@ -20,7 +20,6 @@ #include #include -#include "filter_data.h" #include /** 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( ); diff --git a/src/modules/core/filter_data_show.c b/src/modules/core/filter_data_show.c index 3dfd7cb9..7c9ab3d6 100644 --- a/src/modules/core/filter_data_show.c +++ b/src/modules/core/filter_data_show.c @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_data.h" #include #include #include @@ -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( ); diff --git a/src/modules/core/filter_gamma.c b/src/modules/core/filter_gamma.c index 710cbaa0..e4fe15b3 100644 --- a/src/modules/core/filter_gamma.c +++ b/src/modules/core/filter_gamma.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_gamma.h" - +#include #include #include @@ -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 index 91c13391..00000000 --- a/src/modules/core/filter_gamma.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_gamma.h -- gamma filter - * 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 _FILTER_GAMMA_H_ -#define _FILTER_GAMMA_H_ - -#include - -extern mlt_filter filter_gamma_init( char *arg ); - -#endif diff --git a/src/modules/core/filter_greyscale.c b/src/modules/core/filter_greyscale.c index d799e72d..fd618c09 100644 --- a/src/modules/core/filter_greyscale.c +++ b/src/modules/core/filter_greyscale.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_greyscale.h" - +#include #include #include @@ -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 index c1056aa4..00000000 --- a/src/modules/core/filter_greyscale.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_greyscale.h -- greyscale filter - * 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 _FILTER_GREYSCALE_H_ -#define _FILTER_GREYSCALE_H_ - -#include - -extern mlt_filter filter_greyscale_init( void *arg ); - -#endif diff --git a/src/modules/core/filter_luma.c b/src/modules/core/filter_luma.c index 0e2afdb2..f2e11567 100644 --- a/src/modules/core/filter_luma.c +++ b/src/modules/core/filter_luma.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_luma.h" - +#include #include #include #include @@ -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 index 23500518..00000000 --- a/src/modules/core/filter_luma.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_luma.h -- luma filter - * 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 _FILTER_LUMA_H_ -#define _FILTER_LUMA_H_ - -#include - -extern mlt_filter filter_luma_init( void *arg ); - -#endif diff --git a/src/modules/core/filter_mirror.c b/src/modules/core/filter_mirror.c index 9608d2b4..3dd6dbfc 100644 --- a/src/modules/core/filter_mirror.c +++ b/src/modules/core/filter_mirror.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_mirror.h" - +#include #include #include @@ -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 index f8b56d2f..00000000 --- a/src/modules/core/filter_mirror.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_mirror.h -- mirror filter - * 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 _FILTER_MIRROR_H_ -#define _FILTER_MIRROR_H_ - -#include - -extern mlt_filter filter_mirror_init( void *arg ); - -#endif diff --git a/src/modules/core/filter_mono.c b/src/modules/core/filter_mono.c index 1c6b5129..882d6f34 100644 --- a/src/modules/core/filter_mono.c +++ b/src/modules/core/filter_mono.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_mono.h" - +#include #include #include @@ -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 index e0cfb69f..00000000 --- a/src/modules/core/filter_mono.h +++ /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 - * - * 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 - -extern mlt_filter filter_mono_init( char *arg ); - -#endif diff --git a/src/modules/core/filter_obscure.c b/src/modules/core/filter_obscure.c index ccd108a3..7256f6cc 100644 --- a/src/modules/core/filter_obscure.c +++ b/src/modules/core/filter_obscure.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_obscure.h" - +#include #include #include @@ -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 index 48b38500..00000000 --- a/src/modules/core/filter_obscure.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_obscure.h -- obscure filter - * 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 _FILTER_OBSCURE_H_ -#define _FILTER_OBSCURE_H_ - -#include - -extern mlt_filter filter_obscure_init( void *arg ); - -#endif diff --git a/src/modules/core/filter_region.c b/src/modules/core/filter_region.c index 392faeca..8fd8e8d6 100644 --- a/src/modules/core/filter_region.c +++ b/src/modules/core/filter_region.c @@ -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 #include #include @@ -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 index de307226..00000000 --- a/src/modules/core/filter_region.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_region.h -- region filter - * 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 _FILTER_REGION_H_ -#define _FILTER_REGION_H_ - -#include - -extern mlt_filter filter_region_init( void *arg ); - -#endif diff --git a/src/modules/core/filter_rescale.c b/src/modules/core/filter_rescale.c index e8236166..6251ca89 100644 --- a/src/modules/core/filter_rescale.c +++ b/src/modules/core/filter_rescale.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_rescale.h" - +#include #include #include @@ -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 index 068b7061..00000000 --- a/src/modules/core/filter_rescale.h +++ /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 - * - * 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 - -extern mlt_filter filter_rescale_init( char *arg ); - -#endif diff --git a/src/modules/core/filter_resize.c b/src/modules/core/filter_resize.c index 005be7db..128c86b8 100644 --- a/src/modules/core/filter_resize.c +++ b/src/modules/core/filter_resize.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_resize.h" - +#include #include #include @@ -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 index 4e81f81c..00000000 --- a/src/modules/core/filter_resize.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_resize.h -- resizing filter - * 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 _FILTER_RESIZE_H_ -#define _FILTER_RESIZE_H_ - -#include - -extern mlt_filter filter_resize_init( char *arg ); - -#endif diff --git a/src/modules/core/filter_transition.c b/src/modules/core/filter_transition.c index 297b6c0a..cd3f4623 100644 --- a/src/modules/core/filter_transition.c +++ b/src/modules/core/filter_transition.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_transition.h" +#include #include #include #include @@ -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 index 043636cd..00000000 --- a/src/modules/core/filter_transition.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_transition.h -- Convert any transition into a filter - * Copyright (C) 2005 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 _FILTER_TRANSITION_H_ -#define _FILTER_TRANSITION_H_ - -#include - -extern mlt_filter filter_transition_init( char *arg ); - -#endif diff --git a/src/modules/core/filter_watermark.c b/src/modules/core/filter_watermark.c index 41aa7f85..ce1b0f17 100644 --- a/src/modules/core/filter_watermark.c +++ b/src/modules/core/filter_watermark.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_watermark.h" - +#include #include #include #include @@ -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 index 57c6aa67..00000000 --- a/src/modules/core/filter_watermark.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_watermark.h -- watermark filter - * 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 _FILTER_WATERMARK_H_ -#define _FILTER_WATERMARK_H_ - -#include - -extern mlt_filter filter_watermark_init( void *arg ); - -#endif diff --git a/src/modules/core/producer_colour.c b/src/modules/core/producer_colour.c index 7eeaac74..c044f416 100644 --- a/src/modules/core/producer_colour.c +++ b/src/modules/core/producer_colour.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_colour.h" +#include #include #include @@ -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 index 63e27bb2..00000000 --- a/src/modules/core/producer_colour.h +++ /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 - * - * 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 - -extern mlt_producer producer_colour_init( char *filename ); - -#endif diff --git a/src/modules/core/producer_noise.c b/src/modules/core/producer_noise.c index 996721d5..825f5912 100644 --- a/src/modules/core/producer_noise.c +++ b/src/modules/core/producer_noise.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_noise.h" +#include #include #include @@ -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 index a3c6e4de..00000000 --- a/src/modules/core/producer_noise.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_noise.h -- noise generating producer - * 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 _PRODUCER_NOISE_H_ -#define _PRODUCER_NOISE_H_ - -#include - -extern mlt_producer producer_noise_init( void *arg ); - -#endif diff --git a/src/modules/core/producer_ppm.c b/src/modules/core/producer_ppm.c index dbd74ac6..01215790 100644 --- a/src/modules/core/producer_ppm.c +++ b/src/modules/core/producer_ppm.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_ppm.h" - +#include #include #include @@ -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 index 45e3c66b..00000000 --- a/src/modules/core/producer_ppm.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_ppm.h -- simple ppm test case - * 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 _PRODUCER_PPM_H_ -#define _PRODUCER_PPM_H_ - -#include - -extern mlt_producer producer_ppm_init( void *command ); - -#endif diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index fdad2cfe..4010e4f2 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -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 ) diff --git a/src/modules/core/transition_composite.h b/src/modules/core/transition_composite.h index 70d2abd6..6523b95b 100644 --- a/src/modules/core/transition_composite.h +++ b/src/modules/core/transition_composite.h @@ -23,7 +23,7 @@ #include -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 ); diff --git a/src/modules/core/transition_luma.c b/src/modules/core/transition_luma.c index 4b87b2ae..a553836c 100644 --- a/src/modules/core/transition_luma.c +++ b/src/modules/core/transition_luma.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "transition_luma.h" #include #include @@ -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 index 1b78c5e9..00000000 --- a/src/modules/core/transition_luma.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * transition_luma.h -- a generic dissolve/wipe processor - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 - -extern mlt_transition transition_luma_init( char *lumafile ); - -#endif diff --git a/src/modules/core/transition_mix.c b/src/modules/core/transition_mix.c index 1dfda2e8..d3bad10c 100644 --- a/src/modules/core/transition_mix.c +++ b/src/modules/core/transition_mix.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "transition_mix.h" +#include #include #include @@ -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 index 2987fd98..00000000 --- a/src/modules/core/transition_mix.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * transition_mix.h -- mix two audio streams - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 - -extern mlt_transition transition_mix_init( char *arg ); - -#endif diff --git a/src/modules/core/transition_region.c b/src/modules/core/transition_region.c index 59c856da..77878dd1 100644 --- a/src/modules/core/transition_region.c +++ b/src/modules/core/transition_region.c @@ -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", "" ); } - // 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( ); diff --git a/src/modules/core/transition_region.h b/src/modules/core/transition_region.h index 98abdc4c..f08ad0e1 100644 --- a/src/modules/core/transition_region.h +++ b/src/modules/core/transition_region.h @@ -23,6 +23,6 @@ #include -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 diff --git a/src/modules/dv/consumer_libdv.c b/src/modules/dv/consumer_libdv.c index f6c468e3..2ee9b206 100644 --- a/src/modules/dv/consumer_libdv.c +++ b/src/modules/dv/consumer_libdv.c @@ -18,11 +18,8 @@ * 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 #include // System header files @@ -34,6 +31,9 @@ // libdv header files #include +#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 index 5d46416f..00000000 --- a/src/modules/dv/consumer_libdv.h +++ /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 - * - * 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 - -extern mlt_consumer consumer_libdv_init( char *filename ); - -#endif diff --git a/src/modules/dv/factory.c b/src/modules/dv/factory.c index 26f40050..694032cf 100644 --- a/src/modules/dv/factory.c +++ b/src/modules/dv/factory.c @@ -20,30 +20,34 @@ #include -#include "producer_libdv.h" -#include "consumer_libdv.h" +#include +#include -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; } diff --git a/src/modules/dv/producer_libdv.c b/src/modules/dv/producer_libdv.c index a7c10b34..b593b533 100644 --- a/src/modules/dv/producer_libdv.c +++ b/src/modules/dv/producer_libdv.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_libdv.h" +#include #include #include #include @@ -32,6 +32,9 @@ #include #include +#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 index a6b1b1ad..00000000 --- a/src/modules/dv/producer_libdv.h +++ /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 - * - * 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 - -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 diff --git a/src/modules/effectv/factory.c b/src/modules/effectv/factory.c index 06320d8c..2092b40a 100644 --- a/src/modules/effectv/factory.c +++ b/src/modules/effectv/factory.c @@ -17,28 +17,29 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include -#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; } diff --git a/src/modules/effectv/filter_burn.c b/src/modules/effectv/filter_burn.c index d5a579b5..967e2630 100644 --- a/src/modules/effectv/filter_burn.c +++ b/src/modules/effectv/filter_burn.c @@ -26,8 +26,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_burn.h" - +#include #include #include @@ -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 index 8c8e731b..00000000 --- a/src/modules/effectv/filter_burn.h +++ /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 - -extern mlt_filter filter_burn_init( char *arg ); - -#endif diff --git a/src/modules/fezzik/factory.c b/src/modules/fezzik/factory.c index bda4980b..33bfb079 100644 --- a/src/modules/fezzik/factory.c +++ b/src/modules/fezzik/factory.c @@ -18,31 +18,32 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#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; } diff --git a/src/modules/fezzik/producer_fezzik.c b/src/modules/fezzik/producer_fezzik.c index 0d461686..f5350c82 100644 --- a/src/modules/fezzik/producer_fezzik.c +++ b/src/modules/fezzik/producer_fezzik.c @@ -18,8 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_fezzik.h" - #include #include #include @@ -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 index fbf5cee4..00000000 --- a/src/modules/fezzik/producer_fezzik.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_fezzik.h -- a normalising producer - * 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 _PRODUCER_FEZZIK_H_ -#define _PRODUCER_FEZZIK_H_ - -#include - -extern mlt_producer producer_fezzik_init( char *args ); - -#endif diff --git a/src/modules/fezzik/producer_hold.c b/src/modules/fezzik/producer_hold.c index 9632932d..f30aa0c3 100644 --- a/src/modules/fezzik/producer_hold.c +++ b/src/modules/fezzik/producer_hold.c @@ -18,8 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_hold.h" - #include #include #include @@ -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 index fe63637c..00000000 --- a/src/modules/fezzik/producer_hold.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_hold.h -- a frame holding producer - * 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 _PRODUCER_HOLD_H_ -#define _PRODUCER_HOLD_H_ - -#include - -extern mlt_producer producer_hold_init( char *args ); - -#endif diff --git a/src/modules/gtk2/consumer_gtk2.c b/src/modules/gtk2/consumer_gtk2.c index d1232b01..dc1619e3 100644 --- a/src/modules/gtk2/consumer_gtk2.c +++ b/src/modules/gtk2/consumer_gtk2.c @@ -18,15 +18,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "consumer_gtk2.h" - #include #include #include #include #include +#include -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 index 35707a31..00000000 --- a/src/modules/gtk2/consumer_gtk2.h +++ /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 -#include - -extern mlt_consumer consumer_gtk2_preview_init( GtkWidget *widget ); - -#endif diff --git a/src/modules/gtk2/factory.c b/src/modules/gtk2/factory.c index be504169..8b5e1123 100644 --- a/src/modules/gtk2/factory.c +++ b/src/modules/gtk2/factory.c @@ -20,19 +20,20 @@ #include "config.h" #include +#include +#include #ifdef USE_PIXBUF -#include -#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; diff --git a/src/modules/gtk2/filter_rescale.c b/src/modules/gtk2/filter_rescale.c index 774c0d68..e3b6d17a 100644 --- a/src/modules/gtk2/filter_rescale.c +++ b/src/modules/gtk2/filter_rescale.c @@ -18,9 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_rescale.h" #include "pixops.h" +#include #include #include @@ -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 index 068b7061..00000000 --- a/src/modules/gtk2/filter_rescale.h +++ /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 - * - * 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 - -extern mlt_filter filter_rescale_init( char *arg ); - -#endif diff --git a/src/modules/gtk2/producer_pango.c b/src/modules/gtk2/producer_pango.c index 52bf2ff2..2368d3ec 100644 --- a/src/modules/gtk2/producer_pango.c +++ b/src/modules/gtk2/producer_pango.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_pango.h" +#include #include #include #include @@ -30,6 +30,15 @@ #include #include +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 index 8295131a..00000000 --- a/src/modules/gtk2/producer_pango.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * producer_pango.h -- a pango-based titler - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 - -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 diff --git a/src/modules/gtk2/producer_pixbuf.c b/src/modules/gtk2/producer_pixbuf.c index a5c559c2..052f01b1 100644 --- a/src/modules/gtk2/producer_pixbuf.c +++ b/src/modules/gtk2/producer_pixbuf.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_pixbuf.h" +#include #include #include @@ -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 index 47d9624a..00000000 --- a/src/modules/gtk2/producer_pixbuf.h +++ /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 - * - * 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 - -extern mlt_producer producer_pixbuf_init( char *filename ); - -#endif diff --git a/src/modules/inigo/factory.c b/src/modules/inigo/factory.c index f4488fe6..ef8efcd1 100644 --- a/src/modules/inigo/factory.c +++ b/src/modules/inigo/factory.c @@ -19,29 +19,31 @@ */ #include +#include -#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; } diff --git a/src/modules/inigo/producer_inigo.c b/src/modules/inigo/producer_inigo.c index 6de55781..1970f9c2 100644 --- a/src/modules/inigo/producer_inigo.c +++ b/src/modules/inigo/producer_inigo.c @@ -18,15 +18,15 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_inigo.h" - #include #include #include #include -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 ], " - * - * 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 - -extern mlt_producer producer_inigo_file_init( char *args ); -extern mlt_producer producer_inigo_init( char **args ); - -#endif diff --git a/src/modules/jackrack/factory.c b/src/modules/jackrack/factory.c index a5fb16e9..e3121f26 100644 --- a/src/modules/jackrack/factory.c +++ b/src/modules/jackrack/factory.c @@ -19,30 +19,31 @@ */ #include +#include -#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; } diff --git a/src/modules/jackrack/filter_jackrack.c b/src/modules/jackrack/filter_jackrack.c index 0715ec15..0c9fe9bf 100644 --- a/src/modules/jackrack/filter_jackrack.c +++ b/src/modules/jackrack/filter_jackrack.c @@ -18,8 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_jackrack.h" - +#include #include #include @@ -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 index 2215f05c..00000000 --- a/src/modules/jackrack/filter_jackrack.h +++ /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 - * - * 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 - -extern mlt_filter filter_jackrack_init( char *arg ); - -#endif diff --git a/src/modules/jackrack/filter_ladspa.c b/src/modules/jackrack/filter_ladspa.c index b9b362dd..7eff6fab 100644 --- a/src/modules/jackrack/filter_ladspa.c +++ b/src/modules/jackrack/filter_ladspa.c @@ -18,8 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_ladspa.h" - +#include #include #include @@ -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 index 04fc9eda..00000000 --- a/src/modules/jackrack/filter_ladspa.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_ladspa.h -- filter audio through LADSPA plugins - * Copyright (C) 2004-2005 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 - -extern mlt_filter filter_ladspa_init( char *arg ); - -#endif diff --git a/src/modules/kdenlive/factory.c b/src/modules/kdenlive/factory.c index 1d83b20f..1cc4dc6a 100644 --- a/src/modules/kdenlive/factory.c +++ b/src/modules/kdenlive/factory.c @@ -18,33 +18,34 @@ */ #include +#include -#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; } diff --git a/src/modules/kdenlive/filter_boxblur.c b/src/modules/kdenlive/filter_boxblur.c index 30d9d58e..f2316d0c 100644 --- a/src/modules/kdenlive/filter_boxblur.c +++ b/src/modules/kdenlive/filter_boxblur.c @@ -1,6 +1,7 @@ /* * filter_boxblur.c -- blur filter - * Author: Leny Grisel + * Copyright (C) ?-2007 Leny Grisel + * Copyright (C) 2007 Jean-Baptiste Mardelle * * 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 #include #include @@ -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 index f51f9535..00000000 --- a/src/modules/kdenlive/filter_boxblur.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * filter_boxblur.h -- box blur filter - * Author: Leny Grisel - * - * 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 - -extern mlt_filter filter_boxblur_init( char *arg ); - -#endif diff --git a/src/modules/kdenlive/filter_wave.c b/src/modules/kdenlive/filter_wave.c index ac7a9829..d01944f1 100644 --- a/src/modules/kdenlive/filter_wave.c +++ b/src/modules/kdenlive/filter_wave.c @@ -1,6 +1,7 @@ /* * wave.c -- wave filter - * Author: Leny Grisel + * Copyright (C) ?-2007 Leny Grisel + * Copyright (C) 2007 Jean-Baptiste Mardelle * * 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 #include #include @@ -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 index 10fda124..00000000 --- a/src/modules/kdenlive/filter_wave.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * filter_wave.h -- wave filter - * Author: Leny Grisel - * - * 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 - -extern mlt_filter filter_wave_init( char *arg ); - -#endif diff --git a/src/modules/kdenlive/producer_framebuffer.c b/src/modules/kdenlive/producer_framebuffer.c index 4bdf92a0..bb25ae3f 100644 --- a/src/modules/kdenlive/producer_framebuffer.c +++ b/src/modules/kdenlive/producer_framebuffer.c @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_framebuffer.h" #include #include @@ -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 index 6c91cd27..00000000 --- a/src/modules/kdenlive/producer_framebuffer.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * producer_framebuffer.h -- slowmotion and reverse playing - * Copyright (C) 2007 Jean-Baptiste Mardelle - * - * 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 - -extern mlt_producer producer_framebuffer_init( char *arg ); - -#endif diff --git a/src/modules/kino/factory.c b/src/modules/kino/factory.c index bbae5055..9316abb8 100644 --- a/src/modules/kino/factory.c +++ b/src/modules/kino/factory.c @@ -19,27 +19,28 @@ */ #include +#include -#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; } diff --git a/src/modules/kino/producer_kino.c b/src/modules/kino/producer_kino.c index 3d45f40c..7f94a9e7 100644 --- a/src/modules/kino/producer_kino.c +++ b/src/modules/kino/producer_kino.c @@ -19,7 +19,7 @@ */ #include -#include "producer_kino.h" +#include #include #include #include @@ -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 index 9f6f69af..00000000 --- a/src/modules/kino/producer_kino.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_kino.h -- a DV file format parser - * Copyright (C) 2005 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 - -extern mlt_producer producer_kino_init( char *filename ); - -#endif diff --git a/src/modules/motion_est/factory.c b/src/modules/motion_est/factory.c index bd00ccba..493d37f4 100644 --- a/src/modules/motion_est/factory.c +++ b/src/modules/motion_est/factory.c @@ -15,31 +15,30 @@ */ #include +#include -#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; } diff --git a/src/modules/motion_est/filter_autotrack_rectangle.c b/src/modules/motion_est/filter_autotrack_rectangle.c index bf1b2e1d..0d526e45 100644 --- a/src/modules/motion_est/filter_autotrack_rectangle.c +++ b/src/modules/motion_est/filter_autotrack_rectangle.c @@ -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 { diff --git a/src/modules/motion_est/filter_crop_detect.c b/src/modules/motion_est/filter_crop_detect.c index af58f359..8165141a 100644 --- a/src/modules/motion_est/filter_crop_detect.c +++ b/src/modules/motion_est/filter_crop_detect.c @@ -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 ) diff --git a/src/modules/motion_est/filter_motion_est.c b/src/modules/motion_est/filter_motion_est.c index 31254d61..f81a2b83 100644 --- a/src/modules/motion_est/filter_motion_est.c +++ b/src/modules/motion_est/filter_motion_est.c @@ -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 ) diff --git a/src/modules/motion_est/filter_motion_est.h b/src/modules/motion_est/filter_motion_est.h index f84e958e..296287e5 100644 --- a/src/modules/motion_est/filter_motion_est.h +++ b/src/modules/motion_est/filter_motion_est.h @@ -22,7 +22,7 @@ #include -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 diff --git a/src/modules/motion_est/filter_vismv.c b/src/modules/motion_est/filter_vismv.c index 23d1ffe2..eb0d9870 100644 --- a/src/modules/motion_est/filter_vismv.c +++ b/src/modules/motion_est/filter_vismv.c @@ -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 ) diff --git a/src/modules/motion_est/producer_slowmotion.c b/src/modules/motion_est/producer_slowmotion.c index c6b6eec2..e66db091 100644 --- a/src/modules/motion_est/producer_slowmotion.c +++ b/src/modules/motion_est/producer_slowmotion.c @@ -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) { diff --git a/src/modules/normalize/factory.c b/src/modules/normalize/factory.c index 2e07e23d..24862506 100644 --- a/src/modules/normalize/factory.c +++ b/src/modules/normalize/factory.c @@ -19,27 +19,28 @@ */ #include +#include -#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; } diff --git a/src/modules/normalize/filter_volume.c b/src/modules/normalize/filter_volume.c index 6fa708d2..e7453630 100644 --- a/src/modules/normalize/filter_volume.c +++ b/src/modules/normalize/filter_volume.c @@ -18,8 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_volume.h" - +#include #include #include @@ -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 index d5fb569e..00000000 --- a/src/modules/normalize/filter_volume.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_volume.h -- adjust audio volume - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 - -extern mlt_filter filter_volume_init( char *arg ); - -#endif diff --git a/src/modules/oldfilm/factory.c b/src/modules/oldfilm/factory.c index 893c6d28..fab77291 100644 --- a/src/modules/oldfilm/factory.c +++ b/src/modules/oldfilm/factory.c @@ -1,6 +1,6 @@ /* * factory.c -- the factory method interfaces - * Copyright (C) 2007 Jean-Baptiste Mardelle + * Copyright (c) 2007 Marco Gittler * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,37 +18,38 @@ */ #include +#include -#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; } diff --git a/src/modules/oldfilm/filter_dust.c b/src/modules/oldfilm/filter_dust.c index 8b6c852f..c1338133 100644 --- a/src/modules/oldfilm/filter_dust.c +++ b/src/modules/oldfilm/filter_dust.c @@ -17,8 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_dust.h" - +#include #include #include @@ -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 index 5072b192..00000000 --- a/src/modules/oldfilm/filter_dust.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * filter_dust.h -- dust filter - * Copyright (c) 2007 Marco Gittler - * - * 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 - -extern mlt_filter filter_dust_init( char *arg ); - -#endif diff --git a/src/modules/oldfilm/filter_grain.c b/src/modules/oldfilm/filter_grain.c index 1795dac2..7557dd40 100644 --- a/src/modules/oldfilm/filter_grain.c +++ b/src/modules/oldfilm/filter_grain.c @@ -17,8 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_grain.h" - +#include #include #include @@ -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 index 2b3d6186..00000000 --- a/src/modules/oldfilm/filter_grain.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * filter_grain.h -- grain filter - * Copyright (c) 2007 Marco Gittler - * - * 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 - -extern mlt_filter filter_grain_init( char *arg ); - -#endif diff --git a/src/modules/oldfilm/filter_lines.c b/src/modules/oldfilm/filter_lines.c index c840ae0e..5094916a 100644 --- a/src/modules/oldfilm/filter_lines.c +++ b/src/modules/oldfilm/filter_lines.c @@ -17,8 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_lines.h" - +#include #include #include @@ -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 index 3f6f3bd8..00000000 --- a/src/modules/oldfilm/filter_lines.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * filter_lines.h -- lines filter - * Copyright (c) 2007 Marco Gittler - * - * 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 - -extern mlt_filter filter_lines_init( char *arg ); - -#endif diff --git a/src/modules/oldfilm/filter_oldfilm.c b/src/modules/oldfilm/filter_oldfilm.c index 9935c70c..18fcd120 100644 --- a/src/modules/oldfilm/filter_oldfilm.c +++ b/src/modules/oldfilm/filter_oldfilm.c @@ -17,8 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_oldfilm.h" - +#include #include #include @@ -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 index af309b38..00000000 --- a/src/modules/oldfilm/filter_oldfilm.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * filter_oldfilm.h -- oldfilm filter - * Copyright (c) 2007 Marco Gittler - * - * 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 - -extern mlt_filter filter_oldfilm_init( char *arg ); - -#endif diff --git a/src/modules/plus/factory.c b/src/modules/plus/factory.c index 2e3d74d8..2ff28657 100644 --- a/src/modules/plus/factory.c +++ b/src/modules/plus/factory.c @@ -19,39 +19,40 @@ */ #include +#include -#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; } diff --git a/src/modules/plus/filter_affine.c b/src/modules/plus/filter_affine.c index f1fad025..0f28ed59 100644 --- a/src/modules/plus/filter_affine.c +++ b/src/modules/plus/filter_affine.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_affine.h" - +#include #include #include @@ -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 index 19bf6b0f..00000000 --- a/src/modules/plus/filter_affine.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_affine.h -- affine filter - * 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 _FILTER_AFFINEH_ -#define _FILTER_AFFINEH_ - -#include - -extern mlt_filter filter_affine_init( char *arg ); - -#endif diff --git a/src/modules/plus/filter_charcoal.c b/src/modules/plus/filter_charcoal.c index 3f58697e..e99981a5 100644 --- a/src/modules/plus/filter_charcoal.c +++ b/src/modules/plus/filter_charcoal.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_charcoal.h" - +#include #include #include @@ -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 index 3321b6f5..00000000 --- a/src/modules/plus/filter_charcoal.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_charcoal.h -- charcoal filter - * 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 _FILTER_CHARCOAL_H_ -#define _FILTER_CHARCOAL_H_ - -#include - -extern mlt_filter filter_charcoal_init( char *arg ); - -#endif diff --git a/src/modules/plus/filter_invert.c b/src/modules/plus/filter_invert.c index cf1c77e1..4385fc86 100644 --- a/src/modules/plus/filter_invert.c +++ b/src/modules/plus/filter_invert.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_invert.h" - +#include #include #include @@ -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 index bab0ba39..00000000 --- a/src/modules/plus/filter_invert.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_invert.h -- invert filter - * 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 _FILTER_INVERT_H_ -#define _FILTER_INVERT_H_ - -#include - -extern mlt_filter filter_invert_init( char *arg ); - -#endif diff --git a/src/modules/plus/filter_sepia.c b/src/modules/plus/filter_sepia.c index 21c3b668..aa20b23a 100644 --- a/src/modules/plus/filter_sepia.c +++ b/src/modules/plus/filter_sepia.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_sepia.h" - +#include #include #include @@ -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 index 86b6ecc4..00000000 --- a/src/modules/plus/filter_sepia.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_sepia.h -- sepia filter - * 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 _FILTER_SEPIA_H_ -#define _FILTER_SEPIA_H_ - -#include - -extern mlt_filter filter_sepia_init( char *arg ); - -#endif diff --git a/src/modules/plus/transition_affine.c b/src/modules/plus/transition_affine.c index 0da43552..98b6392e 100644 --- a/src/modules/plus/transition_affine.c +++ b/src/modules/plus/transition_affine.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "transition_affine.h" +#include #include #include @@ -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 index 2fc07c87..00000000 --- a/src/modules/plus/transition_affine.h +++ /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 - * - * 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 - -extern mlt_transition transition_affine_init( char *arg ); - -#endif diff --git a/src/modules/qimage/factory.c b/src/modules/qimage/factory.c index 5f0a5070..f9d58860 100644 --- a/src/modules/qimage/factory.c +++ b/src/modules/qimage/factory.c @@ -19,27 +19,28 @@ */ #include +#include -#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; } diff --git a/src/modules/qimage/producer_qimage.c b/src/modules/qimage/producer_qimage.c index 302bca0c..6008b7e6 100644 --- a/src/modules/qimage/producer_qimage.c +++ b/src/modules/qimage/producer_qimage.c @@ -21,7 +21,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "producer_qimage.h" +#include #include "qimage_wrapper.h" #include @@ -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 index 6a2248d7..00000000 --- a/src/modules/qimage/producer_qimage.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_qimage.h -- a QT/QImage based producer for MLT - * Copyright (C) 2006 Visual Media - * Author: Charles Yates - * - * 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 - -extern mlt_producer producer_qimage_init( char *filename ); - -#endif diff --git a/src/modules/qimage/qimage_wrapper.cpp b/src/modules/qimage/qimage_wrapper.cpp index af6838eb..63cff87b 100644 --- a/src/modules/qimage/qimage_wrapper.cpp +++ b/src/modules/qimage/qimage_wrapper.cpp @@ -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 ); diff --git a/src/modules/resample/factory.c b/src/modules/resample/factory.c index 42385a7c..769e96e9 100644 --- a/src/modules/resample/factory.c +++ b/src/modules/resample/factory.c @@ -19,27 +19,28 @@ */ #include +#include -#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; } diff --git a/src/modules/resample/filter_resample.c b/src/modules/resample/filter_resample.c index 09be4346..68384652 100644 --- a/src/modules/resample/filter_resample.c +++ b/src/modules/resample/filter_resample.c @@ -18,8 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_resample.h" - +#include #include #include @@ -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 index 6ce7eb40..00000000 --- a/src/modules/resample/filter_resample.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_resample.h -- adjust audio sample frequency - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 - -extern mlt_filter filter_resample_init( char *arg ); - -#endif diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index 9d663fd3..0736b9d3 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "consumer_sdl.h" +#include #include #include #include @@ -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 index 1c858937..00000000 --- a/src/modules/sdl/consumer_sdl.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * consumer_sdl.h -- A Simple DirectMedia Layer consumer - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Dan Dennedy - * - * 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 - -extern mlt_consumer consumer_sdl_init( char * ); -extern mlt_consumer consumer_sdl_still_init( char * ); -extern mlt_consumer consumer_sdl_preview_init( char * ); - -#endif diff --git a/src/modules/sdl/consumer_sdl_preview.c b/src/modules/sdl/consumer_sdl_preview.c index 479774e2..73661e24 100644 --- a/src/modules/sdl/consumer_sdl_preview.c +++ b/src/modules/sdl/consumer_sdl_preview.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "consumer_sdl.h" +#include #include #include #include @@ -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; diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index 9250f8dc..942726c1 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "consumer_sdl.h" +#include #include #include #include @@ -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 ); diff --git a/src/modules/sdl/factory.c b/src/modules/sdl/factory.c index 1a081a25..6ec79c00 100644 --- a/src/modules/sdl/factory.c +++ b/src/modules/sdl/factory.c @@ -19,40 +19,43 @@ */ #include +#include -#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; } diff --git a/src/modules/sdl/producer_sdl_image.c b/src/modules/sdl/producer_sdl_image.c index fd464d0c..ee881023 100644 --- a/src/modules/sdl/producer_sdl_image.c +++ b/src/modules/sdl/producer_sdl_image.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "producer_sdl_image.h" +#include #include #include @@ -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 index f464365f..00000000 --- a/src/modules/sdl/producer_sdl_image.h +++ /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 - * - * 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 - -extern mlt_producer producer_sdl_image_init( char *filename ); - -#endif diff --git a/src/modules/sox/configure b/src/modules/sox/configure index e306c0b9..16197741 100755 --- a/src/modules/sox/configure +++ b/src/modules/sox/configure @@ -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 diff --git a/src/modules/sox/factory.c b/src/modules/sox/factory.c index e50fb7f7..fc6448d2 100644 --- a/src/modules/sox/factory.c +++ b/src/modules/sox/factory.c @@ -19,27 +19,28 @@ */ #include +#include -#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; } diff --git a/src/modules/sox/filter_sox.c b/src/modules/sox/filter_sox.c index a5fa7f9a..c1676bc3 100644 --- a/src/modules/sox/filter_sox.c +++ b/src/modules/sox/filter_sox.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_sox.h" - +#include #include #include @@ -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 index 9efc36cc..00000000 --- a/src/modules/sox/filter_sox.h +++ /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 - * - * 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 - -extern mlt_filter filter_sox_init( char *arg ); - -#endif diff --git a/src/modules/valerie/consumer_valerie.c b/src/modules/valerie/consumer_valerie.c index 76a8a1c1..4d4c9a34 100644 --- a/src/modules/valerie/consumer_valerie.c +++ b/src/modules/valerie/consumer_valerie.c @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "consumer_valerie.h" #include #include #include @@ -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 index ccb19784..00000000 --- a/src/modules/valerie/consumer_valerie.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * consumer_valerie.h -- pushes a service via valerie - * 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_VALERIE_H_ -#define _CONSUMER_VALERIE_H_ - -#include - -extern mlt_consumer consumer_valerie_init( char * ); - -#endif diff --git a/src/modules/valerie/factory.c b/src/modules/valerie/factory.c index e93c41f3..affef35f 100644 --- a/src/modules/valerie/factory.c +++ b/src/modules/valerie/factory.c @@ -19,28 +19,29 @@ */ #include +#include -#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; } diff --git a/src/modules/vmfx/factory.c b/src/modules/vmfx/factory.c index 313408f4..7dac5766 100644 --- a/src/modules/vmfx/factory.c +++ b/src/modules/vmfx/factory.c @@ -19,39 +19,40 @@ */ #include +#include -#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; } diff --git a/src/modules/vmfx/filter_chroma.c b/src/modules/vmfx/filter_chroma.c index f857f005..7616856c 100644 --- a/src/modules/vmfx/filter_chroma.c +++ b/src/modules/vmfx/filter_chroma.c @@ -18,7 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_chroma.h" +#include #include #include #include @@ -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 index 7d878576..00000000 --- a/src/modules/vmfx/filter_chroma.h +++ /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 - * - * 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 - -extern mlt_filter filter_chroma_init( char *arg ); - -#endif diff --git a/src/modules/vmfx/filter_chroma_hold.c b/src/modules/vmfx/filter_chroma_hold.c index f3ede3f9..4fe52b21 100644 --- a/src/modules/vmfx/filter_chroma_hold.c +++ b/src/modules/vmfx/filter_chroma_hold.c @@ -18,7 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_chroma.h" +#include #include #include #include @@ -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 index 5f393607..00000000 --- a/src/modules/vmfx/filter_chroma_hold.h +++ /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 - * - * 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 - -extern mlt_filter filter_chroma_hold_init( char *arg ); - -#endif diff --git a/src/modules/vmfx/filter_mono.c b/src/modules/vmfx/filter_mono.c index 88467ce2..2afab5d3 100644 --- a/src/modules/vmfx/filter_mono.c +++ b/src/modules/vmfx/filter_mono.c @@ -18,7 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_mono.h" +#include #include #include #include @@ -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 index 35dbd7e8..00000000 --- a/src/modules/vmfx/filter_mono.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_shape.h -- Arbitrary alpha channel shaping - * Copyright (C) 2005 Visual Media Fx Inc. - * Author: Charles Yates - * - * 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 - -extern mlt_filter filter_mono_init( char *arg ); - -#endif diff --git a/src/modules/vmfx/filter_shape.c b/src/modules/vmfx/filter_shape.c index e900e050..fad32f4b 100644 --- a/src/modules/vmfx/filter_shape.c +++ b/src/modules/vmfx/filter_shape.c @@ -18,7 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_shape.h" +#include #include #include #include @@ -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 index 1cc347dc..00000000 --- a/src/modules/vmfx/filter_shape.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_shape.h -- Arbitrary alpha channel shaping - * Copyright (C) 2005 Visual Media Fx Inc. - * Author: Charles Yates - * - * 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 - -extern mlt_filter filter_shape_init( char *arg ); - -#endif diff --git a/src/modules/vmfx/producer_pgm.c b/src/modules/vmfx/producer_pgm.c index e9d333be..6713317c 100644 --- a/src/modules/vmfx/producer_pgm.c +++ b/src/modules/vmfx/producer_pgm.c @@ -18,7 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "producer_pgm.h" +#include #include #include #include @@ -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 index 29836c4e..00000000 --- a/src/modules/vmfx/producer_pgm.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_pgm.h -- PGM producer - * Copyright (C) 2005 Visual Media Fx Inc. - * Author: Charles Yates - * - * 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 - -extern mlt_producer producer_pgm_init( void * ); - -#endif diff --git a/src/modules/vorbis/factory.c b/src/modules/vorbis/factory.c index e3950492..080e1518 100644 --- a/src/modules/vorbis/factory.c +++ b/src/modules/vorbis/factory.c @@ -19,27 +19,28 @@ */ #include +#include -#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; } diff --git a/src/modules/vorbis/producer_vorbis.c b/src/modules/vorbis/producer_vorbis.c index 982808bc..60166524 100644 --- a/src/modules/vorbis/producer_vorbis.c +++ b/src/modules/vorbis/producer_vorbis.c @@ -18,10 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// Local header files -#include "producer_vorbis.h" - // MLT Header files +#include #include // 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 index d58c5c3f..00000000 --- a/src/modules/vorbis/producer_vorbis.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * producer_vorbis.h -- vorbis producer - * 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 _PRODUCER_VORBIS_H_ -#define _PRODUCER_VORBIS_H_ - -#include - -extern mlt_producer producer_vorbis_init( char *file ); - -#endif diff --git a/src/modules/westley/consumer_westley.c b/src/modules/westley/consumer_westley.c index 29e787cf..696bbffc 100644 --- a/src/modules/westley/consumer_westley.c +++ b/src/modules/westley/consumer_westley.c @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "consumer_westley.h" #include #include #include @@ -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 index 8e6e6a85..00000000 --- a/src/modules/westley/consumer_westley.h +++ /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 - * - * 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 - -extern mlt_consumer consumer_westley_init( char * ); - -#endif diff --git a/src/modules/westley/factory.c b/src/modules/westley/factory.c index aedda309..91ed5d14 100644 --- a/src/modules/westley/factory.c +++ b/src/modules/westley/factory.c @@ -19,33 +19,34 @@ */ #include +#include -#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; } diff --git a/src/modules/westley/producer_westley.c b/src/modules/westley/producer_westley.c index b4407616..52509a06 100644 --- a/src/modules/westley/producer_westley.c +++ b/src/modules/westley/producer_westley.c @@ -21,7 +21,6 @@ // TODO: destroy unreferenced producers (they are currently destroyed // when the returned producer is closed). -#include "producer_westley.h" #include #include #include @@ -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 index cf40e675..00000000 --- a/src/modules/westley/producer_westley.h +++ /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 - * - * 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 - -extern mlt_producer producer_westley_init( int type, char *data ); - -#endif diff --git a/src/modules/xine/factory.c b/src/modules/xine/factory.c index 5c19826a..bdcf50db 100644 --- a/src/modules/xine/factory.c +++ b/src/modules/xine/factory.c @@ -19,28 +19,28 @@ */ #include +#include -#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; } - diff --git a/src/modules/xine/filter_deinterlace.c b/src/modules/xine/filter_deinterlace.c index ef69b8af..01871cf3 100644 --- a/src/modules/xine/filter_deinterlace.c +++ b/src/modules/xine/filter_deinterlace.c @@ -18,7 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_deinterlace.h" +#include #include "deinterlace.h" #include @@ -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 index cfcd2fce..00000000 --- a/src/modules/xine/filter_deinterlace.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * filter_deinterlace.h -- deinterlace filter - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Charles Yates - * - * 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 - -extern mlt_filter filter_deinterlace_init( void *arg ); - -#endif diff --git a/src/valerie/valerie_remote.c b/src/valerie/valerie_remote.c index 04ad67aa..580b0bef 100644 --- a/src/valerie/valerie_remote.c +++ b/src/valerie/valerie_remote.c @@ -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 -- 2.39.2