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 ) );
// 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" );
// 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 );
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 );
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 )
// 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 ) );
+ }
}
}
/** 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;
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 );
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 )
}
else
{
- frame = mlt_frame_init( );
+ frame = mlt_frame_init( service );
}
if ( frame != NULL )
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
{
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.
#define _MLT_CONSUMER_H_
#include "mlt_service.h"
+#include "mlt_events.h"
#include <pthread.h>
/** The interface definition for all consumers.
pthread_cond_t put_cond;
mlt_frame put;
int put_active;
+ mlt_event event_listener;
};
/** Public final methods
#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 );
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
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" );
}
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;
// 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;
/** 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;
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;
}
/** 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;
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;
}
/** 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;
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;
}
free( mlt_prefix );
mlt_prefix = NULL;
mlt_pool_close( );
- mlt_profile_close();
}
}
#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( );
}
else
{
- *frame = mlt_frame_init( );
+ *frame = mlt_frame_init( service );
return 0;
}
}
/** 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 );
// 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 );
#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 );
#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 );
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
{
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 ) );
// Check that we have a producer
if ( producer == NULL )
{
- *frame = mlt_frame_init( );
- return 0;
+ *frame = NULL;
+ return -1;
}
// Get this mlt_playlist
// Check that we have a producer
if ( real == NULL )
{
- *frame = mlt_frame_init( );
+ *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
return 0;
}
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 );
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.
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 ) );
}
else
{
- *frame = mlt_frame_init( );
+ *frame = mlt_frame_init( service );
result = 0;
}
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 );
#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" ) )
// Finish loading
strcat( filename, name );
- mlt_profile_load_file( filename );
+ profile = mlt_profile_load_file( filename );
// Cleanup
mlt_properties_close( properties );
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
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" ) )
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
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
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 )
{
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
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" );
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 )
}
// 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 )
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 );
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;
#define _MLT_REPOSITORY_H_
#include "mlt_types.h"
+#include "mlt_profile.h"
/** Repository structure forward reference.
*/
*/
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
if ( producer != NULL )
return mlt_service_get_frame( producer, frame, index );
}
- *frame = mlt_frame_init( );
+ *frame = mlt_frame_init( this );
return 0;
}
// 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 );
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.
*/
#define _MLT_SERVICE_H_
#include "mlt_properties.h"
+#include "mlt_profile.h"
/** The interface definition for all services.
*/
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 );
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 );
else
{
// Generate a test card
- *frame = mlt_frame_init( );
+ *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( parent ) );
return 0;
}
}
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;
}
{
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( );
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 )
{
#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 );
FILE *store = NULL;
char *name = NULL;
struct sched_param scp;
+ mlt_profile profile = NULL;
// Use realtime scheduling if possible
memset( &scp, '\0', sizeof( scp ) );
// 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
{
}
}
- // 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 );
// 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 );
}
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
mlt_producer_close( inigo );
// Close the factory
+ mlt_profile_close( profile );
mlt_factory_close( );
return 0;
{
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 );
if ( arg != NULL )
*arg ++ = '\0';
- consumer = mlt_factory_consumer( id, arg );
+ consumer = mlt_factory_consumer( NULL, id, arg );
if ( consumer != NULL )
{
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.
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;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-// Local header files
-#include "consumer_avformat.h"
-
// mlt Header files
+#include <framework/mlt_consumer.h>
#include <framework/mlt_frame.h>
// System header files
/** 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 )
+++ /dev/null
-/*
- * consumer_avformat.h -- avformat consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _CONSUMER_AVFORMAT_H_
-#define _CONSUMER_AVFORMAT_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_avformat_init( char *file );
-
-#endif
#include <string.h>
#include <pthread.h>
-#include <framework/mlt_factory.h>
-#include "producer_avformat.h"
-#include "consumer_avformat.h"
-#include "filter_avcolour_space.h"
-#include "filter_avdeinterlace.h"
-#include "filter_avresample.h"
+#include <framework/mlt.h>
+
+extern mlt_consumer consumer_avformat_init( mlt_profile profile, char *file );
+extern mlt_filter filter_avcolour_space_init( void *arg );
+extern mlt_filter filter_avdeinterlace_init( void *arg );
+extern mlt_filter filter_avresample_init( char *arg );
+extern mlt_producer producer_avformat_init( mlt_profile profile, char *file );
// ffmpeg Header files
#include <avformat.h>
}
}
-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" ) )
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;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_avcolour_space.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
// ffmpeg Header files
+++ /dev/null
-/*
- * filter_avcolour_space.h -- colourspace filter
- * Copyright (C) 2004-2005 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_AVCOLOUR_SPACE_H
-#define _FILTER_AVCOLOUR_SPACE_H
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_avcolour_space_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_avdeinterlace.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <string.h>
+++ /dev/null
-/*
- * filter_avdeinterlace.h -- deinterlace filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_AVDEINTERLACE_H_
-#define _FILTER_AVDEINTERLACE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_avdeinterlace_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_avresample.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
+++ /dev/null
-/*
- * filter_avresample.h -- adjust audio sample frequency
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_AVRESAMPLE_H_
-#define _FILTER_AVRESAMPLE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_avresample_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-// Local header files
-#include "producer_avformat.h"
-
// MLT Header files
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
// ffmpeg Header files
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;
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 );
/** 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;
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( );
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 ) );
+++ /dev/null
-/*
- * producer_avformat.h -- avformat producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_AVFORMAT_H_
-#define _PRODUCER_AVFORMAT_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_avformat_init( char *file );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-// Local header files
-#include "consumer_null.h"
-
// mlt Header files
+#include <framework/mlt_consumer.h>
#include <framework/mlt_frame.h>
// System header files
/** 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 )
+++ /dev/null
-/*
- * consumer_null.h -- null consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _CONSUMER_NULL_H_
-#define _CONSUMER_NULL_H
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_null_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <framework/mlt.h>
#include <string.h>
-#include "producer_colour.h"
-#include "producer_noise.h"
-#include "producer_ppm.h"
-#include "filter_brightness.h"
-#include "filter_channelcopy.h"
-#include "filter_data.h"
-#include "filter_gamma.h"
-#include "filter_greyscale.h"
-#include "filter_luma.h"
-#include "filter_mirror.h"
-#include "filter_mono.h"
-#include "filter_obscure.h"
-#include "filter_rescale.h"
-#include "filter_resize.h"
-#include "filter_region.h"
-#include "filter_transition.h"
-#include "filter_watermark.h"
+extern mlt_consumer consumer_null_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_brightness_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_channelcopy_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_data_feed_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_data_show_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_gamma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_greyscale_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_mirror_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_obscure_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_region_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_rescale_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_resize_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_transition_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_watermark_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_colour_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_noise_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_ppm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
#include "transition_composite.h"
-#include "transition_luma.h"
-#include "transition_mix.h"
+extern mlt_transition transition_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_transition transition_mix_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
#include "transition_region.h"
-#include "consumer_null.h"
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
{
if ( !strcmp( id, "color" ) )
- return producer_colour_init( arg );
+ return producer_colour_init( profile, type, id, arg );
if ( !strcmp( id, "colour" ) )
- return producer_colour_init( arg );
+ return producer_colour_init( profile, type, id, arg );
if ( !strcmp( id, "noise" ) )
- return producer_noise_init( arg );
+ return producer_noise_init( profile, type, id, arg );
if ( !strcmp( id, "ppm" ) )
- return producer_ppm_init( arg );
+ return producer_ppm_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
{
if ( !strcmp( id, "brightness" ) )
- return filter_brightness_init( arg );
+ return filter_brightness_init( profile, type, id, arg );
if ( !strcmp( id, "channelcopy" ) )
- return filter_channelcopy_init( arg );
+ return filter_channelcopy_init( profile, type, id, arg );
if ( !strcmp( id, "data_feed" ) )
- return filter_data_feed_init( arg );
+ return filter_data_feed_init( profile, type, id, arg );
if ( !strcmp( id, "data_show" ) )
- return filter_data_show_init( arg );
+ return filter_data_show_init( profile, type, id, arg );
if ( !strcmp( id, "gamma" ) )
- return filter_gamma_init( arg );
+ return filter_gamma_init( profile, type, id, arg );
if ( !strcmp( id, "greyscale" ) )
- return filter_greyscale_init( arg );
+ return filter_greyscale_init( profile, type, id, arg );
if ( !strcmp( id, "luma" ) )
- return filter_luma_init( arg );
+ return filter_luma_init( profile, type, id, arg );
if ( !strcmp( id, "mirror" ) )
- return filter_mirror_init( arg );
+ return filter_mirror_init( profile, type, id, arg );
if ( !strcmp( id, "mono" ) )
- return filter_mono_init( arg );
+ return filter_mono_init( profile, type, id, arg );
if ( !strcmp( id, "obscure" ) )
- return filter_obscure_init( arg );
+ return filter_obscure_init( profile, type, id, arg );
if ( !strcmp( id, "region" ) )
- return filter_region_init( arg );
+ return filter_region_init( profile, type, id, arg );
if ( !strcmp( id, "rescale" ) )
- return filter_rescale_init( arg );
+ return filter_rescale_init( profile, type, id, arg );
if ( !strcmp( id, "resize" ) )
- return filter_resize_init( arg );
- else if ( !strcmp( id, "transition" ) )
- return filter_transition_init( arg );
+ return filter_resize_init( profile, type, id, arg );
+ if ( !strcmp( id, "transition" ) )
+ return filter_transition_init( profile, type, id, arg );
if ( !strcmp( id, "watermark" ) )
- return filter_watermark_init( arg );
+ return filter_watermark_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
{
if ( !strcmp( id, "composite" ) )
- return transition_composite_init( arg );
+ return transition_composite_init( profile, type, id, arg );
if ( !strcmp( id, "luma" ) )
- return transition_luma_init( arg );
+ return transition_luma_init( profile, type, id, arg );
if ( !strcmp( id, "mix" ) )
- return transition_mix_init( arg );
+ return transition_mix_init( profile, type, id, arg );
if ( !strcmp( id, "region" ) )
- return transition_region_init( arg );
+ return transition_region_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
{
if ( !strcmp( id, "null" ) )
- return consumer_null_init( arg );
+ return consumer_null_init( profile, type, id, arg );
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_brightness.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_brightness.h -- gamma filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_BRIGHTNESS_H_
-#define _FILTER_BRIGHTNESS_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_brightness_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_channelcopy.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_channelcopy.h -- copy audio channel from one to another
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_CHANNELCOPY_H_
-#define _FILTER_CHANNELCOPY_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_channelcopy_init( char *arg );
-
-#endif
+++ /dev/null
-/*
- * filter_data.h -- data feed and show filters
- * Copyright (C) 2004-2005 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _MLT_FILTER_DATA_H_
-#define _MLT_FILTER_DATA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_data_feed_init( char * );
-extern mlt_filter filter_data_show_init( char * );
-
-#endif
-
#include <stdlib.h>
#include <string.h>
-#include "filter_data.h"
#include <framework/mlt.h>
/** This filter should be used in conjuction with the data_show filter.
/** 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( );
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_data.h"
#include <framework/mlt.h>
#include <stdlib.h>
#include <string.h>
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 )
/** 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( );
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_gamma.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_gamma.h -- gamma filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_GAMMA_H_
-#define _FILTER_GAMMA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_gamma_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_greyscale.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_greyscale.h -- greyscale filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_GREYSCALE_H_
-#define _FILTER_GREYSCALE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_greyscale_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_luma.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_factory.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_producer.h>
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 );
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 );
}
/** 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 )
+++ /dev/null
-/*
- * filter_luma.h -- luma filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_LUMA_H_
-#define _FILTER_LUMA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_luma_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_mirror.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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( );
+++ /dev/null
-/*
- * filter_mirror.h -- mirror filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_MIRROR_H_
-#define _FILTER_MIRROR_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_mirror_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_mono.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_mono.h -- mix all channels to a mono signal across n channels
- * Copyright (C) 2003-2006 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_MONO_H_
-#define _FILTER_MONO_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_mono_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_obscure.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_obscure.h -- obscure filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_OBSCURE_H_
-#define _FILTER_OBSCURE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_obscure_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_region.h"
#include "transition_region.h"
+#include <framework/mlt_filter.h>
#include <framework/mlt.h>
#include <stdio.h>
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 );
/** 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( );
+++ /dev/null
-/*
- * filter_region.h -- region filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_REGION_H_
-#define _FILTER_REGION_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_region_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_rescale.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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( );
+++ /dev/null
-/*
- * filter_rescale.h -- scale the producer video frame size to match the consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_RESCALE_H_
-#define _FILTER_RESCALE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_rescale_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_resize.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_resize.h -- resizing filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_RESIZE_H_
-#define _FILTER_RESIZE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_resize_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_transition.h"
+#include <framework/mlt_filter.h>
#include <framework/mlt_factory.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_transition.h>
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 );
}
/** 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 )
+++ /dev/null
-/*
- * filter_transition.h -- Convert any transition into a filter
- * Copyright (C) 2005 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_TRANSITION_H_
-#define _FILTER_TRANSITION_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_transition_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_watermark.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_factory.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_producer.h>
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 )
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 )
/** 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 )
+++ /dev/null
-/*
- * filter_watermark.h -- watermark filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_WATERMARK_H_
-#define _FILTER_WATERMARK_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_watermark_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_colour.h"
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_pool.h>
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 )
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 )
{
+++ /dev/null
-/*
- * producer_colour.h -- raster image loader based upon gdk-pixbuf
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_COLOUR_H_
-#define _PRODUCER_COLOUR_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_colour_init( char *filename );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_noise.h"
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_pool.h>
/** 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( );
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 )
+++ /dev/null
-/*
- * producer_noise.h -- noise generating producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_NOISE_H_
-#define _PRODUCER_NOISE_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_noise_init( void *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_ppm.h"
-
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <stdlib.h>
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 )
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 ) );
+++ /dev/null
-/*
- * producer_ppm.h -- simple ppm test case
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_PPM_H_
-#define _PRODUCER_PPM_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_ppm_init( void *command );
-
-#endif
}
}
-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" );
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 )
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 );
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;
/** 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 )
#include <framework/mlt_transition.h>
-extern mlt_transition transition_composite_init( char *arg );
+extern mlt_transition transition_composite_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
// Courtesy functionality - allows regionalised filtering
extern mlt_frame composite_copy_region( mlt_transition, mlt_frame, mlt_position );
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "transition_luma.h"
#include <framework/mlt.h>
#include <stdio.h>
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 )
/** 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 )
+++ /dev/null
-/*
- * transition_luma.h -- a generic dissolve/wipe processor
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _TRANSITION_LUMA_H_
-#define _TRANSITION_LUMA_H_
-
-#include <framework/mlt_transition.h>
-
-extern mlt_transition transition_luma_init( char *lumafile );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "transition_mix.h"
+#include <framework/mlt_transition.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * transition_mix.h -- mix two audio streams
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _TRANSITION_MIX_H_
-#define _TRANSITION_MIX_H_
-
-#include <framework/mlt_transition.h>
-
-extern mlt_transition transition_mix_init( char *arg );
-
-#endif
*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 )
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 )
mlt_properties_set( properties, "producer.resource", "<svg width='100' height='100'><circle cx='50' cy='50' r='50' fill='black'/></svg>" );
}
- // Create the producer
- producer = mlt_factory_producer( factory, resource );
+ // Create the producer
+ mlt_profile profile = mlt_service_profile( MLT_TRANSITION_SERVICE( this ) );
+ producer = mlt_factory_producer( profile, factory, resource );
// If we have one
if ( producer != NULL )
/** 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( );
#include <framework/mlt_transition.h>
-extern mlt_transition transition_region_init( void *arg );
+extern mlt_transition transition_region_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-// Local header files
-#include "consumer_libdv.h"
-#include "producer_libdv.h"
-
// mlt Header files
+#include <framework/mlt_consumer.h>
#include <framework/mlt_frame.h>
// System header files
// libdv header files
#include <libdv/dv.h>
+#define FRAME_SIZE_525_60 10 * 150 * 80
+#define FRAME_SIZE_625_50 12 * 150 * 80
+
// Forward references.
static int consumer_start( mlt_consumer this );
static int consumer_stop( mlt_consumer this );
/** 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 );
+++ /dev/null
-/*
- * producer_libdv.h -- a DV encoder based on libdv
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _CONSUMER_LIBDV_H_
-#define _CONSUMER_LIBDV_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_libdv_init( char *filename );
-
-#endif
#include <string.h>
-#include "producer_libdv.h"
-#include "consumer_libdv.h"
+#include <framework/mlt_consumer.h>
+#include <framework/mlt_producer.h>
-void *mlt_create_producer( char *id, void *arg )
+extern mlt_consumer consumer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+
+
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "libdv" ) )
- return producer_libdv_init( arg );
+ return producer_libdv_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "libdv" ) )
- return consumer_libdv_init( arg );
+ return consumer_libdv_init( profile, type, id, arg );
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_libdv.h"
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_deque.h>
#include <framework/mlt_factory.h>
#include <sys/stat.h>
#include <fcntl.h>
+#define FRAME_SIZE_525_60 10 * 150 * 80
+#define FRAME_SIZE_625_50 12 * 150 * 80
+
/** To conserve resources, we maintain a stack of dv decoders.
*/
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 );
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 )
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 &&
+++ /dev/null
-/*
- * producer_libdv.h -- a DV decoder based on libdv
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_LIBDV_H_
-#define _PRODUCER_LIBDV_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_libdv_init( char *filename );
-
-#define FRAME_SIZE_525_60 10 * 150 * 80
-#define FRAME_SIZE_625_50 12 * 150 * 80
-
-#endif
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <framework/mlt.h>
#include <string.h>
-#include "filter_burn.h"
+extern mlt_filter filter_burn_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "BurningTV" ) )
- return filter_burn_init( arg );
+ return filter_burn_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_burn.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_brun.h -- burning filter
- * Copyright (C) 2007 Stephane Fillod
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_BURN_H_
-#define _FILTER_BURN_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_burn_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <framework/mlt.h>
#include <string.h>
-#include "producer_fezzik.h"
-#include "producer_hold.h"
+extern mlt_producer producer_fezzik_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "fezzik" ) )
- return producer_fezzik_init( arg );
+ return producer_fezzik_init( profile, type, id, arg );
if ( !strcmp( id, "hold" ) )
- return producer_hold_init( arg );
+ return producer_hold_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_fezzik.h"
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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 );
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 );
return producer;
}
-static mlt_producer create_producer( char *file )
+static mlt_producer create_producer( mlt_profile profile, char *file )
{
mlt_producer result = NULL;
char *service = temp;
char *resource = strchr( temp, ':' );
*resource ++ = '\0';
- result = mlt_factory_producer( service, resource );
+ result = mlt_factory_producer( profile, service, resource );
free( temp );
}
{
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 );
// 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 );
free( id );
}
-static void attach_normalisers( mlt_producer producer )
+static void attach_normalisers( mlt_profile profile, mlt_producer producer )
{
// Loop variable
int i;
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 )
+++ /dev/null
-/*
- * producer_fezzik.h -- a normalising producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_FEZZIK_H_
-#define _PRODUCER_FEZZIK_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_fezzik_init( char *args );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_hold.h"
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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 )
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 )
+++ /dev/null
-/*
- * producer_hold.h -- a frame holding producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_HOLD_H_
-#define _PRODUCER_HOLD_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_hold_init( char *args );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "consumer_gtk2.h"
-
#include <stdlib.h>
#include <framework/mlt_consumer.h>
#include <framework/mlt_factory.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
-mlt_consumer consumer_gtk2_preview_init( GtkWidget *widget )
+mlt_consumer consumer_gtk2_preview_init( mlt_profile profile, GtkWidget *widget )
{
// Create an sdl preview consumer
mlt_consumer consumer = NULL;
}
// 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 )
+++ /dev/null
-/*
- * consumer_gtk2.h -- A consumer for GTK2 apps
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _CONSUMER_GTK2_PREVIEW_H
-#define _CONSUMER_GTK2_PREVIEW_H
-
-#include <framework/mlt_consumer.h>
-#include <gtk/gtk.h>
-
-extern mlt_consumer consumer_gtk2_preview_init( GtkWidget *widget );
-
-#endif
#include "config.h"
#include <string.h>
+#include <framework/mlt.h>
+#include <gdk/gdk.h>
#ifdef USE_PIXBUF
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include "producer_pixbuf.h"
-#include "filter_rescale.h"
+extern mlt_producer producer_pixbuf_init( char *filename );
+extern mlt_filter filter_rescale_init( mlt_profile profile, char *arg );
#endif
#ifdef USE_GTK2
-#include "consumer_gtk2.h"
+extern mlt_consumer consumer_gtk2_preview_init( mlt_profile profile, void *widget );
#endif
#ifdef USE_PANGO
-#include "producer_pango.h"
+extern mlt_producer producer_pango_init( const char *filename );
#endif
static void initialise( )
}
}
-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( );
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;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_rescale.h"
#include "pixops.h"
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_factory.h>
/** 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 )
+++ /dev/null
-/*
- * filter_rescale.h -- scale the producer video frame size to match the consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_RESCALE_H_
-#define _FILTER_RESCALE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_rescale_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_pango.h"
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_geometry.h>
#include <stdlib.h>
#include <pthread.h>
#include <ctype.h>
+typedef struct producer_pango_s *producer_pango;
+
+typedef enum
+{
+ pango_align_left = 0,
+ pango_align_center,
+ pango_align_right
+} pango_align;
+
static pthread_mutex_t pango_mutex = PTHREAD_MUTEX_INITIALIZER;
struct producer_pango_s
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 );
+++ /dev/null
-/*
- * producer_pango.h -- a pango-based titler
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_PANGO_H_
-#define _PRODUCER_PANGO_H_
-
-#include <framework/mlt_producer.h>
-
-typedef struct producer_pango_s *producer_pango;
-
-typedef enum
-{
- pango_align_left = 0,
- pango_align_center,
- pango_align_right
-} pango_align;
-
-extern mlt_producer producer_pango_init( const char *filename );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_pixbuf.h"
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
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 );
}
// Generate a frame
- *frame = mlt_frame_init( );
+ *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
if ( *frame != NULL && this->count > 0 )
{
+++ /dev/null
-/*
- * producer_pixbuf.h -- raster image loader based upon gdk-pixbuf
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef _PRODUCER_PIXBUF_H_
-#define _PRODUCER_PIXBUF_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_pixbuf_init( char *filename );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "producer_inigo.h"
+extern mlt_producer producer_inigo_file_init( mlt_profile profile, char *file );
+extern mlt_producer producer_inigo_init( mlt_profile profile, char **argv );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
{
if ( !strcmp( id, "inigo_file" ) )
- return producer_inigo_file_init( arg );
+ return producer_inigo_file_init( profile, arg );
if ( !strcmp( id, "inigo" ) )
- return producer_inigo_init( arg );
+ return producer_inigo_init( profile, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_inigo.h"
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <framework/mlt.h>
-mlt_producer producer_inigo_file_init( char *file )
+mlt_producer producer_inigo_init( mlt_profile profile, char **argv );
+
+mlt_producer producer_inigo_file_init( mlt_profile profile, char *file )
{
FILE *input = fopen( file, "r" );
char **args = calloc( sizeof( char * ), 1000 );
}
}
- mlt_producer result = producer_inigo_init( args );
+ mlt_producer result = producer_inigo_init( profile, args );
if ( result != NULL )
{
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 );
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 );
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 );
return transition;
}
-mlt_producer producer_inigo_init( char **argv )
+mlt_producer producer_inigo_init( mlt_profile profile, char **argv )
{
int i;
int track = 0;
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;
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 );
}
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 );
}
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 );
mlt_playlist_append( playlist, producer );
if ( title == NULL && strstr( argv[ i ], "<?xml" ) != argv[ i ] )
title = argv[ i ];
- producer = create_producer( field, argv[ i ] );
+ producer = create_producer( profile, field, argv[ i ] );
if ( producer != NULL )
{
properties = MLT_PRODUCER_PROPERTIES( producer );
i += 2;
else if ( !strcmp( argv[ i ], "-consumer" ) )
i += 2;
+ else if ( !strcmp( argv[ i ], "-profile" ) )
+ i += 2;
while ( argv[ i ] != NULL && strchr( argv[ i ], '=' ) )
i ++;
+++ /dev/null
-/*
- * producer_inigo.h -- simple inigo test case
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_INIGO_H_
-#define _PRODUCER_INIGO_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_inigo_file_init( char *args );
-extern mlt_producer producer_inigo_init( char **args );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_jackrack.h"
-#include "filter_ladspa.h"
+extern mlt_filter filter_jackrack_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_ladspa_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "jackrack" ) )
- return filter_jackrack_init( arg );
+ return filter_jackrack_init( profile, type, id, arg );
else if ( !strcmp( id, "ladspa" ) )
- return filter_ladspa_init( arg );
+ return filter_ladspa_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_jackrack.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_jackrack.h -- filter audio through Jack and/or LADSPA plugins
- * Copyright (C) 2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_JACKRACK_H_
-#define _FILTER_JACKRACK_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_jackrack_init( char *arg );
-
-#endif
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_ladspa.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_ladspa.h -- filter audio through LADSPA plugins
- * Copyright (C) 2004-2005 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_LADSPA_H_
-#define _FILTER_LADSPA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_ladspa_init( char *arg );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "producer_framebuffer.h"
-#include "filter_boxblur.h"
-#include "filter_wave.h"
+extern mlt_filter filter_boxblur_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_wave_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_framebuffer_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "framebuffer" ) )
- return producer_framebuffer_init( arg );
+ return producer_framebuffer_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "boxblur" ) )
- return filter_boxblur_init( arg );
+ return filter_boxblur_init( profile, type, id, arg );
if ( !strcmp( id, "wave" ) )
- return filter_wave_init( arg );
+ return filter_wave_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
/*
* filter_boxblur.c -- blur filter
- * Author: Leny Grisel <leny.grisel@laposte.net>
+ * Copyright (C) ?-2007 Leny Grisel <leny.grisel@laposte.net>
+ * Copyright (C) 2007 Jean-Baptiste Mardelle <jb@ader.ch>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_boxblur.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_boxblur.h -- box blur filter
- * Author: Leny Grisel <leny.grisel@laposte.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_BOXBLUR_H_
-#define _FILTER_BOXBLUR_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_boxblur_init( char *arg );
-
-#endif
/*
* wave.c -- wave filter
- * Author: Leny Grisel <leny.grisel@laposte.net>
+ * Copyright (C) ?-2007 Leny Grisel <leny.grisel@laposte.net>
+ * Copyright (C) 2007 Jean-Baptiste Mardelle <jb@ader.ch>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_wave.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_wave.h -- wave filter
- * Author: Leny Grisel <leny.grisel@laposte.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_WAVE_H_
-#define _FILTER_WAVE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_wave_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_framebuffer.h"
#include <framework/mlt.h>
#include <stdio.h>
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 )
{
}
-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;
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, ":" );
+++ /dev/null
-/*
- * producer_framebuffer.h -- slowmotion and reverse playing
- * Copyright (C) 2007 Jean-Baptiste Mardelle <jb@ader.ch>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_FRAMEBUFFER_H_
-#define _PRODUCER_FRAMEBUFFER_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_framebuffer_init( char *arg );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "producer_kino.h"
+extern mlt_producer producer_kino_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "kino" ) )
- return producer_kino_init( arg );
+ return producer_kino_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
*/
#include <stdlib.h>
-#include "producer_kino.h"
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_deque.h>
#include <framework/mlt_factory.h>
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( );
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 ) )
+++ /dev/null
-/*
- * producer_kino.h -- a DV file format parser
- * Copyright (C) 2005 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _PRODUCER_KINO_H_
-#define _PRODUCER_KINO_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_kino_init( char *filename );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_motion_est.h"
+extern mlt_filter filter_motion_est_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_vismv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_crop_detect_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_autotrack_rectangle_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_slowmotion_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-extern mlt_filter filter_motion_est_init(char *);
-extern mlt_filter filter_vismv_init(char *);
-extern mlt_filter filter_crop_detect_init(char *);
-extern mlt_filter filter_autotrack_rectangle_init(char *);
-extern mlt_producer producer_slowmotion_init(char *);
-
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "motion_est" ) )
- return filter_motion_est_init( arg );
+ return filter_motion_est_init( profile, type, id, arg );
if ( !strcmp( id, "vismv" ) )
- return filter_vismv_init( arg );
+ return filter_vismv_init( profile, type, id, arg );
if ( !strcmp( id, "crop_detect" ) )
- return filter_crop_detect_init( arg );
+ return filter_crop_detect_init( profile, type, id, arg );
if ( !strcmp( id, "autotrack_rectangle" ) )
- return filter_autotrack_rectangle_init( arg );
+ return filter_autotrack_rectangle_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "slowmotion" ) )
- return producer_slowmotion_init( arg );
+ return producer_slowmotion_init( profile, type, id, arg );
return NULL;
}
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 );
}
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 );
}
*/
-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 )
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 {
/** 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 )
/** 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 )
#include <framework/mlt_filter.h>
-extern mlt_filter filter_motion_est_init( char *arg );
+extern mlt_filter filter_motion_est_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
#define MAX_MSAD 0xffff
*/
-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 )
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 );
}
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);
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)
{
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_volume.h"
+extern mlt_filter filter_volume_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "volume" ) )
- return filter_volume_init( arg );
+ return filter_volume_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_volume.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_volume.h -- adjust audio volume
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_VOLUME_H_
-#define _FILTER_VOLUME_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_volume_init( char *arg );
-
-#endif
/*
* factory.c -- the factory method interfaces
- * Copyright (C) 2007 Jean-Baptiste Mardelle
+ * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_oldfilm.h"
-#include "filter_grain.h"
-#include "filter_dust.h"
-#include "filter_lines.h"
+extern mlt_filter filter_dust_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_grain_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_lines_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_oldfilm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "oldfilm" ) )
- return filter_oldfilm_init( arg );
- if ( !strcmp( id, "dust" ) )
- return filter_dust_init( arg );
- if ( !strcmp( id, "lines" ) )
- return filter_lines_init( arg );
- if ( !strcmp( id, "grain" ) )
- return filter_grain_init( arg );
+ return filter_oldfilm_init( profile, type, id, arg );
+ if ( !strcmp( id, "dust" ) )
+ return filter_dust_init( profile, type, id, arg );
+ if ( !strcmp( id, "lines" ) )
+ return filter_lines_init( profile, type, id, arg );
+ if ( !strcmp( id, "grain" ) )
+ return filter_grain_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_dust.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
}
-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 )
+++ /dev/null
-/*
- * filter_dust.h -- dust filter
- * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_DUST_H_
-#define _FILTER_DUST_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_dust_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_grain.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
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 )
+++ /dev/null
-/*
- * filter_grain.h -- grain filter
- * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_GRAIN_H_
-#define _FILTER_GRAIN_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_grain_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_lines.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
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 )
+++ /dev/null
-/*
- * filter_lines.h -- lines filter
- * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_LINES_H_
-#define _FILTER_LINES_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_lines_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_oldfilm.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
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 )
+++ /dev/null
-/*
- * filter_oldfilm.h -- oldfilm filter
- * Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_OLDFILM_H_
-#define _FILTER_OLDFILM_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_oldfilm_init( char *arg );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_affine.h"
-#include "filter_charcoal.h"
-#include "filter_invert.h"
-#include "filter_sepia.h"
-#include "transition_affine.h"
+extern mlt_filter filter_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_charcoal_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_invert_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_sepia_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_transition transition_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "affine" ) )
- return filter_affine_init( arg );
+ return filter_affine_init( profile, type, id, arg );
if ( !strcmp( id, "charcoal" ) )
- return filter_charcoal_init( arg );
+ return filter_charcoal_init( profile, type, id, arg );
if ( !strcmp( id, "invert" ) )
- return filter_invert_init( arg );
+ return filter_invert_init( profile, type, id, arg );
if ( !strcmp( id, "sepia" ) )
- return filter_sepia_init( arg );
+ return filter_sepia_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "affine" ) )
- return transition_affine_init( arg );
+ return transition_affine_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_affine.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt.h>
#include <stdio.h>
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 );
}
/** 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 )
+++ /dev/null
-/*
- * filter_affine.h -- affine filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_AFFINEH_
-#define _FILTER_AFFINEH_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_affine_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_charcoal.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_charcoal.h -- charcoal filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_CHARCOAL_H_
-#define _FILTER_CHARCOAL_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_charcoal_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_invert.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_invert.h -- invert filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_INVERT_H_
-#define _FILTER_INVERT_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_invert_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_sepia.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_sepia.h -- sepia filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_SEPIA_H_
-#define _FILTER_SEPIA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_sepia_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "transition_affine.h"
+#include <framework/mlt_transition.h>
#include <framework/mlt.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * transition_affine.h -- compose one image over another using affine transforms
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _TRANSITION_AFFINE_H_
-#define _TRANSITION_AFFINE_H_
-
-#include <framework/mlt_transition.h>
-
-extern mlt_transition transition_affine_init( char *arg );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "producer_qimage.h"
+extern mlt_producer producer_qimage_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "qimage" ) )
- return producer_qimage_init( arg );
+ return producer_qimage_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "producer_qimage.h"
+#include <framework/mlt_producer.h>
#include "qimage_wrapper.h"
#include <stdio.h>
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 )
}
// Generate a frame
- *frame = mlt_frame_init( );
+ *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
if ( *frame != NULL && this->count > 0 )
{
+++ /dev/null
-/*
- * producer_qimage.h -- a QT/QImage based producer for MLT
- * Copyright (C) 2006 Visual Media
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _PRODUCER_QIMAGE_H_
-#define _PRODUCER_QIMAGE_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_qimage_init( char *filename );
-
-#endif
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 );
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_resample.h"
+extern mlt_filter filter_resample_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "resample" ) )
- return filter_resample_init( arg );
+ return filter_resample_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_resample.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <stdio.h>
/** 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 )
+++ /dev/null
-/*
- * filter_resample.h -- adjust audio sample frequency
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_RESAMPLE_H_
-#define _FILTER_RESAMPLE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_resample_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "consumer_sdl.h"
+#include <framework/mlt_consumer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_deque.h>
#include <framework/mlt_factory.h>
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( );
// 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 );
+++ /dev/null
-/*
- * consumer_sdl.h -- A Simple DirectMedia Layer consumer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _CONSUMER_SDL_H_
-#define _CONSUMER_SDL_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_sdl_init( char * );
-extern mlt_consumer consumer_sdl_still_init( char * );
-extern mlt_consumer consumer_sdl_preview_init( char * );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "consumer_sdl.h"
+#include <framework/mlt_consumer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_factory.h>
#include <framework/mlt_producer.h>
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;
}
// 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;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "consumer_sdl.h"
+#include <framework/mlt_consumer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_deque.h>
#include <framework/mlt_factory.h>
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;
// 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 );
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "consumer_sdl.h"
+extern mlt_consumer consumer_sdl_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_consumer consumer_sdl_still_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_consumer consumer_sdl_preview_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
#ifdef WITH_SDL_IMAGE
-#include "producer_sdl_image.h"
+extern mlt_producer producer_sdl_image_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
#endif
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
#ifdef WITH_SDL_IMAGE
if ( !strcmp( id, "sdl_image" ) )
- return producer_sdl_image_init( arg );
+ return producer_sdl_image_init( profile, type, id, arg );
#endif
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "sdl" ) )
- return consumer_sdl_init( arg );
+ return consumer_sdl_init( profile, type, id, arg );
if ( !strcmp( id, "sdl_still" ) )
- return consumer_sdl_still_init( arg );
+ return consumer_sdl_still_init( profile, type, id, arg );
if ( !strcmp( id, "sdl_preview" ) )
- return consumer_sdl_preview_init( arg );
+ return consumer_sdl_preview_init( profile, type, id, arg );
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "producer_sdl_image.h"
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_pool.h>
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 )
{
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 )
+++ /dev/null
-/*
- * producer_sdl_image.h -- Image loader which wraps SDL_image
- * Copyright (C) 2005 Visual Media FX
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PRODUCER_SDL_IMAGE_H_
-#define PRODUCER_SDL_IMAGE_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_sdl_image_init( char *filename );
-
-#endif
# 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
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_sox.h"
+extern mlt_filter filter_sox_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "sox" ) )
- return filter_sox_init( arg );
+ return filter_sox_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "filter_sox.h"
-
+#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_tokeniser.h>
/** 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 )
+++ /dev/null
-/*
- * filter_sox.h -- apply any number of SOX effects using libst
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _FILTER_SOX_H_
-#define _FILTER_SOX_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_sox_init( char *arg );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "consumer_valerie.h"
#include <valerie/valerie.h>
#include <valerie/valerie_remote.h>
#include <framework/mlt.h>
/** 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, ':' ) )
{
+++ /dev/null
-/*
- * consumer_valerie.h -- pushes a service via valerie
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@telenet.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _CONSUMER_VALERIE_H_
-#define _CONSUMER_VALERIE_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_valerie_init( char * );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "consumer_valerie.h"
+extern mlt_consumer consumer_valerie_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "valerie" ) )
- return consumer_valerie_init( arg );
+ return consumer_valerie_init( profile, type, id, arg );
return NULL;
}
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_chroma.h"
-#include "filter_chroma_hold.h"
-#include "filter_mono.h"
-#include "filter_shape.h"
-#include "producer_pgm.h"
+extern mlt_filter filter_chroma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_chroma_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_filter filter_shape_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_pgm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "pgm" ) )
- return producer_pgm_init( arg );
+ return producer_pgm_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "chroma" ) )
- return filter_chroma_init( arg );
+ return filter_chroma_init( profile, type, id, arg );
if ( !strcmp( id, "chroma_hold" ) )
- return filter_chroma_hold_init( arg );
+ return filter_chroma_hold_init( profile, type, id, arg );
if ( !strcmp( id, "threshold" ) )
- return filter_mono_init( arg );
+ return filter_mono_init( profile, type, id, arg );
if ( !strcmp( id, "shape" ) )
- return filter_shape_init( arg );
+ return filter_shape_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_chroma.h"
+#include <framework/mlt_filter.h>
#include <stdlib.h>
#include <math.h>
#include <framework/mlt_factory.h>
/** 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 )
+++ /dev/null
-/*
- * filter_chroma.h -- Maps a chroma key to the alpha channel
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_CHROMA_H_
-#define _FILTER_CHROMA_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_chroma_init( char *arg );
-
-#endif
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_chroma.h"
+#include <framework/mlt_filter.h>
#include <stdlib.h>
#include <framework/mlt_factory.h>
#include <framework/mlt_frame.h>
/** 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 )
+++ /dev/null
-/*
- * filter_chroma.h -- Maps a chroma key to the alpha channel
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_CHROMA_HOLD_H_
-#define _FILTER_CHROMA_HOLD_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_chroma_hold_init( char *arg );
-
-#endif
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_mono.h"
+#include <framework/mlt_filter.h>
#include <string.h>
#include <framework/mlt_factory.h>
#include <framework/mlt_frame.h>
/** 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 )
+++ /dev/null
-/*
- * filter_shape.h -- Arbitrary alpha channel shaping
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_MONO_H_
-#define _FILTER_MONO_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_mono_init( char *arg );
-
-#endif
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_shape.h"
+#include <framework/mlt.h>
#include <string.h>
#include <framework/mlt_factory.h>
#include <framework/mlt_frame.h>
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 );
/** 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 )
+++ /dev/null
-/*
- * filter_shape.h -- Arbitrary alpha channel shaping
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_SHAPE_H_
-#define _FILTER_SHAPE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_shape_init( char *arg );
-
-#endif
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "producer_pgm.h"
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
#include <stdlib.h>
#include <string.h>
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;
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 );
+++ /dev/null
-/*
- * producer_pgm.h -- PGM producer
- * Copyright (C) 2005 Visual Media Fx Inc.
- * Author: Charles Yates <charles.yates@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef PRODUCER_PGM_H_
-#define PRODUCER_PGM_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_pgm_init( void * );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "producer_vorbis.h"
+extern mlt_producer producer_vorbis_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "vorbis" ) )
- return producer_vorbis_init( arg );
+ return producer_vorbis_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-// Local header files
-#include "producer_vorbis.h"
-
// MLT Header files
+#include <framework/mlt_producer.h>
#include <framework/mlt_frame.h>
// vorbis Header files
/** 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;
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 ) );
+++ /dev/null
-/*
- * producer_vorbis.h -- vorbis producer
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_VORBIS_H_
-#define _PRODUCER_VORBIS_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_vorbis_init( char *file );
-
-#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "consumer_westley.h"
#include <framework/mlt.h>
#include <stdio.h>
#include <stdlib.h>
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;
+++ /dev/null
-/*
- * consumer_westley.h -- a libxml2 serialiser of mlt service networks
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _CONSUMER_WESTLEY_H_
-#define _CONSUMER_WESTLEY_H_
-
-#include <framework/mlt_consumer.h>
-
-extern mlt_consumer consumer_westley_init( char * );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "consumer_westley.h"
-#include "producer_westley.h"
+extern mlt_consumer consumer_westley_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_westley_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "westley" ) )
- return producer_westley_init( 0, arg );
+ return producer_westley_init( profile, type, id, arg );
if ( !strcmp( id, "westley-xml" ) )
- return producer_westley_init( 1, arg );
+ return producer_westley_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "westley" ) )
- return consumer_westley_init( arg );
+ return consumer_westley_init( profile, type, id, arg );
return NULL;
}
// TODO: destroy unreferenced producers (they are currently destroyed
// when the returned producer is closed).
-#include "producer_westley.h"
#include <framework/mlt.h>
#include <stdlib.h>
#include <string.h>
const xmlChar *publicId;
const xmlChar *systemId;
mlt_properties params;
+ mlt_profile profile;
};
typedef struct deserialise_context_s *deserialise_context;
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 );
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 );
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 );
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 ) );
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;
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", "" );
+++ /dev/null
-/*
- * producer_westley.h -- a libxml2 parser of mlt service networks
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Dan Dennedy <dan@dennedy.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef _PRODUCER_WESTLEY_H_
-#define _PRODUCER_WESTLEY_H_
-
-#include <framework/mlt_producer.h>
-
-extern mlt_producer producer_westley_init( int type, char *data );
-
-#endif
*/
#include <string.h>
+#include <framework/mlt.h>
-#include "filter_deinterlace.h"
+extern mlt_filter filter_deinterlace_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
-void *mlt_create_producer( char *id, void *arg )
+void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_filter( char *id, void *arg )
+void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
if ( !strcmp( id, "deinterlace" ) )
- return filter_deinterlace_init( arg );
+ return filter_deinterlace_init( profile, type, id, arg );
return NULL;
}
-void *mlt_create_transition( char *id, void *arg )
+void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-void *mlt_create_consumer( char *id, void *arg )
+void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
return NULL;
}
-
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "filter_deinterlace.h"
+#include <framework/mlt_filter.h>
#include "deinterlace.h"
#include <framework/mlt_frame.h>
/** 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 )
+++ /dev/null
-/*
- * filter_deinterlace.h -- deinterlace filter
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _FILTER_DEINTERLACE_H_
-#define _FILTER_DEINTERLACE_H_
-
-#include <framework/mlt_filter.h>
-
-extern mlt_filter filter_deinterlace_init( void *arg );
-
-#endif
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