if ( error == 0 )
{
// Get the properties from the service
- mlt_properties properties = mlt_service_properties( &this->parent );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent );
// Get the normalisation preference
char *normalisation = mlt_environment( "MLT_NORMALISATION" );
mlt_properties mlt_consumer_properties( mlt_consumer this )
{
- return this != NULL ? mlt_service_properties( &this->parent ) : NULL;
+ return this != NULL ? MLT_SERVICE_PROPERTIES( &this->parent ) : NULL;
}
/** Connect the consumer to the producer.
int mlt_consumer_start( mlt_consumer this )
{
// Get the properies
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Determine if there's a test card producer
char *test_card = mlt_properties_get( properties, "test_card" );
if ( producer != NULL )
{
// Test card should loop I guess...
- mlt_properties_set( mlt_producer_properties( producer ), "eof", "pause" );
+ mlt_properties_set( MLT_PRODUCER_PROPERTIES( producer ), "eof", "pause" );
mlt_producer_set_speed( producer, 0 );
mlt_producer_set_in_and_out( producer, 0, 0 );
int error = 1;
// Get the service assoicated to the consumer
- mlt_service service = mlt_consumer_service( this );
+ mlt_service service = MLT_CONSUMER_SERVICE( this );
if ( mlt_service_producer( service ) == NULL )
{
mlt_frame frame = NULL;
// Get the service assoicated to the consumer
- mlt_service service = mlt_consumer_service( this );
+ mlt_service service = MLT_CONSUMER_SERVICE( this );
// Get the consumer properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Get the frame
if ( mlt_service_producer( service ) == NULL && mlt_properties_get_int( properties, "put_mode" ) )
if ( frame != NULL )
{
// Get the frame properties
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Get the test card producer
mlt_producer test_card = mlt_properties_get_data( properties, "test_card_producer", NULL );
mlt_consumer this = arg;
// Get the properties of the consumer
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Get the width and height
int width = mlt_properties_get_int( properties, "width" );
frame->get_audio = NULL;
}
- mlt_properties_set_int( mlt_frame_properties( frame ), "rendered", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 1 );
// Get the starting time (can ignore the times above)
gettimeofday( &ante, NULL );
count ++;
// All non normal playback frames should be shown
- if ( mlt_properties_get_int( mlt_frame_properties( frame ), "_speed" ) != 1 )
+ if ( mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "_speed" ) != 1 )
{
skipped = 0;
time_frame = 0;
// Get the image, mark as rendered and time it
if ( !video_off )
mlt_frame_get_image( frame, &image, &this->format, &width, &height, 0 );
- mlt_properties_set_int( mlt_frame_properties( frame ), "rendered", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 1 );
}
else
{
mlt_frame frame = NULL;
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Check if the user has requested real time or not
if ( this->real_time )
// This isn't true, but from the consumers perspective it is
if ( frame != NULL )
- mlt_properties_set_int( mlt_frame_properties( frame ), "rendered", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 1 );
}
return frame;
void mlt_consumer_stopped( mlt_consumer this )
{
- mlt_properties_set_int( mlt_consumer_properties( this ), "running", 0 );
- mlt_events_fire( mlt_consumer_properties( this ), "consumer-stopped", NULL );
+ mlt_properties_set_int( MLT_CONSUMER_PROPERTIES( this ), "running", 0 );
+ mlt_events_fire( MLT_CONSUMER_PROPERTIES( this ), "consumer-stopped", NULL );
}
/** Stop the consumer.
int mlt_consumer_stop( mlt_consumer this )
{
// Get the properies
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Stop the consumer
if ( this->stop != NULL )
void mlt_consumer_close( mlt_consumer this )
{
- if ( this != NULL && mlt_properties_dec_ref( mlt_consumer_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_CONSUMER_PROPERTIES( this ) ) <= 0 )
{
// Get the childs close function
void ( *consumer_close )( ) = this->close;
/** 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 mlt_service mlt_consumer_service( mlt_consumer self );
mlt_events_fire( event_object, "producer-create-done", service, input, obj, NULL );
if ( obj != NULL )
{
- mlt_properties properties = mlt_producer_properties( obj );
+ 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 )
if ( obj != NULL )
{
- mlt_properties properties = mlt_filter_properties( obj );
+ 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 );
if ( obj != NULL )
{
- mlt_properties properties = mlt_transition_properties( obj );
+ 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 );
if ( obj != NULL )
{
mlt_filter filter = mlt_factory_filter( "data_show", NULL );
- mlt_properties properties = mlt_consumer_properties( obj );
+ 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 );
- mlt_service_attach( mlt_consumer_service( obj ), filter );
+ mlt_service_attach( MLT_CONSUMER_SERVICE( obj ), filter );
mlt_filter_close( filter );
}
return obj;
this->tractor = mlt_tractor_init( );
// The first plant will be connected to the mulitrack
- this->producer = mlt_multitrack_service( this->multitrack );
+ this->producer = MLT_MULTITRACK_SERVICE( this->multitrack );
// Connect the tractor to the multitrack
mlt_tractor_connect( this->tractor, this->producer );
this->tractor = tractor;
// The first plant will be connected to the mulitrack
- this->producer = mlt_multitrack_service( this->multitrack );
+ this->producer = MLT_MULTITRACK_SERVICE( this->multitrack );
// Connect the tractor to the multitrack
mlt_tractor_connect( this->tractor, this->producer );
mlt_service mlt_field_service( mlt_field this )
{
- return this != NULL ? mlt_tractor_service( this->tractor ) : NULL;
+ return MLT_TRACTOR_SERVICE( this->tractor );
}
/** Get the multi track.
mlt_properties mlt_field_properties( mlt_field this )
{
- return mlt_service_properties( mlt_field_service( this ) );
+ return MLT_SERVICE_PROPERTIES( mlt_field_service( this ) );
}
/** Plant a filter.
if ( result == 0 )
{
// This is now the new producer
- this->producer = mlt_filter_service( that );
+ this->producer = MLT_FILTER_SERVICE( that );
// Reconnect tractor to new producer
mlt_tractor_connect( this->tractor, this->producer );
if ( result == 0 )
{
// This is now the new producer
- this->producer = mlt_transition_service( that );
+ this->producer = MLT_TRANSITION_SERVICE( that );
// Reconnect tractor to new producer
mlt_tractor_connect( this->tractor, this->producer );
this->child = child;
if ( mlt_service_init( service, this ) == 0 )
{
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
// Override the get_frame method
service->get_frame = filter_get_frame;
mlt_properties mlt_filter_properties( mlt_filter this )
{
- return mlt_service_properties( mlt_filter_service( this ) );
+ return MLT_SERVICE_PROPERTIES( MLT_FILTER_SERVICE( this ) );
}
/** Connect this filter to a producers track. Note that a filter only operates
// If the connection was successful, grab the producer, track and reset in/out
if ( ret == 0 )
{
- mlt_properties properties = mlt_service_properties( &this->parent );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent );
mlt_properties_set_position( properties, "in", 0 );
mlt_properties_set_position( properties, "out", 0 );
mlt_properties_set_int( properties, "track", index );
void mlt_filter_set_in_and_out( mlt_filter this, mlt_position in, mlt_position out )
{
- mlt_properties properties = mlt_service_properties( &this->parent );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent );
mlt_properties_set_position( properties, "in", in );
mlt_properties_set_position( properties, "out", out );
}
int mlt_filter_get_track( mlt_filter this )
{
- mlt_properties properties = mlt_service_properties( &this->parent );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent );
return mlt_properties_get_int( properties, "track" );
}
mlt_position mlt_filter_get_in( mlt_filter this )
{
- mlt_properties properties = mlt_service_properties( &this->parent );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent );
return mlt_properties_get_position( properties, "in" );
}
mlt_position mlt_filter_get_out( mlt_filter this )
{
- mlt_properties properties = mlt_service_properties( &this->parent );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent );
return mlt_properties_get_position( properties, "out" );
}
void mlt_filter_close( mlt_filter this )
{
- if ( this != NULL && mlt_properties_dec_ref( mlt_filter_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_FILTER_PROPERTIES( this ) ) <= 0 )
{
if ( this->close != NULL )
{
/** Public final methods
*/
+#define MLT_FILTER_SERVICE( filter ) ( &( filter )->parent )
+#define MLT_FILTER_PROPERTIES( filter ) MLT_SERVICE_PROPERTIES( MLT_FILTER_SERVICE( filter ) )
+
extern int mlt_filter_init( mlt_filter self, void *child );
extern mlt_filter mlt_filter_new( );
extern mlt_service mlt_filter_service( mlt_filter self );
// Construct stacks for frames and methods
this->stack_image = mlt_deque_init( );
this->stack_audio = mlt_deque_init( );
+ this->stack_service = mlt_deque_init( );
}
return this;
int mlt_frame_is_test_card( mlt_frame this )
{
- return mlt_deque_count( this->stack_image ) == 0 || mlt_properties_get_int( mlt_frame_properties( this ), "test_image" );
+ return mlt_deque_count( this->stack_image ) == 0 || mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "test_image" );
}
/** Check if we have a way to derive something than test audio.
int mlt_frame_is_test_audio( mlt_frame this )
{
- return this->get_audio == NULL || mlt_properties_get_int( mlt_frame_properties( this ), "test_audio" );
+ return this->get_audio == NULL || mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "test_audio" );
}
/** Get the aspect ratio of the frame.
double mlt_frame_get_aspect_ratio( mlt_frame this )
{
- return mlt_properties_get_double( mlt_frame_properties( this ), "aspect_ratio" );
+ return mlt_properties_get_double( MLT_FRAME_PROPERTIES( this ), "aspect_ratio" );
}
/** Set the aspect ratio of the frame.
int mlt_frame_set_aspect_ratio( mlt_frame this, double value )
{
- return mlt_properties_set_double( mlt_frame_properties( this ), "aspect_ratio", value );
+ return mlt_properties_set_double( MLT_FRAME_PROPERTIES( this ), "aspect_ratio", value );
}
/** Get the position of this frame.
mlt_position mlt_frame_get_position( mlt_frame this )
{
- int pos = mlt_properties_get_position( mlt_frame_properties( this ), "_position" );
+ int pos = mlt_properties_get_position( MLT_FRAME_PROPERTIES( this ), "_position" );
return pos < 0 ? 0 : pos;
}
int mlt_frame_set_position( mlt_frame this, mlt_position value )
{
- return mlt_properties_set_position( mlt_frame_properties( this ), "_position", value );
+ return mlt_properties_set_position( MLT_FRAME_PROPERTIES( this ), "_position", value );
}
/** Stack a get_image callback.
return mlt_deque_pop_back( this->stack_audio );
}
+/** Return the service stack
+*/
+
+mlt_deque mlt_frame_service_stack( mlt_frame this )
+{
+ return this->stack_service;
+}
+
int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
mlt_get_image get_image = mlt_frame_pop_get_image( this );
mlt_producer producer = mlt_properties_get_data( properties, "test_card_producer", NULL );
else if ( producer != NULL )
{
mlt_frame test_frame = NULL;
- mlt_service_get_frame( mlt_producer_service( producer ), &test_frame, 0 );
+ mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &test_frame, 0 );
if ( test_frame != NULL )
{
- mlt_properties test_properties = mlt_frame_properties( test_frame );
+ mlt_properties test_properties = MLT_FRAME_PROPERTIES( test_frame );
mlt_properties_set_double( test_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
mlt_properties_set( test_properties, "rescale.interp", mlt_properties_get( properties, "rescale.interp" ) );
mlt_frame_get_image( test_frame, buffer, format, width, height, writable );
int mlt_frame_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
int hide = mlt_properties_get_int( properties, "test_audio" );
if ( hide == 0 && this->get_audio != NULL )
mlt_properties_set_int( properties, "audio_channels", *channels );
mlt_properties_set_int( properties, "audio_samples", *samples );
+ if ( mlt_properties_get( properties, "meta.volume" ) )
+ {
+ double value = mlt_properties_get_double( properties, "meta.volume" );
+ if ( value == 0.0 )
+ {
+ memset( *buffer, 0, *samples * *channels * 2 );
+ mlt_properties_set_double( properties, "meta.volume", 1.0 );
+ }
+ else if ( value != 1.0 )
+ {
+ int total = *samples * *channels;
+ int16_t *p = *buffer;
+ while ( total -- )
+ {
+ *p = *p * value;
+ p ++;
+ }
+ mlt_properties_set_double( properties, "meta.volume", 1.0 );
+ }
+ }
+
return 0;
}
unsigned char *mlt_frame_get_waveform( mlt_frame this, int w, int h )
{
int16_t *pcm = NULL;
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
mlt_audio_format format = mlt_audio_pcm;
int frequency = 32000; // lower frequency available?
int channels = 2;
mlt_producer mlt_frame_get_original_producer( mlt_frame this )
{
if ( this != NULL )
- return mlt_properties_get_data( mlt_frame_properties( this ), "_producer", NULL );
+ return mlt_properties_get_data( MLT_FRAME_PROPERTIES( this ), "_producer", NULL );
return NULL;
}
void mlt_frame_close( mlt_frame this )
{
- if ( this != NULL && mlt_properties_dec_ref( mlt_frame_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_FRAME_PROPERTIES( this ) ) <= 0 )
{
mlt_deque_close( this->stack_image );
mlt_deque_close( this->stack_audio );
+ while( mlt_deque_peek_back( this->stack_service ) )
+ mlt_service_close( mlt_deque_pop_back( this->stack_service ) );
+ mlt_deque_close( this->stack_service );
mlt_properties_close( &this->parent );
free( this );
}
uint8_t *mlt_frame_resize_yuv422( mlt_frame this, int owidth, int oheight )
{
// Get properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get the input image, width and height
uint8_t *input = mlt_properties_get_data( properties, "image", NULL );
uint8_t *mlt_frame_rescale_yuv422( mlt_frame this, int owidth, int oheight )
{
// Get properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get the input image, width and height
uint8_t *input = mlt_properties_get_data( properties, "image", NULL );
double d = 0, s = 0;
mlt_frame_get_audio( this, &dest, format, &frequency_dest, &channels_dest, &samples_dest );
- //fprintf( stderr, "mix: frame dest samples %d channels %d position %lld\n", samples_dest, channels_dest, mlt_properties_get_position( mlt_frame_properties( this ), "_position" ) );
mlt_frame_get_audio( that, &src, format, &frequency_src, &channels_src, &samples_src );
- //fprintf( stderr, "mix: frame src samples %d channels %d\n", samples_src, channels_src );
- int silent = mlt_properties_get_int( mlt_frame_properties( this ), "silent_audio" );
- mlt_properties_set_int( mlt_frame_properties( this ), "silent_audio", 0 );
+ int silent = mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "silent_audio" );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( this ), "silent_audio", 0 );
if ( silent )
memset( dest, 0, samples_dest * channels_dest * sizeof( int16_t ) );
- silent = mlt_properties_get_int( mlt_frame_properties( that ), "silent_audio" );
- mlt_properties_set_int( mlt_frame_properties( that ), "silent_audio", 0 );
+ silent = mlt_properties_get_int( MLT_FRAME_PROPERTIES( that ), "silent_audio" );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( that ), "silent_audio", 0 );
if ( silent )
memset( src, 0, samples_src * channels_src * sizeof( int16_t ) );
// Private properties
mlt_deque stack_image;
mlt_deque stack_audio;
+ mlt_deque stack_service;
};
+#define MLT_FRAME_PROPERTIES( frame ) ( &( frame )->parent )
+#define MLT_FRAME_SERVICE_STACK( frame ) ( ( frame )->stack_service )
+
extern mlt_frame mlt_frame_init( );
extern mlt_properties mlt_frame_properties( mlt_frame self );
extern int mlt_frame_is_test_card( mlt_frame self );
extern void *mlt_frame_pop_service( mlt_frame self );
extern int mlt_frame_push_audio( mlt_frame self, void *that );
extern void *mlt_frame_pop_audio( mlt_frame self );
+extern mlt_deque mlt_frame_service_stack( mlt_frame self );
extern mlt_producer mlt_frame_get_original_producer( mlt_frame self );
extern void mlt_frame_close( mlt_frame self );
#include <stdio.h>
#include <stdlib.h>
-struct mlt_track_s
-{
- mlt_producer producer;
- mlt_event event;
-};
-
-typedef struct mlt_track_s *mlt_track;
-
-/** Private definition.
-*/
-
-struct mlt_multitrack_s
-{
- // We're extending producer here
- struct mlt_producer_s parent;
- mlt_track *list;
- int size;
- int count;
-};
-
/** Forward reference.
*/
mlt_producer producer = &this->parent;
if ( mlt_producer_init( producer, this ) == 0 )
{
- mlt_properties properties = mlt_multitrack_properties( this );
+ mlt_properties properties = MLT_MULTITRACK_PROPERTIES( this );
producer->get_frame = producer_get_frame;
mlt_properties_set_data( properties, "multitrack", this, 0, NULL, NULL );
mlt_properties_set( properties, "log_id", "multitrack" );
mlt_service mlt_multitrack_service( mlt_multitrack this )
{
- return mlt_producer_service( mlt_multitrack_producer( this ) );
+ return MLT_MULTITRACK_SERVICE( this );
}
/** Get the properties associated this multitrack.
mlt_properties mlt_multitrack_properties( mlt_multitrack this )
{
- return mlt_service_properties( mlt_multitrack_service( this ) );
+ return MLT_MULTITRACK_PROPERTIES( this );
}
/** Initialise position related information.
int i = 0;
// Obtain the properties of this multitrack
- mlt_properties properties = mlt_multitrack_properties( this );
+ mlt_properties properties = MLT_MULTITRACK_PROPERTIES( this );
// We need to ensure that the multitrack reports the longest track as its length
mlt_position length = 0;
{
// If we have more than 1 track, we must be in continue mode
if ( this->count > 1 )
- mlt_properties_set( mlt_producer_properties( producer ), "eof", "continue" );
+ mlt_properties_set( MLT_PRODUCER_PROPERTIES( producer ), "eof", "continue" );
// Determine the longest length
- //if ( !mlt_properties_get_int( mlt_producer_properties( producer ), "hide" ) )
+ //if ( !mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( producer ), "hide" ) )
length = mlt_producer_get_playtime( producer ) > length ? mlt_producer_get_playtime( producer ) : length;
// Handle fps
fprintf( stderr, "Warning: fps mismatch on track %d\n", i );
// It should be safe to impose fps on an image producer, but not necessarily safe for video
- mlt_properties_set_double( mlt_producer_properties( producer ), "fps", fps );
+ mlt_properties_set_double( MLT_PRODUCER_PROPERTIES( producer ), "fps", fps );
}
}
}
int mlt_multitrack_connect( mlt_multitrack this, mlt_producer producer, int track )
{
// Connect to the producer to ourselves at the specified track
- int result = mlt_service_connect_producer( mlt_multitrack_service( this ), mlt_producer_service( producer ), track );
+ int result = mlt_service_connect_producer( MLT_MULTITRACK_SERVICE( this ), MLT_PRODUCER_SERVICE( producer ), track );
if ( result == 0 )
{
// Assign the track in our list here
this->list[ track ]->producer = producer;
- this->list[ track ]->event = mlt_events_listen( mlt_producer_properties( producer ), this,
+ this->list[ track ]->event = mlt_events_listen( MLT_PRODUCER_PROPERTIES( producer ), this,
"producer-changed", ( mlt_listener )mlt_multitrack_listener );
- mlt_properties_inc_ref( mlt_producer_properties( producer ) );
+ mlt_properties_inc_ref( MLT_PRODUCER_PROPERTIES( producer ) );
mlt_event_inc_ref( this->list[ track ]->event );
// Increment the track count if need be
if ( producer != NULL )
{
// Get the properties of this producer
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
// Determine if it's a playlist
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
break;
case mlt_whence_relative_current:
- position = mlt_producer_position( mlt_multitrack_producer( this ) );
+ position = mlt_producer_position( MLT_MULTITRACK_PRODUCER( this ) );
for ( i = 0; i < count - 2; i ++ )
if ( position >= map[ i ] && position < map[ i + 1 ] )
break;
mlt_producer producer = this->list[ index ]->producer;
// Get the track hide property
- int hide = mlt_properties_get_int( mlt_producer_properties( mlt_producer_cut_parent( producer ) ), "hide" );
+ int hide = mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( producer ) ), "hide" );
// Obtain the current position
mlt_position position = mlt_producer_frame( parent );
// Get the parent properties
- mlt_properties producer_properties = mlt_producer_properties( parent );
+ mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( parent );
// Get the speed
double speed = mlt_properties_get_double( producer_properties, "_speed" );
mlt_producer_seek( producer, position );
// Get the frame from the producer
- mlt_service_get_frame( mlt_producer_service( producer ), frame, 0 );
+ mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), frame, 0 );
// Indicate speed of this producer
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
mlt_properties_set_double( properties, "_speed", speed );
mlt_properties_set_position( properties, "_position", position );
mlt_properties_set_int( properties, "hide", hide );
if ( index >= this->count )
{
// Let tractor know if we've reached the end
- mlt_properties_set_int( mlt_frame_properties( *frame ), "last_track", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "last_track", 1 );
// Move to the next frame
mlt_producer_prepare_next( parent );
void mlt_multitrack_close( mlt_multitrack this )
{
- if ( this != NULL && mlt_properties_dec_ref( mlt_multitrack_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_MULTITRACK_PROPERTIES( this ) ) <= 0 )
{
int i = 0;
for ( i = 0; i < this->count; i ++ )
#include "mlt_producer.h"
+/** Private definition.
+*/
+
+struct mlt_track_s
+{
+ mlt_producer producer;
+ mlt_event event;
+};
+
+typedef struct mlt_track_s *mlt_track;
+
+struct mlt_multitrack_s
+{
+ // We're extending producer here
+ struct mlt_producer_s parent;
+ mlt_track *list;
+ int size;
+ int count;
+};
+
/** Public final methods
*/
+#define MLT_MULTITRACK_PRODUCER( multitrack ) ( &( multitrack )->parent )
+#define MLT_MULTITRACK_SERVICE( multitrack ) MLT_PRODUCER_SERVICE( MLT_MULTITRACK_PRODUCER( multitrack ) )
+#define MLT_MULTITRACK_PROPERTIES( multitrack ) MLT_SERVICE_PROPERTIES( MLT_MULTITRACK_SERVICE( multitrack ) )
+
extern mlt_multitrack mlt_multitrack_init( );
extern mlt_producer mlt_multitrack_producer( mlt_multitrack self );
extern mlt_service mlt_multitrack_service( mlt_multitrack self );
/** Virtual playlist entry.
*/
-typedef struct playlist_entry_s
+struct playlist_entry_s
{
mlt_producer producer;
mlt_position frame_in;
mlt_position producer_length;
mlt_event event;
int preservation_hack;
-}
-playlist_entry;
-
-/** Private definition.
-*/
-
-struct mlt_playlist_s
-{
- struct mlt_producer_s parent;
- struct mlt_producer_s blank;
-
- int size;
- int count;
- playlist_entry **list;
};
/** Forward declarations
// Initialise blank
mlt_producer_init( &this->blank, NULL );
- mlt_properties_set( mlt_producer_properties( &this->blank ), "mlt_service", "blank" );
- mlt_properties_set( mlt_producer_properties( &this->blank ), "resource", "blank" );
+ mlt_properties_set( MLT_PRODUCER_PROPERTIES( &this->blank ), "mlt_service", "blank" );
+ mlt_properties_set( MLT_PRODUCER_PROPERTIES( &this->blank ), "resource", "blank" );
// Indicate that this producer is a playlist
- mlt_properties_set_data( mlt_playlist_properties( this ), "playlist", this, 0, NULL, NULL );
+ mlt_properties_set_data( MLT_PLAYLIST_PROPERTIES( this ), "playlist", this, 0, NULL, NULL );
// Specify the eof condition
- mlt_properties_set( mlt_playlist_properties( this ), "eof", "pause" );
- mlt_properties_set( mlt_playlist_properties( this ), "resource", "<playlist>" );
- mlt_properties_set( mlt_playlist_properties( this ), "mlt_type", "mlt_producer" );
- mlt_properties_set_position( mlt_playlist_properties( this ), "in", 0 );
- mlt_properties_set_position( mlt_playlist_properties( this ), "out", -1 );
- mlt_properties_set_position( mlt_playlist_properties( this ), "length", 0 );
+ mlt_properties_set( MLT_PLAYLIST_PROPERTIES( this ), "eof", "pause" );
+ mlt_properties_set( MLT_PLAYLIST_PROPERTIES( this ), "resource", "<playlist>" );
+ mlt_properties_set( MLT_PLAYLIST_PROPERTIES( this ), "mlt_type", "mlt_producer" );
+ mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( this ), "in", 0 );
+ mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( this ), "out", -1 );
+ mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( this ), "length", 0 );
this->size = 10;
this->list = malloc( this->size * sizeof( playlist_entry * ) );
mlt_service mlt_playlist_service( mlt_playlist this )
{
- return mlt_producer_service( &this->parent );
+ return MLT_PRODUCER_SERVICE( &this->parent );
}
/** Get the propertues associated to this playlist.
mlt_properties mlt_playlist_properties( mlt_playlist this )
{
- return mlt_producer_properties( &this->parent );
+ return MLT_PRODUCER_PROPERTIES( &this->parent );
}
/** Refresh the playlist after a clip has been changed.
static int mlt_playlist_virtual_refresh( mlt_playlist this )
{
// Obtain the properties
- mlt_properties properties = mlt_playlist_properties( this );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
// Get the fps of the first producer
double fps = mlt_properties_get_double( properties, "first_fps" );
// Inherit it from the producer
fps = mlt_producer_get_fps( producer );
}
- else if ( fps != mlt_properties_get_double( mlt_producer_properties( producer ), "fps" ) )
+ else if ( fps != mlt_properties_get_double( MLT_PRODUCER_PROPERTIES( producer ), "fps" ) )
{
// Generate a warning for now - the following attempt to fix may fail
fprintf( stderr, "Warning: fps mismatch on playlist producer %d\n", this->count );
// It should be safe to impose fps on an image producer, but not necessarily safe for video
- mlt_properties_set_double( mlt_producer_properties( producer ), "fps", fps );
+ mlt_properties_set_double( MLT_PRODUCER_PROPERTIES( producer ), "fps", fps );
}
// Check if the length of the producer has changed
// Make sure the blank is long enough to accomodate the length specified
if ( out - in + 1 > mlt_producer_get_length( &this->blank ) )
{
- mlt_properties blank_props = mlt_producer_properties( &this->blank );
+ mlt_properties blank_props = MLT_PRODUCER_PROPERTIES( &this->blank );
mlt_events_block( blank_props, blank_props );
mlt_producer_set_in_and_out( &this->blank, in, out );
mlt_events_unblock( blank_props, blank_props );
else
{
producer = source;
- mlt_properties_inc_ref( mlt_producer_properties( producer ) );
+ mlt_properties_inc_ref( MLT_PRODUCER_PROPERTIES( producer ) );
}
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
}
else if ( mlt_producer_is_cut( source ) )
{
in = mlt_producer_get_in( producer );
if ( out == -1 || out > mlt_producer_get_out( producer ) )
out = mlt_producer_get_out( producer );
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
mlt_properties_inc_ref( properties );
}
else
in = mlt_producer_get_in( producer );
if ( out == -1 || out > mlt_producer_get_out( producer ) )
out = mlt_producer_get_out( producer );
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
}
// Fetch the cuts parent properties
- parent = mlt_producer_properties( mlt_producer_cut_parent( producer ) );
+ parent = MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( producer ) );
// Check that we have room
if ( this->count >= this->size )
mlt_producer producer = mlt_playlist_locate( this, &position, &i, &total );
// Get the properties
- mlt_properties properties = mlt_playlist_properties( this );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
// Get the eof handling
char *eof = mlt_properties_get( properties, "eof" );
{
playlist_entry *entry = this->list[ this->count - 1 ];
int count = entry->frame_count / entry->repeat;
- mlt_producer this_producer = mlt_playlist_producer( this );
+ mlt_producer this_producer = MLT_PLAYLIST_PRODUCER( this );
mlt_producer_seek( this_producer, original - 1 );
producer = entry->producer;
mlt_producer_seek( producer, entry->frame_out % count );
else if ( !strcmp( eof, "loop" ) && total > 0 )
{
playlist_entry *entry = this->list[ 0 ];
- mlt_producer this_producer = mlt_playlist_producer( this );
+ mlt_producer this_producer = MLT_PLAYLIST_PRODUCER( this );
mlt_producer_seek( this_producer, 0 );
producer = entry->producer;
mlt_producer_seek( producer, 0 );
producer = &this->blank;
}
- return mlt_producer_service( producer );
+ return MLT_PRODUCER_SERVICE( producer );
}
/** Invoked when a producer indicates that it has prematurely reached its end.
if ( !error )
{
mlt_producer producer = mlt_producer_cut_parent( this->list[ index ]->producer );
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
info->clip = index;
info->producer = producer;
info->cut = this->list[ index ]->producer;
mlt_producer_close( this->list[ i ]->producer );
}
this->count = 0;
- mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", 0 );
+ mlt_properties_set_double( MLT_PLAYLIST_PROPERTIES( this ), "first_fps", 0 );
return mlt_playlist_virtual_refresh( this );
}
int mlt_playlist_insert( mlt_playlist this, mlt_producer producer, int where, mlt_position in, mlt_position out )
{
// Append to end
- mlt_events_block( mlt_playlist_properties( this ), this );
+ mlt_events_block( MLT_PLAYLIST_PROPERTIES( this ), this );
mlt_playlist_append_io( this, producer, in, out );
// Move to the position specified
mlt_playlist_move( this, this->count - 1, where );
- mlt_events_unblock( mlt_playlist_properties( this ), this );
+ mlt_events_unblock( MLT_PLAYLIST_PROPERTIES( this ), this );
return mlt_playlist_virtual_refresh( this );
}
{
// We need to know the current clip and the position within the playlist
int current = mlt_playlist_current_clip( this );
- mlt_position position = mlt_producer_position( mlt_playlist_producer( this ) );
+ mlt_position position = mlt_producer_position( MLT_PLAYLIST_PRODUCER( this ) );
// We need all the details about the clip we're removing
mlt_playlist_clip_info where_info;
playlist_entry *entry = this->list[ where ];
- mlt_properties properties = mlt_producer_properties( entry->producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( entry->producer );
// Loop variable
int i = 0;
mlt_properties_set_data( mix, "mix_in", NULL, 0, NULL, NULL );
}
- mlt_producer_clear( entry->producer );
+ if ( mlt_properties_ref_count( MLT_PRODUCER_PROPERTIES( entry->producer ) ) == 1 )
+ mlt_producer_clear( entry->producer );
}
// Close the producer associated to the clip info
// Correct position
if ( where == current )
- mlt_producer_seek( mlt_playlist_producer( this ), where_info.start );
+ mlt_producer_seek( MLT_PLAYLIST_PRODUCER( this ), where_info.start );
else if ( where < current && this->count > 0 )
- mlt_producer_seek( mlt_playlist_producer( this ), position - where_info.frame_count );
+ mlt_producer_seek( MLT_PLAYLIST_PRODUCER( this ), position - where_info.frame_count );
else if ( this->count == 0 )
- mlt_producer_seek( mlt_playlist_producer( this ), 0 );
+ mlt_producer_seek( MLT_PLAYLIST_PRODUCER( this ), 0 );
// Free the entry
free( entry );
if ( src != dest && this->count > 1 )
{
int current = mlt_playlist_current_clip( this );
- mlt_position position = mlt_producer_position( mlt_playlist_producer( this ) );
+ mlt_position position = mlt_producer_position( MLT_PLAYLIST_PRODUCER( this ) );
playlist_entry *src_entry = NULL;
// We need all the details about the current clip
this->list[ dest ] = src_entry;
mlt_playlist_get_clip_info( this, ¤t_info, current );
- mlt_producer_seek( mlt_playlist_producer( this ), current_info.start + position );
+ mlt_producer_seek( MLT_PLAYLIST_PRODUCER( this ), current_info.start + position );
mlt_playlist_virtual_refresh( this );
}
// Make sure the blank is long enough to accomodate the length specified
if ( out - in + 1 > mlt_producer_get_length( &this->blank ) )
{
- mlt_properties blank_props = mlt_producer_properties( &this->blank );
+ mlt_properties blank_props = MLT_PRODUCER_PROPERTIES( &this->blank );
mlt_events_block( blank_props, blank_props );
mlt_producer_set_in_and_out( &this->blank, in, out );
mlt_events_unblock( blank_props, blank_props );
{
int in = entry->frame_in;
int out = entry->frame_out;
- mlt_events_block( mlt_playlist_properties( this ), this );
+ mlt_events_block( MLT_PLAYLIST_PROPERTIES( this ), this );
mlt_playlist_resize_clip( this, clip, in, in + position );
if ( !mlt_producer_is_blank( entry->producer ) )
{
{
mlt_playlist_insert( this, &this->blank, clip + 1, 0, out - position - 1 );
}
- mlt_events_unblock( mlt_playlist_properties( this ), this );
+ mlt_events_unblock( MLT_PLAYLIST_PROPERTIES( this ), this );
mlt_playlist_virtual_refresh( this );
}
else
{
int i = clip;
mlt_playlist new_clip = mlt_playlist_init( );
- mlt_events_block( mlt_playlist_properties( this ), this );
+ mlt_events_block( MLT_PLAYLIST_PROPERTIES( this ), this );
if ( clip + count >= this->count )
count = this->count - clip;
for ( i = 0; i <= count; i ++ )
entry->preservation_hack = 1;
mlt_playlist_remove( this, clip );
}
- mlt_events_unblock( mlt_playlist_properties( this ), this );
- mlt_playlist_insert( this, mlt_playlist_producer( new_clip ), clip, 0, -1 );
+ mlt_events_unblock( MLT_PLAYLIST_PROPERTIES( this ), this );
+ mlt_playlist_insert( this, MLT_PLAYLIST_PRODUCER( new_clip ), clip, 0, -1 );
mlt_playlist_close( new_clip );
}
return error;
mlt_producer track_a = NULL;
mlt_producer track_b = NULL;
mlt_tractor tractor = mlt_tractor_new( );
- mlt_events_block( mlt_playlist_properties( this ), this );
+ mlt_events_block( MLT_PLAYLIST_PROPERTIES( this ), this );
// Check length is valid for both clips and resize if necessary.
int max_size = clip_a->frame_count > clip_b->frame_count ? clip_a->frame_count : clip_b->frame_count;
mlt_tractor_set_track( tractor, track_b, 1 );
// Insert the mix object into the playlist
- mlt_playlist_insert( this, mlt_tractor_producer( tractor ), clip + 1, -1, -1 );
- mlt_properties_set_data( mlt_tractor_properties( tractor ), "mlt_mix", tractor, 0, NULL, NULL );
+ mlt_playlist_insert( this, MLT_TRACTOR_PRODUCER( tractor ), clip + 1, -1, -1 );
+ mlt_properties_set_data( MLT_TRACTOR_PROPERTIES( tractor ), "mlt_mix", tractor, 0, NULL, NULL );
// Attach the transition
if ( transition != NULL )
else if ( clip_b->frame_out - clip_b->frame_in > length )
{
mlt_playlist_resize_clip( this, clip + 2, clip_b->frame_in + length, clip_b->frame_out );
- mlt_properties_set_data( mlt_producer_properties( clip_b->producer ), "mix_in", tractor, 0, NULL, NULL );
- mlt_properties_set_data( mlt_tractor_properties( tractor ), "mix_out", clip_b->producer, 0, NULL, NULL );
+ mlt_properties_set_data( MLT_PRODUCER_PROPERTIES( clip_b->producer ), "mix_in", tractor, 0, NULL, NULL );
+ mlt_properties_set_data( MLT_TRACTOR_PROPERTIES( tractor ), "mix_out", clip_b->producer, 0, NULL, NULL );
}
else
{
else if ( clip_a->frame_out - clip_a->frame_in > length )
{
mlt_playlist_resize_clip( this, clip, clip_a->frame_in, clip_a->frame_out - length );
- mlt_properties_set_data( mlt_producer_properties( clip_a->producer ), "mix_out", tractor, 0, NULL, NULL );
- mlt_properties_set_data( mlt_tractor_properties( tractor ), "mix_in", clip_a->producer, 0, NULL, NULL );
+ mlt_properties_set_data( MLT_PRODUCER_PROPERTIES( clip_a->producer ), "mix_out", tractor, 0, NULL, NULL );
+ mlt_properties_set_data( MLT_TRACTOR_PROPERTIES( tractor ), "mix_in", clip_a->producer, 0, NULL, NULL );
}
else
{
}
// Unblock and force a fire off of change events to listeners
- mlt_events_unblock( mlt_playlist_properties( this ), this );
+ mlt_events_unblock( MLT_PLAYLIST_PROPERTIES( this ), this );
mlt_playlist_virtual_refresh( this );
mlt_tractor_close( tractor );
}
int mlt_playlist_mix_add( mlt_playlist this, int clip, mlt_transition transition )
{
mlt_producer producer = mlt_producer_cut_parent( mlt_playlist_get_clip( this, clip ) );
- mlt_properties properties = producer != NULL ? mlt_producer_properties( producer ) : NULL;
+ mlt_properties properties = producer != NULL ? MLT_PRODUCER_PROPERTIES( producer ) : NULL;
mlt_tractor tractor = properties != NULL ? mlt_properties_get_data( properties, "mlt_mix", NULL ) : NULL;
int error = transition == NULL || tractor == NULL;
if ( error == 0 )
int mlt_playlist_clip_is_mix( mlt_playlist this, int clip )
{
mlt_producer producer = mlt_producer_cut_parent( mlt_playlist_get_clip( this, clip ) );
- mlt_properties properties = producer != NULL ? mlt_producer_properties( producer ) : NULL;
+ mlt_properties properties = producer != NULL ? MLT_PRODUCER_PROPERTIES( producer ) : NULL;
mlt_tractor tractor = properties != NULL ? mlt_properties_get_data( properties, "mlt_mix", NULL ) : NULL;
return tractor != NULL;
}
if ( error == 0 )
{
mlt_producer producer = mlt_producer_cut_parent( this->list[ clip ]->producer );
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
error = mlt_properties_get_data( properties, "mlt_mix", NULL ) == NULL ||
this->list[ clip ]->preservation_hack;
}
{
playlist_entry *mix = this->list[ clip ];
mlt_tractor tractor = ( mlt_tractor )mlt_producer_cut_parent( mix->producer );
- mlt_properties properties = mlt_tractor_properties( tractor );
+ mlt_properties properties = MLT_TRACTOR_PROPERTIES( tractor );
mlt_producer clip_a = mlt_properties_get_data( properties, "mix_in", NULL );
mlt_producer clip_b = mlt_properties_get_data( properties, "mix_out", NULL );
- int length = mlt_producer_get_playtime( mlt_tractor_producer( tractor ) );
- mlt_events_block( mlt_playlist_properties( this ), this );
+ int length = mlt_producer_get_playtime( MLT_TRACTOR_PRODUCER( tractor ) );
+ mlt_events_block( MLT_PLAYLIST_PROPERTIES( this ), this );
if ( clip_a != NULL )
{
mlt_properties_set_data( properties, "mlt_mix", NULL, 0, NULL, NULL );
mlt_playlist_remove( this, clip );
- mlt_events_unblock( mlt_playlist_properties( this ), this );
+ mlt_events_unblock( MLT_PLAYLIST_PROPERTIES( this ), this );
mlt_playlist_virtual_refresh( this );
}
return error;
if ( error == 0 )
{
mlt_producer producer = mlt_producer_cut_parent( this->list[ clip ]->producer );
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
error = mlt_properties_get_data( properties, "mlt_mix", NULL ) == NULL;
}
{
playlist_entry *mix = this->list[ clip ];
mlt_tractor tractor = ( mlt_tractor )mlt_producer_cut_parent( mix->producer );
- mlt_properties properties = mlt_tractor_properties( tractor );
+ mlt_properties properties = MLT_TRACTOR_PROPERTIES( tractor );
mlt_producer clip_a = mlt_properties_get_data( properties, "mix_in", NULL );
mlt_producer clip_b = mlt_properties_get_data( properties, "mix_out", NULL );
mlt_producer track_a = mlt_tractor_get_track( tractor, 0 );
mlt_producer track_b = mlt_tractor_get_track( tractor, 1 );
int length = out - in + 1;
- int length_diff = length - mlt_producer_get_playtime( mlt_tractor_producer( tractor ) );
- mlt_events_block( mlt_playlist_properties( this ), this );
+ int length_diff = length - mlt_producer_get_playtime( MLT_TRACTOR_PRODUCER( tractor ) );
+ mlt_events_block( MLT_PLAYLIST_PROPERTIES( this ), this );
if ( clip_a != NULL )
mlt_producer_set_in_and_out( clip_a, mlt_producer_get_in( clip_a ), mlt_producer_get_out( clip_a ) - length_diff );
mlt_producer_set_in_and_out( track_a, mlt_producer_get_in( track_a ) - length_diff, mlt_producer_get_out( track_a ) );
mlt_producer_set_in_and_out( track_b, mlt_producer_get_in( track_b ), mlt_producer_get_out( track_b ) + length_diff );
- mlt_producer_set_in_and_out( mlt_multitrack_producer( mlt_tractor_multitrack( tractor ) ), in, out );
- mlt_producer_set_in_and_out( mlt_tractor_producer( tractor ), in, out );
- mlt_properties_set_position( mlt_producer_properties( mix->producer ), "length", out - in + 1 );
+ mlt_producer_set_in_and_out( MLT_MULTITRACK_PRODUCER( mlt_tractor_multitrack( tractor ) ), in, out );
+ mlt_producer_set_in_and_out( MLT_TRACTOR_PRODUCER( tractor ), in, out );
+ mlt_properties_set_position( MLT_PRODUCER_PROPERTIES( mix->producer ), "length", out - in + 1 );
mlt_producer_set_in_and_out( mix->producer, in, out );
- mlt_events_unblock( mlt_playlist_properties( this ), this );
+ mlt_events_unblock( MLT_PLAYLIST_PROPERTIES( this ), this );
mlt_playlist_virtual_refresh( this );
}
return error;
if ( this != NULL )
{
int i = 0;
- mlt_properties properties = mlt_playlist_properties( this );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
mlt_events_block( properties, properties );
for ( i = 1; i < this->count; i ++ )
playlist_entry *entry = this->list[ clip ];
int in = entry->frame_in;
int out = entry->frame_out;
- mlt_properties properties = mlt_playlist_properties( this );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
producer = entry->producer;
- mlt_properties_inc_ref( mlt_producer_properties( producer ) );
+ mlt_properties_inc_ref( MLT_PRODUCER_PROPERTIES( producer ) );
mlt_events_block( properties, properties );
mlt_playlist_remove( this, clip );
mlt_playlist_blank( this, out - in );
{
if ( this != NULL && length > 0 )
{
- mlt_properties properties = mlt_playlist_properties( this );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
mlt_events_block( properties, properties );
mlt_playlist_blank( this, length );
mlt_playlist_move( this, this->count - 1, clip );
if ( this != NULL && length != 0 )
{
int clip = mlt_playlist_get_clip_index_at( this, position );
- mlt_properties properties = mlt_playlist_properties( this );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
mlt_events_block( properties, properties );
if ( find && clip < this->count && !mlt_playlist_is_blank( this, clip ) )
clip ++;
int ret = this == NULL || position < 0 || producer == NULL;
if ( ret == 0 )
{
- mlt_properties properties = mlt_playlist_properties( this );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
int length = mlt_producer_get_playtime( producer );
int clip = mlt_playlist_get_clip_index_at( this, position );
mlt_playlist_clip_info info;
int index = mlt_playlist_get_clip_index_at( this, position );
if ( index >= 0 && index < this->count )
{
- mlt_properties properties = mlt_playlist_properties( this );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
int clip_start = mlt_playlist_clip_start( this, index );
int clip_length = mlt_playlist_clip_length( this, index );
- int list_length = mlt_producer_get_playtime( mlt_playlist_producer( this ) );
+ int list_length = mlt_producer_get_playtime( MLT_PLAYLIST_PRODUCER( this ) );
mlt_events_block( properties, this );
if ( position + length > list_length )
mlt_service_get_frame( real, frame, index );
// Check if we're at the end of the clip
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
if ( mlt_properties_get_int( properties, "end_of_clip" ) )
mlt_playlist_virtual_set_out( this );
}
// Check for notifier and call with appropriate argument
- mlt_properties playlist_properties = mlt_producer_properties( producer );
+ mlt_properties playlist_properties = MLT_PRODUCER_PROPERTIES( producer );
void ( *notifier )( void * ) = mlt_properties_get_data( playlist_properties, "notifier", NULL );
if ( notifier != NULL )
{
void mlt_playlist_close( mlt_playlist this )
{
- if ( this != NULL && mlt_properties_dec_ref( mlt_playlist_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_PLAYLIST_PROPERTIES( this ) ) <= 0 )
{
int i = 0;
this->parent.close = NULL;
}
mlt_playlist_clip_info;
+/** Private definition.
+*/
+
+typedef struct playlist_entry_s playlist_entry;
+
+struct mlt_playlist_s
+{
+ struct mlt_producer_s parent;
+ struct mlt_producer_s blank;
+
+ int size;
+ int count;
+ playlist_entry **list;
+};
+
/** Public final methods
*/
+#define MLT_PLAYLIST_PRODUCER( playlist ) ( &( playlist )->parent )
+#define MLT_PLAYLIST_SERVICE( playlist ) MLT_PRODUCER_SERVICE( MLT_PLAYLIST_PRODUCER( playlist ) )
+#define MLT_PLAYLIST_PROPERTIES( playlist ) MLT_SERVICE_PROPERTIES( MLT_PLAYLIST_SERVICE( playlist ) )
+
extern mlt_playlist mlt_playlist_init( );
extern mlt_producer mlt_playlist_producer( mlt_playlist self );
extern mlt_service mlt_playlist_service( mlt_playlist self );
static void mlt_producer_property_changed( mlt_service owner, mlt_producer this, char *name );
static void mlt_producer_service_changed( mlt_service owner, mlt_producer this );
+//#define _MLT_PRODUCER_CHECKS_ 1
+
+#ifdef _MLT_PRODUCER_CHECKS_
+static int producers_created = 0;
+static int producers_destroyed = 0;
+#endif
+
/** Constructor
*/
// Continue if no error
if ( error == 0 )
{
+#ifdef _MLT_PRODUCER_CHECKS_
+ producers_created ++;
+#endif
+
// Initialise the producer
memset( this, 0, sizeof( struct mlt_producer_s ) );
this->close_object = this;
// Get the properties of the parent
- mlt_properties properties = mlt_service_properties( parent );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( parent );
// Set the default properties
mlt_properties_set( properties, "mlt_type", "mlt_producer" );
static void mlt_producer_property_changed( mlt_service owner, mlt_producer this, char *name )
{
if ( !strcmp( name, "in" ) || !strcmp( name, "out" ) || !strcmp( name, "length" ) )
- mlt_events_fire( mlt_producer_properties( mlt_producer_cut_parent( this ) ), "producer-changed", NULL );
+ mlt_events_fire( MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( this ) ), "producer-changed", NULL );
}
/** Listener for service changes.
static void mlt_producer_service_changed( mlt_service owner, mlt_producer this )
{
- mlt_events_fire( mlt_producer_properties( mlt_producer_cut_parent( this ) ), "producer-changed", NULL );
-}
-
-/** Special case destructor
-*/
-
-static void mlt_cut_destroy( void *obj )
-{
- mlt_producer this = obj;
- this->close = NULL;
- this->parent.close = NULL;
- mlt_service_close( &this->parent );
- free( this );
+ mlt_events_fire( MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( this ) ), "producer-changed", NULL );
}
/** Create a new producer.
{
mlt_producer this = malloc( sizeof( struct mlt_producer_s ) );
mlt_producer_init( this, NULL );
- this->close = mlt_cut_destroy;
return this;
}
int mlt_producer_is_cut( mlt_producer this )
{
- return mlt_properties_get_int( mlt_producer_properties( this ), "_cut" );
+ return mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( this ), "_cut" );
}
/** Determine if producer is a mix.
int mlt_producer_is_mix( mlt_producer this )
{
- mlt_properties properties = this != NULL ? mlt_producer_properties( this ) : NULL;
+ mlt_properties properties = this != NULL ? MLT_PRODUCER_PROPERTIES( this ) : NULL;
mlt_tractor tractor = properties != NULL ? mlt_properties_get_data( properties, "mlt_mix", NULL ) : NULL;
return tractor != NULL;
}
int mlt_producer_is_blank( mlt_producer this )
{
- return this == NULL || !strcmp( mlt_properties_get( mlt_producer_properties( mlt_producer_cut_parent( this ) ), "resource" ), "blank" );
+ return this == NULL || !strcmp( mlt_properties_get( MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( this ) ), "resource" ), "blank" );
}
/** Obtain the parent producer.
mlt_producer mlt_producer_cut_parent( mlt_producer this )
{
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
if ( mlt_producer_is_cut( this ) )
return mlt_properties_get_data( properties, "_cut_parent", NULL );
else
{
mlt_producer result = mlt_producer_new( );
mlt_producer parent = mlt_producer_cut_parent( this );
- mlt_properties properties = mlt_producer_properties( result );
- mlt_properties parent_props = mlt_producer_properties( parent );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( result );
+ mlt_properties parent_props = MLT_PRODUCER_PROPERTIES( parent );
+ mlt_events_block( MLT_PRODUCER_PROPERTIES( result ), MLT_PRODUCER_PROPERTIES( result ) );
// Special case - allow for a cut of the entire producer (this will squeeze all other cuts to 0)
if ( in <= 0 )
in = 0;
mlt_properties_set_position( properties, "length", mlt_properties_get_position( parent_props, "length" ) );
mlt_producer_set_in_and_out( result, in, out );
+ // Mini fezzik :-/
+ mlt_filter filter = mlt_factory_filter( "data_feed", "attr_check" );
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik", 1 );
+ mlt_producer_attach( result, filter );
+ mlt_filter_close( filter );
+ mlt_events_unblock( MLT_PRODUCER_PROPERTIES( result ), MLT_PRODUCER_PROPERTIES( result ) );
+
return result;
}
mlt_properties mlt_producer_properties( mlt_producer this )
{
- return mlt_service_properties( &this->parent );
+ return MLT_SERVICE_PROPERTIES( &this->parent );
}
/** Seek to a specified position.
int mlt_producer_seek( mlt_producer this, mlt_position position )
{
// Determine eof handling
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
char *eof = mlt_properties_get( properties, "eof" );
int use_points = 1 - mlt_properties_get_int( properties, "ignore_points" );
- // Recursive behaviour for cuts...
+ // Recursive behaviour for cuts - repositions parent and then repositions cut
+ // hence no return on this condition
if ( mlt_producer_is_cut( this ) )
mlt_producer_seek( mlt_producer_cut_parent( this ), position + mlt_producer_get_in( this ) );
}
// Set the position
- mlt_properties_set_position( mlt_producer_properties( this ), "_position", position );
+ mlt_properties_set_position( MLT_PRODUCER_PROPERTIES( this ), "_position", position );
// Calculate the absolute frame
- mlt_properties_set_position( mlt_producer_properties( this ), "_frame", use_points * mlt_producer_get_in( this ) + position );
+ mlt_properties_set_position( MLT_PRODUCER_PROPERTIES( this ), "_frame", use_points * mlt_producer_get_in( this ) + position );
return 0;
}
mlt_position mlt_producer_position( mlt_producer this )
{
- return mlt_properties_get_position( mlt_producer_properties( this ), "_position" );
+ return mlt_properties_get_position( MLT_PRODUCER_PROPERTIES( this ), "_position" );
}
/** Get the current position (relative to start of producer).
mlt_position mlt_producer_frame( mlt_producer this )
{
- return mlt_properties_get_position( mlt_producer_properties( this ), "_frame" );
+ return mlt_properties_get_position( MLT_PRODUCER_PROPERTIES( this ), "_frame" );
}
/** Set the playing speed.
int mlt_producer_set_speed( mlt_producer this, double speed )
{
- return mlt_properties_set_double( mlt_producer_properties( this ), "_speed", speed );
+ return mlt_properties_set_double( MLT_PRODUCER_PROPERTIES( this ), "_speed", speed );
}
/** Get the playing speed.
double mlt_producer_get_speed( mlt_producer this )
{
- return mlt_properties_get_double( mlt_producer_properties( this ), "_speed" );
+ return mlt_properties_get_double( MLT_PRODUCER_PROPERTIES( this ), "_speed" );
}
/** Get the frames per second.
double mlt_producer_get_fps( mlt_producer this )
{
- return mlt_properties_get_double( mlt_producer_properties( this ), "fps" );
+ return mlt_properties_get_double( MLT_PRODUCER_PROPERTIES( this ), "fps" );
}
/** Set the in and out points.
int mlt_producer_set_in_and_out( mlt_producer this, mlt_position in, mlt_position out )
{
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Correct ins and outs if necessary
if ( in < 0 )
else if ( out >= mlt_producer_get_length( this ) && !mlt_producer_is_blank( this ) )
out = mlt_producer_get_length( this ) - 1;
else if ( out >= mlt_producer_get_length( this ) && mlt_producer_is_blank( this ) )
- mlt_properties_set_position( mlt_producer_properties( this ), "length", out + 1 );
+ mlt_properties_set_position( MLT_PRODUCER_PROPERTIES( this ), "length", out + 1 );
// Swap ins and outs if wrong
if ( out < in )
{
if ( this != NULL )
{
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
mlt_events_block( properties, properties );
mlt_properties_set_position( properties, "in", 0 );
mlt_events_unblock( properties, properties );
mlt_position mlt_producer_get_in( mlt_producer this )
{
- return mlt_properties_get_position( mlt_producer_properties( this ), "in" );
+ return mlt_properties_get_position( MLT_PRODUCER_PROPERTIES( this ), "in" );
}
/** Get the out point.
mlt_position mlt_producer_get_out( mlt_producer this )
{
- return mlt_properties_get_position( mlt_producer_properties( this ), "out" );
+ return mlt_properties_get_position( MLT_PRODUCER_PROPERTIES( this ), "out" );
}
/** Get the total play time.
mlt_position mlt_producer_get_length( mlt_producer this )
{
- return mlt_properties_get_position( mlt_producer_properties( this ), "length" );
+ return mlt_properties_get_position( MLT_PRODUCER_PROPERTIES( this ), "length" );
}
/** Prepare for next frame.
if ( this != NULL && !mlt_producer_is_cut( this ) )
{
// Get the properties of this producer
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Determine eof handling
- char *eof = mlt_properties_get( mlt_producer_properties( this ), "eof" );
+ char *eof = mlt_properties_get( MLT_PRODUCER_PROPERTIES( this ), "eof" );
// Get the speed of the producer
double speed = mlt_producer_get_speed( this );
result = mlt_frame_set_position( *frame, mlt_producer_position( this ) );
// Mark as a test card
- mlt_properties_set_int( mlt_frame_properties( *frame ), "test_image", 1 );
- mlt_properties_set_int( mlt_frame_properties( *frame ), "test_audio", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "test_image", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "test_audio", 1 );
// Calculate the next position
mlt_producer_prepare_next( this );
}
// Copy the fps and speed of the producer onto the frame
- properties = mlt_frame_properties( *frame );
+ properties = MLT_FRAME_PROPERTIES( *frame );
mlt_properties_set_double( properties, "_speed", speed );
mlt_properties_set_double( properties, "fps", mlt_producer_get_fps( this ) );
mlt_properties_set_int( properties, "test_audio", mlt_frame_is_test_audio( *frame ) );
mlt_producer parent = mlt_producer_cut_parent( this );
// Get the properties of the parent
- mlt_properties parent_properties = mlt_producer_properties( parent );
+ mlt_properties parent_properties = MLT_PRODUCER_PROPERTIES( parent );
// Get the properties of the cut
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Determine the clone index
int clone_index = mlt_properties_get_int( properties, "_clone" );
{
char key[ 25 ];
sprintf( key, "_clone.%d", clone_index - 1 );
- clone = mlt_properties_get_data( mlt_producer_properties( mlt_producer_cut_parent( this ) ), key, NULL );
+ clone = mlt_properties_get_data( MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( this ) ), key, NULL );
if ( clone == NULL ) fprintf( stderr, "requested clone doesn't exist %d\n", clone_index );
clone = clone == NULL ? this : clone;
}
mlt_properties_set_data( parent_properties, "use_clone", clone, 0, NULL, NULL );
// Now get the frame from the parents service
- result = mlt_service_get_frame( mlt_producer_service( parent ), frame, index );
+ result = mlt_service_get_frame( MLT_PRODUCER_SERVICE( parent ), frame, index );
// We're done with the clone now
mlt_properties_set_data( parent_properties, "use_clone", NULL, 0, NULL, NULL );
- mlt_properties_set_double( mlt_frame_properties( *frame ), "_speed", speed );
+ mlt_properties_set_double( MLT_FRAME_PROPERTIES( *frame ), "_speed", speed );
mlt_producer_prepare_next( this );
}
else
result = 0;
}
+ // Pass on all meta properties from the producer/cut on to the frame
+ if ( *frame != NULL && this != NULL )
+ {
+ int i = 0;
+ mlt_properties p_props = MLT_PRODUCER_PROPERTIES( this );
+ mlt_properties f_props = MLT_FRAME_PROPERTIES( *frame );
+ int count = mlt_properties_count( p_props );
+ for ( i = 0; i < count; i ++ )
+ {
+ char *name = mlt_properties_get_name( p_props, i );
+ if ( !strncmp( name, "meta.", 5 ) )
+ mlt_properties_set( f_props, name, mlt_properties_get( p_props, name ) );
+ }
+ }
+
return result;
}
int mlt_producer_attach( mlt_producer this, mlt_filter filter )
{
- return mlt_service_attach( mlt_producer_service( this ), filter );
+ return mlt_service_attach( MLT_PRODUCER_SERVICE( this ), filter );
}
/** Detach a filter.
int mlt_producer_detach( mlt_producer this, mlt_filter filter )
{
- return mlt_service_detach( mlt_producer_service( this ), filter );
+ return mlt_service_detach( MLT_PRODUCER_SERVICE( this ), filter );
}
/** Retrieve a filter.
mlt_filter mlt_producer_filter( mlt_producer this, int index )
{
- return mlt_service_filter( mlt_producer_service( this ), index );
+ return mlt_service_filter( MLT_PRODUCER_SERVICE( this ), index );
}
/** Clone this producer.
static mlt_producer mlt_producer_clone( mlt_producer this )
{
mlt_producer clone = NULL;
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
char *resource = mlt_properties_get( properties, "resource" );
char *service = mlt_properties_get( properties, "mlt_service" );
clone = mlt_factory_producer( "fezzik", resource );
if ( clone != NULL )
- mlt_properties_inherit( mlt_producer_properties( clone ), properties );
+ mlt_properties_inherit( MLT_PRODUCER_PROPERTIES( clone ), properties );
mlt_events_unblock( mlt_factory_event_object( ), mlt_factory_event_object( ) );
static void mlt_producer_set_clones( mlt_producer this, int clones )
{
mlt_producer parent = mlt_producer_cut_parent( this );
- mlt_properties properties = mlt_producer_properties( parent );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( parent );
int existing = mlt_properties_get_int( properties, "_clones" );
int i = 0;
char key[ 25 ];
sprintf( key, "_clone.%d", i );
clone = mlt_properties_get_data( properties, key, NULL );
if ( clone != NULL )
- mlt_properties_pass( mlt_producer_properties( clone ), properties, "" );
+ mlt_properties_pass( MLT_PRODUCER_PROPERTIES( clone ), properties, "" );
}
// Update the number of clones on the properties
refs = malloc( ( ref_count + 1 ) * sizeof( clip_references ) );
if ( old_refs != NULL )
memcpy( refs, old_refs, ref_count * sizeof( clip_references ) );
- mlt_properties_set_int( mlt_producer_properties( object ), "_clone", -1 );
+ mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( object ), "_clone", -1 );
refs[ ref_count ].cut = object;
refs[ ref_count ].start = info->position;
refs[ ref_count ].end = info->position + mlt_producer_get_playtime( object ) - 1;
parser->on_start_multitrack = on_start_multitrack;
parser->on_end_multitrack = on_end_multitrack;
push( parser, 0, 0, 0 );
- mlt_parser_start( parser, mlt_producer_service( this ) );
+ mlt_parser_start( parser, MLT_PRODUCER_SERVICE( this ) );
free( pop( parser ) );
for ( k = 0; k < mlt_properties_count( producers ); k ++ )
{
if ( intersect( &refs[ i ], &refs[ j ] ) )
{
clones ++;
- mlt_properties_set_int( mlt_producer_properties( refs[ j ].cut ), "_clone", clones );
+ mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( refs[ j ].cut ), "_clone", clones );
}
}
if ( clones > max_clones )
for ( i = 0; i < count; i ++ )
{
mlt_producer cut = refs[ i ].cut;
- if ( mlt_properties_get_int( mlt_producer_properties( cut ), "_clone" ) == -1 )
- mlt_properties_set_int( mlt_producer_properties( cut ), "_clone", 0 );
+ if ( mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( cut ), "_clone" ) == -1 )
+ mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( cut ), "_clone", 0 );
}
mlt_producer_set_clones( producer, max_clones );
for ( i = 0; i < count; i ++ )
{
mlt_producer cut = refs[ i ].cut;
- mlt_properties_set_int( mlt_producer_properties( cut ), "_clone", 0 );
+ mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( cut ), "_clone", 0 );
}
mlt_producer_set_clones( producer, 0 );
}
void mlt_producer_close( mlt_producer this )
{
- if ( this != NULL && mlt_properties_dec_ref( mlt_producer_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_PRODUCER_PROPERTIES( this ) ) <= 0 )
{
this->parent.close = NULL;
if ( this->close != NULL )
+ {
this->close( this->close_object );
+ }
else
+ {
+#if _MLT_PRODUCER_CHECKS_ == 1
+ // Show debug info
+ mlt_properties_debug( MLT_PRODUCER_PROPERTIES( this ), "Producer closing", stderr );
+#endif
+
+#ifdef _MLT_PRODUCER_CHECKS_
+ // Increment destroyed count
+ producers_destroyed ++;
+
+ // Show current stats - these should match when the app is closed
+ fprintf( stderr, "Producers created %d, destroyed %d\n", producers_created, producers_destroyed );
+#endif
+
mlt_service_close( &this->parent );
+ }
}
}
/** Public final methods
*/
+#define MLT_PRODUCER_SERVICE( producer ) ( &( producer )->parent )
+#define MLT_PRODUCER_PROPERTIES( producer ) MLT_SERVICE_PROPERTIES( MLT_PRODUCER_SERVICE( producer ) )
+
extern int mlt_producer_init( mlt_producer self, void *child );
extern mlt_producer mlt_producer_new( );
extern mlt_service mlt_producer_service( mlt_producer self );
/** Memory leak checks.
*/
-//#define _MLT_PROPERTY_CHECKS_
+//#define _MLT_PROPERTY_CHECKS_ 2
#ifdef _MLT_PROPERTY_CHECKS_
static int properties_created = 0;
property_list *list = this->local;
int index = 0;
-#ifdef _MLT_PROPERTY_CHECKS_
+#if _MLT_PROPERTY_CHECKS_ == 1
// Show debug info
mlt_properties_debug( this, "Closing", stderr );
+#endif
+#ifdef _MLT_PROPERTY_CHECKS_
// Increment destroyed count
properties_destroyed ++;
{
this->types |= mlt_prop_string;
this->prop_string = malloc( 32 );
- sprintf( this->prop_string, "%e", this->prop_double );
+ sprintf( this->prop_string, "%f", this->prop_double );
}
else if ( this->types & mlt_prop_position )
{
mlt_service_type type = invalid_type;
if ( this != NULL )
{
- mlt_properties properties = mlt_service_properties( this );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( this );
char *mlt_type = mlt_properties_get( properties, "mlt_type" );
char *resource = mlt_properties_get( properties, "resource" );
if ( mlt_type == NULL )
if ( producer != NULL )
{
mlt_service_lock( producer );
- mlt_properties_inc_ref( mlt_service_properties( producer ) );
+ mlt_properties_inc_ref( MLT_SERVICE_PROPERTIES( producer ) );
mlt_service_unlock( producer );
}
void mlt_service_apply_filters( mlt_service this, mlt_frame frame, int index )
{
int i;
- mlt_properties frame_properties = mlt_frame_properties( frame );
- mlt_properties service_properties = mlt_service_properties( this );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
+ mlt_properties service_properties = MLT_SERVICE_PROPERTIES( this );
mlt_service_base *base = this->local;
mlt_position position = mlt_frame_get_position( frame );
mlt_position this_in = mlt_properties_get_position( service_properties, "in" );
mlt_properties_set_position( frame_properties, "in", in == 0 ? this_in : in );
mlt_properties_set_position( frame_properties, "out", out == 0 ? this_out : out );
mlt_filter_process( base->filters[ i ], frame );
- mlt_service_apply_filters( mlt_filter_service( base->filters[ i ] ), frame, index + 1 );
+ mlt_service_apply_filters( MLT_FILTER_SERVICE( base->filters[ i ] ), frame, index + 1 );
}
}
}
mlt_service_lock( this );
if ( this != NULL && this->get_frame != NULL )
{
- char uniq[ 20 ];
int result = 0;
- mlt_properties properties = mlt_service_properties( this );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( this );
mlt_position in = mlt_properties_get_position( properties, "in" );
mlt_position out = mlt_properties_get_position( properties, "out" );
mlt_properties_inc_ref( properties );
result = this->get_frame( this, frame, index );
if ( result == 0 )
{
- properties = mlt_frame_properties( *frame );
+ properties = MLT_FRAME_PROPERTIES( *frame );
if ( in >=0 && out > 0 )
{
mlt_properties_set_position( properties, "in", in );
mlt_properties_set_position( properties, "out", out );
}
mlt_service_apply_filters( this, *frame, 1 );
- sprintf( uniq, "gf_%p", this );
- if ( mlt_properties_get_data( properties, uniq, NULL ) != NULL )
- fprintf( stderr, "%s is not unique in this frame\n", uniq );
- mlt_properties_set_data( properties, uniq, this, 0, ( mlt_destructor )mlt_service_close, NULL );
+ mlt_deque_push_back( MLT_FRAME_SERVICE_STACK( *frame ), this );
}
else
{
static void mlt_service_filter_changed( mlt_service owner, mlt_service this )
{
- mlt_events_fire( mlt_service_properties( this ), "service-changed", NULL );
+ mlt_events_fire( MLT_SERVICE_PROPERTIES( this ), "service-changed", NULL );
}
/** Attach a filter.
if ( error == 0 )
{
int i = 0;
- mlt_properties properties = mlt_service_properties( this );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( this );
mlt_service_base *base = this->local;
for ( i = 0; error == 0 && i < base->filter_count; i ++ )
if ( base->filters != NULL )
{
- mlt_properties props = mlt_filter_properties( filter );
- mlt_properties_inc_ref( mlt_filter_properties( filter ) );
+ mlt_properties props = MLT_FILTER_PROPERTIES( filter );
+ mlt_properties_inc_ref( MLT_FILTER_PROPERTIES( filter ) );
base->filters[ base->filter_count ++ ] = filter;
mlt_events_fire( properties, "service-changed", NULL );
mlt_events_listen( props, this, "service-changed", ( mlt_listener )mlt_service_filter_changed );
{
int i = 0;
mlt_service_base *base = this->local;
- mlt_properties properties = mlt_service_properties( this );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( this );
for ( i = 0; i < base->filter_count; i ++ )
if ( base->filters[ i ] == filter )
for ( i ++ ; i < base->filter_count; i ++ )
base->filters[ i - 1 ] = base->filters[ i ];
base->filter_count --;
- mlt_events_disconnect( mlt_filter_properties( filter ), this );
+ mlt_events_disconnect( MLT_FILTER_PROPERTIES( filter ), this );
mlt_filter_close( filter );
mlt_events_fire( properties, "service-changed", NULL );
}
void mlt_service_close( mlt_service this )
{
mlt_service_lock( this );
- if ( this != NULL && mlt_properties_dec_ref( mlt_service_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_SERVICE_PROPERTIES( this ) ) <= 0 )
{
mlt_service_unlock( this );
if ( this->close != NULL )
mlt_service_base *base = this->local;
int i = 0;
int count = base->filter_count;
- mlt_events_block( mlt_service_properties( this ), this );
+ mlt_events_block( MLT_SERVICE_PROPERTIES( this ), this );
while( count -- )
mlt_service_detach( this, base->filters[ 0 ] );
free( base->filters );
/** The public API.
*/
+#define MLT_SERVICE_PROPERTIES( service ) ( &( service )->parent )
+
extern int mlt_service_init( mlt_service self, void *child );
extern void mlt_service_lock( mlt_service self );
extern void mlt_service_unlock( mlt_service self );
#include <stdlib.h>
#include <string.h>
-/** Private structure.
-*/
-
-struct mlt_tractor_s
-{
- struct mlt_producer_s parent;
- mlt_service producer;
-};
-
/** Forward references to static methods.
*/
mlt_producer producer = &this->parent;
if ( mlt_producer_init( producer, this ) == 0 )
{
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
mlt_properties_set( properties, "resource", "<tractor>" );
mlt_properties_set( properties, "mlt_type", "mlt_producer" );
{
mlt_multitrack multitrack = mlt_multitrack_init( );
mlt_field field = mlt_field_new( multitrack, this );
- mlt_properties props = mlt_producer_properties( producer );
+ mlt_properties props = MLT_PRODUCER_PROPERTIES( producer );
mlt_properties_set( props, "resource", "<tractor>" );
mlt_properties_set( props, "mlt_type", "mlt_producer" );
mlt_properties_set_data( props, "multitrack", multitrack, 0, ( mlt_destructor )mlt_multitrack_close, NULL );
mlt_properties_set_data( props, "field", field, 0, ( mlt_destructor )mlt_field_close, NULL );
- mlt_events_listen( mlt_multitrack_properties( multitrack ), this, "producer-changed", ( mlt_listener )mlt_tractor_listener );
+ mlt_events_listen( MLT_MULTITRACK_PROPERTIES( multitrack ), this, "producer-changed", ( mlt_listener )mlt_tractor_listener );
producer->get_frame = producer_get_frame;
producer->close = ( mlt_destructor )mlt_tractor_close;
mlt_service mlt_tractor_service( mlt_tractor this )
{
- return mlt_producer_service( &this->parent );
+ return MLT_PRODUCER_SERVICE( &this->parent );
}
/** Get the producer object associated to the tractor.
mlt_properties mlt_tractor_properties( mlt_tractor this )
{
- return mlt_producer_properties( &this->parent );
+ return MLT_PRODUCER_PROPERTIES( &this->parent );
}
/** Get the field this tractor is harvesting.
mlt_field mlt_tractor_field( mlt_tractor this )
{
- return mlt_properties_get_data( mlt_tractor_properties( this ), "field", NULL );
+ return mlt_properties_get_data( MLT_TRACTOR_PROPERTIES( this ), "field", NULL );
}
/** Get the multitrack this tractor is pulling.
mlt_multitrack mlt_tractor_multitrack( mlt_tractor this )
{
- return mlt_properties_get_data( mlt_tractor_properties( this ), "multitrack", NULL );
+ return mlt_properties_get_data( MLT_TRACTOR_PROPERTIES( this ), "multitrack", NULL );
}
/** Ensure the tractors in/out points match the multitrack.
void mlt_tractor_refresh( mlt_tractor this )
{
mlt_multitrack multitrack = mlt_tractor_multitrack( this );
- mlt_properties properties = mlt_multitrack_properties( multitrack );
- mlt_properties self = mlt_tractor_properties( this );
+ mlt_properties properties = MLT_MULTITRACK_PROPERTIES( multitrack );
+ mlt_properties self = MLT_TRACTOR_PROPERTIES( this );
mlt_events_block( properties, self );
mlt_events_block( self, self );
mlt_multitrack_refresh( multitrack );
int mlt_tractor_connect( mlt_tractor this, mlt_service producer )
{
- int ret = mlt_service_connect_producer( mlt_tractor_service( this ), producer, 0 );
+ int ret = mlt_service_connect_producer( MLT_TRACTOR_SERVICE( this ), producer, 0 );
// This is the producer we're going to connect to
if ( ret == 0 )
static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
uint8_t *data = NULL;
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
mlt_frame frame = mlt_frame_pop_service( this );
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
mlt_properties_set_int( frame_properties, "width", mlt_properties_get_int( properties, "width" ) );
mlt_properties_set_int( frame_properties, "height", mlt_properties_get_int( properties, "height" ) );
mlt_properties_set( frame_properties, "rescale.interp", mlt_properties_get( properties, "rescale.interp" ) );
static int producer_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
mlt_frame frame = mlt_frame_pop_audio( this );
mlt_frame_get_audio( frame, buffer, format, frequency, channels, samples );
mlt_properties_set_data( properties, "audio", *buffer, 0, NULL, NULL );
int count = 0;
// Get the properties of the parent producer
- mlt_properties properties = mlt_producer_properties( parent );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( parent );
// Try to obtain the multitrack associated to the tractor
mlt_multitrack multitrack = mlt_properties_get_data( properties, "multitrack", NULL );
mlt_properties temp_properties = NULL;
// Get the multitrack's producer
- mlt_producer target = mlt_multitrack_producer( multitrack );
+ mlt_producer target = MLT_MULTITRACK_PRODUCER( multitrack );
mlt_producer_seek( target, mlt_producer_frame( parent ) );
mlt_producer_set_speed( target, mlt_producer_get_speed( parent ) );
*frame = mlt_frame_init( );
// Get the properties of the frame
- frame_properties = mlt_frame_properties( *frame );
+ frame_properties = MLT_FRAME_PROPERTIES( *frame );
// Loop through each of the tracks we're harvesting
for ( i = 0; !done; i ++ )
mlt_service_get_frame( this->producer, &temp, i );
// Get the temporary properties
- temp_properties = mlt_frame_properties( temp );
+ temp_properties = MLT_FRAME_PROPERTIES( temp );
// Check for last track
done = mlt_properties_get_int( temp_properties, "last_track" );
mlt_properties_set_data( frame_properties, label, temp, 0, ( mlt_destructor )mlt_frame_close, NULL );
// We want the last data_queue
- if ( !done && mlt_properties_get_data( temp_properties, "data_queue", NULL ) != NULL )
- data_queue = mlt_properties_get_data( mlt_frame_properties( temp ), "data_queue", NULL );
+ if ( !done && mlt_properties_get_data( temp_properties, "data_queue", NULL ) != NULL &&
+ mlt_deque_count( mlt_properties_get_data( temp_properties, "data_queue", NULL ) ) != 0 )
+ data_queue = mlt_properties_get_data( MLT_FRAME_PROPERTIES( temp ), "data_queue", NULL );
// Pick up first video and audio frames
if ( !done && !mlt_frame_is_test_audio( temp ) && !( mlt_properties_get_int( temp_properties, "hide" ) & 2 ) )
if ( video != NULL )
{
- mlt_properties video_properties = mlt_frame_properties( video );
+ mlt_properties video_properties = MLT_FRAME_PROPERTIES( video );
mlt_frame_push_service( *frame, video );
mlt_frame_push_service( *frame, producer_get_image );
mlt_properties_set_data( frame_properties, "data_queue", data_queue, 0, NULL, NULL );
}
mlt_frame_set_position( *frame, mlt_producer_frame( parent ) );
- mlt_properties_set_int( mlt_frame_properties( *frame ), "test_audio", audio == NULL );
- mlt_properties_set_int( mlt_frame_properties( *frame ), "test_image", video == NULL );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "test_audio", audio == NULL );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "test_image", video == NULL );
}
else if ( producer != NULL )
{
void mlt_tractor_close( mlt_tractor this )
{
- if ( this != NULL && mlt_properties_dec_ref( mlt_tractor_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_TRACTOR_PROPERTIES( this ) ) <= 0 )
{
this->parent.close = NULL;
mlt_producer_close( &this->parent );
#include "mlt_producer.h"
+/** Private structure.
+*/
+
+struct mlt_tractor_s
+{
+ struct mlt_producer_s parent;
+ mlt_service producer;
+};
+
+#define MLT_TRACTOR_PRODUCER( tractor ) ( &( tractor )->parent )
+#define MLT_TRACTOR_SERVICE( tractor ) MLT_PRODUCER_SERVICE( MLT_TRACTOR_PRODUCER( tractor ) )
+#define MLT_TRACTOR_PROPERTIES( tractor ) MLT_SERVICE_PROPERTIES( MLT_TRACTOR_SERVICE( tractor ) )
+
extern mlt_tractor mlt_tractor_init( );
extern mlt_tractor mlt_tractor_new( );
extern mlt_service mlt_tractor_service( mlt_tractor self );
this->child = child;
if ( mlt_service_init( service, this ) == 0 )
{
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
service->get_frame = transition_get_frame;
service->close = ( mlt_destructor )mlt_transition_close;
mlt_properties mlt_transition_properties( mlt_transition this )
{
- return mlt_service_properties( mlt_transition_service( this ) );
+ return MLT_TRANSITION_PROPERTIES( this );
}
/** Connect this transition with a producers a and b tracks.
int ret = mlt_service_connect_producer( &this->parent, producer, a_track );
if ( ret == 0 )
{
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
this->producer = producer;
mlt_properties_set_int( properties, "a_track", a_track );
mlt_properties_set_int( properties, "b_track", b_track );
void mlt_transition_set_in_and_out( mlt_transition this, mlt_position in, mlt_position out )
{
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
mlt_properties_set_position( properties, "in", in );
mlt_properties_set_position( properties, "out", out );
}
int mlt_transition_get_a_track( mlt_transition this )
{
- return mlt_properties_get_int( mlt_transition_properties( this ), "a_track" );
+ return mlt_properties_get_int( MLT_TRANSITION_PROPERTIES( this ), "a_track" );
}
/** Get the index of the b track.
int mlt_transition_get_b_track( mlt_transition this )
{
- return mlt_properties_get_int( mlt_transition_properties( this ), "b_track" );
+ return mlt_properties_get_int( MLT_TRANSITION_PROPERTIES( this ), "b_track" );
}
/** Get the in point.
mlt_position mlt_transition_get_in( mlt_transition this )
{
- return mlt_properties_get_position( mlt_transition_properties( this ), "in" );
+ return mlt_properties_get_position( MLT_TRANSITION_PROPERTIES( this ), "in" );
}
/** Get the out point.
mlt_position mlt_transition_get_out( mlt_transition this )
{
- return mlt_properties_get_position( mlt_transition_properties( this ), "out" );
+ return mlt_properties_get_position( MLT_TRANSITION_PROPERTIES( this ), "out" );
}
/** Process the frame.
{
mlt_transition this = service->child;
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
int accepts_blanks = mlt_properties_get_int( properties, "_accepts_blanks" );
int a_track = mlt_properties_get_int( properties, "a_track" );
{
int hide = 0;
*frame = mlt_transition_process( this, this->a_frame, this->b_frame );
- if ( !mlt_properties_get_int( mlt_frame_properties( this->a_frame ), "test_image" ) )
+ if ( !mlt_properties_get_int( MLT_FRAME_PROPERTIES( this->a_frame ), "test_image" ) )
hide = 1;
- if ( !mlt_properties_get_int( mlt_frame_properties( this->a_frame ), "test_audio" ) )
+ if ( !mlt_properties_get_int( MLT_FRAME_PROPERTIES( this->a_frame ), "test_audio" ) )
hide |= 2;
- mlt_properties_set_int( mlt_frame_properties( this->b_frame ), "hide", hide );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( this->b_frame ), "hide", hide );
}
this->a_held = 0;
}
void mlt_transition_close( mlt_transition this )
{
- if ( this != NULL && mlt_properties_dec_ref( mlt_transition_properties( this ) ) <= 0 )
+ if ( this != NULL && mlt_properties_dec_ref( MLT_TRANSITION_PROPERTIES( this ) ) <= 0 )
{
this->parent.close = NULL;
if ( this->close != NULL )
/** Public final methods
*/
+#define MLT_TRANSITION_SERVICE( transition ) ( &( transition )->parent )
+#define MLT_TRANSITION_PROPERTIES( transition ) MLT_SERVICE_PROPERTIES( MLT_TRANSITION_SERVICE( transition ) )
+
extern int mlt_transition_init( mlt_transition self, void *child );
extern mlt_transition mlt_transition_new( );
extern mlt_service mlt_transition_service( mlt_transition self );
typedef struct mlt_event_struct *mlt_event;
typedef struct mlt_service_s *mlt_service;
typedef struct mlt_producer_s *mlt_producer;
-typedef struct mlt_manager_s *mlt_manager;
typedef struct mlt_playlist_s *mlt_playlist;
typedef struct mlt_multitrack_s *mlt_multitrack;
typedef struct mlt_filter_s *mlt_filter;
static void transport_action( mlt_producer producer, char *value )
{
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
mlt_multitrack multitrack = mlt_properties_get_data( properties, "multitrack", NULL );
mlt_properties_set_int( properties, "stats_off", 0 );
mlt_consumer consumer = mlt_factory_consumer( id, arg );
if ( consumer != NULL )
{
- mlt_properties properties = mlt_consumer_properties( consumer );
+ 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 );
}
static void transport( mlt_producer producer, mlt_consumer consumer )
{
- mlt_properties properties = mlt_producer_properties( producer );
- int silent = mlt_properties_get_int( mlt_consumer_properties( consumer ), "silent" );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
+ int silent = mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "silent" );
struct timespec tm = { 0, 40000 };
if ( mlt_properties_get_int( properties, "done" ) == 0 && !mlt_consumer_is_stopped( consumer ) )
if ( argc > 1 && inigo != NULL && mlt_producer_get_length( inigo ) > 0 )
{
// Get inigo's properties
- mlt_properties inigo_props = mlt_producer_properties( inigo );
+ mlt_properties inigo_props = MLT_PRODUCER_PROPERTIES( inigo );
// Get the last group
mlt_properties group = mlt_properties_get_data( inigo_props, "group", 0 );
if ( consumer != NULL && store == NULL )
{
// Apply group settings
- mlt_properties properties = mlt_consumer_properties( consumer );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
mlt_properties_inherit( properties, group );
// Connect consumer to inigo
- mlt_consumer_connect( consumer, mlt_producer_service( inigo ) );
+ mlt_consumer_connect( consumer, MLT_PRODUCER_SERVICE( inigo ) );
// Start the consumer
mlt_consumer_start( consumer );
mlt_properties_set( this->properties, "arg", arg );
mlt_properties_set_data( this->properties, "consumer", consumer, 0, ( mlt_destructor )mlt_consumer_close, NULL );
mlt_properties_set_data( this->properties, "playlist", playlist, 0, ( mlt_destructor )mlt_playlist_close, NULL );
- mlt_consumer_connect( consumer, mlt_playlist_service( playlist ) );
+ mlt_consumer_connect( consumer, MLT_PLAYLIST_SERVICE( playlist ) );
}
return this;
{
mlt_properties properties = this->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_properties playlist_properties = mlt_playlist_properties( playlist );
+ mlt_properties playlist_properties = MLT_PLAYLIST_PROPERTIES( playlist );
mlt_properties_set( properties, "root", root_dir );
mlt_properties_set_data( properties, "notifier", notifier, 0, NULL, NULL );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_producer producer = MLT_PLAYLIST_PRODUCER( playlist );
mlt_playlist_clear( unit->old_playlist );
copy_playlist( unit->old_playlist, playlist );
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
mlt_playlist_clip_info info;
int current = mlt_playlist_current_clip( playlist );
- mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_producer producer = MLT_PLAYLIST_PRODUCER( playlist );
mlt_position position = mlt_producer_frame( producer );
double speed = mlt_producer_get_speed( producer );
mlt_playlist_get_clip_info( playlist, &info, current );
if ( info.producer != NULL )
{
- mlt_properties_inc_ref( mlt_producer_properties( info.producer ) );
+ mlt_properties_inc_ref( MLT_PRODUCER_PROPERTIES( info.producer ) );
position -= info.start;
clear_unit( unit );
mlt_playlist_append_io( playlist, info.producer, info.frame_in, info.frame_out );
mlt_playlist_clip_info info;
char *title;
mlt_playlist_get_clip_info( playlist , &info, i );
- title = mlt_properties_get( mlt_producer_properties( info.producer ), "title" );
+ title = mlt_properties_get( MLT_PRODUCER_PROPERTIES( info.producer ), "title" );
if ( title == NULL )
title = strip_root( unit, info.resource );
valerie_response_printf( response, 10240, "%d \"%s\" %d %d %d %d %.2f\n",
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_producer producer = MLT_PLAYLIST_PRODUCER( playlist );
mlt_consumer consumer = mlt_properties_get_data( unit->properties, "consumer", NULL );
mlt_producer_set_speed( producer, ( double )speed / 1000 );
mlt_consumer_start( consumer );
{
mlt_consumer consumer = mlt_properties_get_data( unit->properties, "consumer", NULL );
mlt_playlist playlist = mlt_properties_get_data( unit->properties, "playlist", NULL );
- mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_producer producer = MLT_PLAYLIST_PRODUCER( playlist );
mlt_producer_set_speed( producer, 0 );
mlt_consumer_stop( consumer );
miracle_unit_status_communicate( unit );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_producer producer = MLT_PLAYLIST_PRODUCER( playlist );
mlt_producer clip = mlt_playlist_current( playlist );
mlt_playlist_clip_info info;
if ( info.resource != NULL && strcmp( info.resource, "" ) )
{
- char *title = mlt_properties_get( mlt_producer_properties( info.producer ), "title" );
+ char *title = mlt_properties_get( MLT_PRODUCER_PROPERTIES( info.producer ), "title" );
if ( title == NULL )
title = strip_root( unit, info.resource );
strncpy( status->clip, title, sizeof( status->clip ) );
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_producer producer = MLT_PLAYLIST_PRODUCER( playlist );
mlt_playlist_clip_info info;
if ( clip < 0 )
{
mlt_properties properties = unit->properties;
mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
- mlt_producer producer = mlt_playlist_producer( playlist );
+ mlt_producer producer = MLT_PLAYLIST_PRODUCER( playlist );
mlt_position position = mlt_producer_frame( producer );
mlt_producer_seek( producer, position + offset );
}
if ( strncmp( name_value, "consumer.", 9 ) )
{
mlt_playlist playlist = mlt_properties_get_data( unit->properties, "playlist", NULL );
- properties = mlt_playlist_properties( playlist );
+ properties = MLT_PLAYLIST_PROPERTIES( playlist );
}
else
{
mlt_consumer consumer = mlt_properties_get_data( unit->properties, "consumer", NULL );
- properties = mlt_consumer_properties( consumer );
+ properties = MLT_CONSUMER_PROPERTIES( consumer );
name_value += 9;
}
char *miracle_unit_get( miracle_unit unit, char *name )
{
mlt_playlist playlist = mlt_properties_get_data( unit->properties, "playlist", NULL );
- mlt_properties properties = mlt_playlist_properties( playlist );
+ mlt_properties properties = MLT_PLAYLIST_PROPERTIES( playlist );
return mlt_properties_get( properties, name );
}
miracle_unit unit = miracle_get_unit(cmd_arg->unit);
if ( unit != NULL && producer != NULL )
{
- if ( miracle_unit_append_service( unit, mlt_producer_service( producer ) ) == valerie_ok )
+ if ( miracle_unit_append_service( unit, MLT_PRODUCER_SERVICE( producer ) ) == valerie_ok )
{
mlt_producer_close( producer );
return RESPONSE_SUCCESS;
if ( this != NULL )
{
// Get properties from the consumer
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Assign close callback
this->close = consumer_close;
static int consumer_start( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Check that we're not already running
if ( !mlt_properties_get_int( properties, "running" ) )
static int consumer_stop( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Check that we're running
if ( mlt_properties_get_int( properties, "running" ) )
static int consumer_is_stopped( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
return !mlt_properties_get_int( properties, "running" );
}
static AVStream *add_audio_stream( mlt_consumer this, AVFormatContext *oc, int codec_id )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Create a new stream
AVStream *st = av_new_stream( oc, 1 );
static AVStream *add_video_stream( mlt_consumer this, AVFormatContext *oc, int codec_id )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Create a new stream
AVStream *st = av_new_stream( oc, 0 );
mlt_consumer this = arg;
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Get the terminate on pause property
int terminate_on_pause = mlt_properties_get_int( properties, "terminate_on_pause" );
frames ++;
// Default audio args
- frame_properties = mlt_frame_properties( frame );
+ frame_properties = MLT_FRAME_PROPERTIES( frame );
// Check for the terminated condition
terminated = terminate_on_pause && mlt_properties_get_double( frame_properties, "_speed" ) == 0.0;
AVCodecContext *c;
frame = mlt_deque_pop_front( queue );
- frame_properties = mlt_frame_properties( frame );
+ frame_properties = MLT_FRAME_PROPERTIES( frame );
c = &video_st->codec;
// This will cause some fx to go awry....
if ( mlt_properties_get_int( properties, "transcode" ) )
{
- mlt_properties_set_int( mlt_frame_properties( frame ), "normalised_width", img_height * 4.0 / 3.0 );
- mlt_properties_set_int( mlt_frame_properties( frame ), "normalised_height", img_height );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "normalised_width", img_height * 4.0 / 3.0 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "normalised_height", img_height );
}
mlt_frame_get_image( frame, &image, &img_fmt, &img_width, &img_height, 0 );
static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
{
mlt_filter filter = mlt_frame_pop_service( this );
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
int output_format = *format;
- mlt_image_format forced = mlt_properties_get_int( mlt_filter_properties( filter ), "forced" );
+ mlt_image_format forced = mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "forced" );
int error = 0;
// Allow this filter to force processing in a colour space other than requested
// Check that we want progressive and we aren't already progressive
if ( *format == mlt_image_yuv422 &&
- !mlt_properties_get_int( mlt_frame_properties( this ), "progressive" ) &&
- mlt_properties_get_int( mlt_frame_properties( this ), "consumer_deinterlace" ) )
+ !mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "progressive" ) &&
+ mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "consumer_deinterlace" ) )
{
// Create a picture
AVPicture *output = mlt_pool_alloc( sizeof( AVPicture ) );
mlt_pool_release( output );
// Make sure that others know the frame is deinterlaced
- mlt_properties_set_int( mlt_frame_properties( this ), "progressive", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( this ), "progressive", 1 );
}
else
{
static int resample_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties of the frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Get the filter service
mlt_filter filter = mlt_frame_pop_audio( frame );
// Get the filter properties
- mlt_properties filter_properties = mlt_filter_properties( filter );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
// Get the resample information
int output_rate = mlt_properties_get_int( filter_properties, "frequency" );
// Deal with argument
if ( arg != NULL )
- mlt_properties_set( mlt_filter_properties( this ), "frequency", arg );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "frequency", arg );
// Default to 2 channel output
- mlt_properties_set_int( mlt_filter_properties( this ), "channels", 2 );
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES( this ), "channels", 2 );
// Store the buffer
- mlt_properties_set_data( mlt_filter_properties( this ), "buffer", buffer, size, mlt_pool_release, NULL );
+ mlt_properties_set_data( MLT_FILTER_PROPERTIES( this ), "buffer", buffer, size, mlt_pool_release, NULL );
}
return this;
if ( mlt_producer_init( this, NULL ) == 0 )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Set the resource property (required for all producers)
mlt_properties_set( properties, "resource", file );
AVFormatContext *context = NULL;
// Get the properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// We will treat everything with the producer fps
double fps = mlt_properties_get_double( properties, "fps" );
static double producer_time_of_frame( mlt_producer this, mlt_position position )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Obtain the fps
double fps = mlt_properties_get_double( properties, "fps" );
static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
// Get the properties from the frame
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Obtain the frame number of this frame
mlt_position position = mlt_properties_get_position( frame_properties, "avformat_position" );
mlt_producer this = mlt_properties_get_data( frame_properties, "avformat_producer", NULL );
// Get the producer properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Fetch the video_context
AVFormatContext *context = mlt_properties_get_data( properties, "video_context", NULL );
static void producer_set_up_video( mlt_producer this, mlt_frame frame )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Fetch the video_context
AVFormatContext *context = mlt_properties_get_data( properties, "video_context", NULL );
int index = mlt_properties_get_int( properties, "video_index" );
// Get the frame properties
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
if ( context != NULL && index != -1 )
{
static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties from the frame
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Obtain the frame number of this frame
mlt_position position = mlt_properties_get_position( frame_properties, "avformat_position" );
mlt_producer this = mlt_properties_get_data( frame_properties, "avformat_producer", NULL );
// Get the producer properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Fetch the audio_context
AVFormatContext *context = mlt_properties_get_data( properties, "audio_context", NULL );
static void producer_set_up_audio( mlt_producer this, mlt_frame frame )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Fetch the audio_context
AVFormatContext *context = mlt_properties_get_data( properties, "audio_context", NULL );
if ( context != NULL && index != -1 )
{
// Get the frame properties
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Get the audio stream
AVStream *stream = context->streams[ index ];
mlt_frame_set_position( *frame, mlt_producer_position( this ) );
// Set the position of this producer
- mlt_properties_set_position( mlt_frame_properties( *frame ), "avformat_position", mlt_producer_frame( this ) );
+ mlt_properties_set_position( MLT_FRAME_PROPERTIES( *frame ), "avformat_position", mlt_producer_frame( this ) );
// Set up the video
producer_set_up_video( this, *frame );
producer_set_up_audio( this, *frame );
// Set the aspect_ratio
- mlt_properties_set_double( mlt_frame_properties( *frame ), "aspect_ratio", mlt_properties_get_double( mlt_producer_properties( this ), "aspect_ratio" ) );
+ mlt_properties_set_double( MLT_FRAME_PROPERTIES( *frame ), "aspect_ratio", mlt_properties_get_double( MLT_PRODUCER_PROPERTIES( this ), "aspect_ratio" ) );
// Calculate the next timecode
mlt_producer_prepare_next( this );
static int consumer_start( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Check that we're not already running
if ( !mlt_properties_get_int( properties, "running" ) )
static int consumer_stop( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Check that we're running
if ( mlt_properties_get_int( properties, "running" ) )
static int consumer_is_stopped( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
return !mlt_properties_get_int( properties, "running" );
}
mlt_consumer this = arg;
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Frame and size
mlt_frame frame = NULL;
if ( error == 0 && *format == mlt_image_yuv422 )
{
// Get the brightness level
- double level = mlt_properties_get_double( mlt_frame_properties( this ), "brightness" );
+ double level = mlt_properties_get_double( MLT_FRAME_PROPERTIES( this ), "brightness" );
// Only process if level is something other than 1
if ( level != 1.0 )
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
// Get the starting brightness level
- double level = fabs( mlt_properties_get_double( mlt_filter_properties( this ), "start" ) );
+ double level = fabs( mlt_properties_get_double( MLT_FILTER_PROPERTIES( this ), "start" ) );
// If there is an end adjust gain to the range
- if ( mlt_properties_get( mlt_filter_properties( this ), "end" ) != NULL )
+ if ( mlt_properties_get( MLT_FILTER_PROPERTIES( this ), "end" ) != NULL )
{
// Determine the time position of this frame in the transition duration
mlt_position in = mlt_filter_get_in( this );
mlt_position out = mlt_filter_get_out( this );
mlt_position time = mlt_frame_get_position( frame );
double position = ( double )( time - in ) / ( double )( out - in + 1 );
- double end = fabs( mlt_properties_get_double( mlt_filter_properties( this ), "end" ) );
+ double end = fabs( mlt_properties_get_double( MLT_FILTER_PROPERTIES( this ), "end" ) );
level += ( end - level ) * position;
}
// Push the frame filter
- mlt_properties_set_double( mlt_frame_properties( frame ), "brightness", level );
+ mlt_properties_set_double( MLT_FRAME_PROPERTIES( frame ), "brightness", level );
mlt_frame_push_get_image( frame, filter_get_image );
return frame;
if ( this != NULL )
{
this->process = filter_process;
- mlt_properties_set( mlt_filter_properties( this ), "start", arg == NULL ? "1" : arg );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "start", arg == NULL ? "1" : arg );
}
return this;
}
static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties of the a frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
int i, j;
int from = mlt_properties_get_int( properties, "channelcopy.from" );
int to = mlt_properties_get_int( properties, "channelcopy.to" );
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
- mlt_properties properties = mlt_filter_properties( this );
- mlt_properties frame_props = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
+ mlt_properties frame_props = MLT_FRAME_PROPERTIES( frame );
// Propogate the parameters
mlt_properties_set_int( frame_props, "channelcopy.to", mlt_properties_get_int( properties, "to" ) );
{
this->process = filter_process;
if ( arg != NULL )
- mlt_properties_set_int( mlt_filter_properties( this ), "to", atoi( arg ) );
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES( this ), "to", atoi( arg ) );
else
- mlt_properties_set_int( mlt_filter_properties( this ), "to", 1 );
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES( this ), "to", 1 );
}
return this;
}
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <stdlib.h>
+#include <string.h>
#include "filter_data.h"
#include <framework/mlt.h>
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
// Get the filter properties
- mlt_properties filter_properties = mlt_filter_properties( this );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( this );
// Get the frame properties
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Get the data queue
mlt_deque data_queue = mlt_properties_get_data( frame_properties, "data_queue", NULL );
+ // Get the type of the data feed
+ char *type = mlt_properties_get( filter_properties, "type" );
+
+ // Get the in and out points of this filter
+ int in = mlt_filter_get_in( this );
+ int out = mlt_filter_get_out( this );
+
// Create the data queue if it doesn't exist
if ( data_queue == NULL )
{
}
// Now create the data feed
- if ( data_queue != NULL )
+ if ( data_queue != NULL && type != NULL && !strcmp( type, "attr_check" ) )
+ {
+ int i = 0;
+ int count = mlt_properties_count( frame_properties );
+ char inactive[ 512 ];
+
+ for ( i = 0; i < count; i ++ )
+ {
+ char *name = mlt_properties_get_name( frame_properties, i );
+ if ( !strncmp( name, "meta.attr.", 10 ) && strstr( name, ".inactive" ) == NULL )
+ {
+ char *value = mlt_properties_get( frame_properties, name );
+ sprintf( inactive, "%s.inactive", name );
+ if ( value != NULL && mlt_properties_get_int( frame_properties, inactive ) == 0 )
+ {
+ // Create a new data feed
+ mlt_properties feed = mlt_properties_new( );
+
+ // Assign it the base properties
+ mlt_properties_set( feed, "id", mlt_properties_get( filter_properties, "_unique_id" ) );
+ mlt_properties_set( feed, "type", strrchr( name, '.' ) + 1 );
+ mlt_properties_set_position( feed, "position", mlt_frame_get_position( frame ) );
+
+ // Assign in/out of service we're connected to
+ mlt_properties_set_position( feed, "in", mlt_properties_get_position( frame_properties, "in" ) );
+ mlt_properties_set_position( feed, "out", mlt_properties_get_position( frame_properties, "out" ) );
+
+ // Assign the value to the feed
+ mlt_properties_set( feed, "markup", value );
+
+ // Push it on to the queue
+ mlt_deque_push_back( data_queue, feed );
+ }
+ }
+ }
+ }
+ else if ( data_queue != NULL )
{
- // Get the in and out points of this filter
- int in = mlt_filter_get_in( this );
- int out = mlt_filter_get_out( this );
-
// Create a new data feed
mlt_properties feed = mlt_properties_new( );
- // Get the type of the data feed
- char *type = mlt_properties_get( filter_properties, "type" );
-
// Assign it the base properties
mlt_properties_set( feed, "id", mlt_properties_get( filter_properties, "_unique_id" ) );
mlt_properties_set( feed, "type", type );
if ( this != NULL )
{
// Get the properties
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Assign the argument (default to titles)
mlt_properties_set( properties, "type", arg == NULL ? "titles" : arg );
int type_len = strlen( type );
// Get the properties of the data show filter
- mlt_properties filter_properties = mlt_filter_properties( filter );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
// Get the profile properties
mlt_properties profile_properties = mlt_properties_get_data( filter_properties, "profile_properties", NULL );
if ( result == NULL && !strcmp( name, type ) && result == NULL )
result = mlt_factory_filter( value, NULL );
else if ( result != NULL && !strncmp( name, type, type_len ) && name[ type_len ] == '.' )
- mlt_properties_set( mlt_filter_properties( result ), name + type_len + 1, value );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( result ), name + type_len + 1, value );
else if ( result != NULL )
break;
}
int error = 1;
// Get the properties of the data show filter
- mlt_properties filter_properties = mlt_filter_properties( filter );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
// Get the type requested by the feeding filter
char *type = mlt_properties_get( feed, "type" );
if ( requested != NULL )
{
int i = 0;
- mlt_properties properties = mlt_filter_properties( requested );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( requested );
static char *prefix = "properties.";
int len = strlen( prefix );
mlt_filter filter = mlt_frame_pop_service( frame );
// Get the frame properties
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Fetch the data queue
mlt_deque data_queue = mlt_properties_get_data( frame_properties, "data_queue", NULL );
if ( this != NULL )
{
// Get the properties
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Assign the argument (default to titles)
mlt_properties_set( properties, "profile", arg == NULL ? NULL : arg );
if ( error == 0 && *format == mlt_image_yuv422 )
{
// Get the gamma value
- double gamma = mlt_properties_get_double( mlt_frame_properties( this ), "gamma" );
+ double gamma = mlt_properties_get_double( MLT_FRAME_PROPERTIES( this ), "gamma" );
if ( gamma != 1.0 )
{
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
- double gamma = mlt_properties_get_double( mlt_filter_properties( this ), "gamma" );
+ double gamma = mlt_properties_get_double( MLT_FILTER_PROPERTIES( this ), "gamma" );
gamma = gamma <= 0 ? 1 : gamma;
- mlt_properties_set_double( mlt_frame_properties( frame ), "gamma", gamma );
+ mlt_properties_set_double( MLT_FRAME_PROPERTIES( frame ), "gamma", gamma );
mlt_frame_push_get_image( frame, filter_get_image );
return frame;
}
if ( this != NULL )
{
this->process = filter_process;
- mlt_properties_set( mlt_filter_properties( this ), "gamma", arg == NULL ? "1" : arg );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "gamma", arg == NULL ? "1" : arg );
}
return this;
}
{
int error = 0;
mlt_filter filter = mlt_frame_pop_service( this );
- mlt_properties properties = mlt_filter_properties( filter );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
mlt_transition luma = mlt_properties_get_data( properties, "luma", NULL );
mlt_frame b_frame = mlt_properties_get_data( properties, "frame", NULL );
int out = mlt_properties_get_int( properties, "period" );
luma = mlt_factory_transition( "luma", resource );
if ( luma != NULL )
{
- mlt_properties luma_properties = mlt_transition_properties( luma );
+ mlt_properties luma_properties = MLT_TRANSITION_PROPERTIES( luma );
mlt_properties_set_int( luma_properties, "in", 0 );
mlt_properties_set_int( luma_properties, "out", out );
mlt_properties_set_int( luma_properties, "reverse", 1 );
( mlt_properties_get( properties, "blur" ) != NULL ||
mlt_frame_get_position( this ) % ( out + 1 ) != out ) )
{
- mlt_properties luma_properties = mlt_transition_properties( luma );
+ mlt_properties luma_properties = MLT_TRANSITION_PROPERTIES( luma );
mlt_properties_pass( luma_properties, properties, "luma." );
mlt_transition_process( luma, this, b_frame );
}
if ( error == 0 )
{
- mlt_properties a_props = mlt_frame_properties( this );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( this );
int size = 0;
uint8_t *src = mlt_properties_get_data( a_props, "image", &size );
uint8_t *dst = mlt_pool_alloc( size );
if ( dst != NULL )
{
- mlt_properties b_props = mlt_frame_properties( b_frame );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
memcpy( dst, src, size );
mlt_properties_set_data( b_props, "image", dst, size, mlt_pool_release, NULL );
mlt_properties_set_int( b_props, "width", *width );
mlt_filter this = mlt_filter_new( );
if ( this != NULL )
{
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
this->process = filter_process;
if ( arg != NULL )
mlt_properties_set( properties, "resource", arg );
mlt_filter this = mlt_frame_pop_service( frame );
// Get the mirror type
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Get the properties
char *mirror = mlt_properties_get( properties, "mirror" );
if ( this != NULL )
{
// Get the properties
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Set the default mirror type
mlt_properties_set_or_default( properties, "mirror", arg, "horizontal" );
static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
{
// Get the frame properties
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Pop the top of stack now
mlt_filter this = mlt_frame_pop_service( frame );
if ( this != NULL )
{
// Get the filter properties
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Obtain the normalised width and height from the frame
int normalised_width = mlt_properties_get_int( frame_properties, "normalised_width" );
mlt_filter this = mlt_filter_new( );
if ( this != NULL )
{
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
this->process = filter_process;
mlt_properties_set( properties, "start", arg != NULL ? arg : "0%,0%:100%x100%" );
mlt_properties_set( properties, "end", "" );
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
// Get the properties of the filter
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Get the region transition
mlt_transition transition = mlt_properties_get_data( properties, "_transition", NULL );
mlt_properties_set_data( properties, "_transition", transition, 0, ( mlt_destructor )mlt_transition_close, NULL );
// Pass a reference to this filter down
- mlt_properties_set_data( mlt_transition_properties( transition ), "_region_filter", this, 0, NULL, NULL );
+ mlt_properties_set_data( MLT_TRANSITION_PROPERTIES( transition ), "_region_filter", this, 0, NULL, NULL );
}
// Pass all properties down
- mlt_properties_pass( mlt_transition_properties( transition ), properties, "" );
+ mlt_properties_pass( MLT_TRANSITION_PROPERTIES( transition ), properties, "" );
// Process the frame
return mlt_transition_process( transition, frame, NULL );
if ( this != NULL )
{
// Get the properties from the filter
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Assign the filter process method
this->process = filter_process;
static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format iformat, mlt_image_format oformat, int iwidth, int iheight, int owidth, int oheight )
{
// Get the properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get the rescaling interpolsation
char *interps = mlt_properties_get( properties, "rescale.interp" );
}
this->get_alpha_mask = NULL;
- mlt_properties_set_data( mlt_frame_properties( this ), "alpha", output, 0, mlt_pool_release, NULL );
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "alpha", output, 0, mlt_pool_release, NULL );
}
}
static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
{
// Get the frame properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get the filter from the stack
mlt_filter filter = mlt_frame_pop_service( this );
// Get the filter properties
- mlt_properties filter_properties = mlt_filter_properties( filter );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
// Get the image scaler method
image_scaler scaler_method = mlt_properties_get_data( filter_properties, "method", NULL );
// Default from the scaler if not specifed on the frame
if ( interps == NULL )
{
- interps = mlt_properties_get( mlt_filter_properties( filter ), "interpolation" );
+ interps = mlt_properties_get( MLT_FILTER_PROPERTIES( filter ), "interpolation" );
mlt_properties_set( properties, "rescale.interp", interps );
}
if ( this != NULL )
{
// Get the properties
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Set the process method
this->process = filter_process;
int error = 0;
// Get the properties from the frame
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Pop the top of stack now
mlt_filter filter = mlt_frame_pop_service( this );
if ( error == 0 && *format == mlt_image_yuv422 )
{
// Get the requested scale operation
- char *op = mlt_properties_get( mlt_filter_properties( filter ), "scale" );
+ char *op = mlt_properties_get( MLT_FILTER_PROPERTIES( filter ), "scale" );
// Correct field order if needed
if ( mlt_properties_get_int( properties, "top_field_first" ) == 1 )
if ( mlt_filter_init( this, this ) == 0 )
{
this->process = filter_process;
- mlt_properties_set( mlt_filter_properties( this ), "scale", arg == NULL ? "off" : arg );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "scale", arg == NULL ? "off" : arg );
}
return this;
}
mlt_filter this = mlt_frame_pop_service( frame );
// Get the properties of the filter
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Get the producer from the filter
mlt_producer producer = mlt_properties_get_data( properties, "producer", NULL );
if ( composite != NULL )
{
// Get the properties
- mlt_properties composite_properties = mlt_transition_properties( composite );
+ mlt_properties composite_properties = MLT_TRANSITION_PROPERTIES( composite );
// Pass all the composite. properties on the filter down
mlt_properties_pass( composite_properties, properties, "composite." );
mlt_properties_set_data( properties, "producer", producer, 0, ( mlt_destructor )mlt_producer_close, NULL );
// Ensure that we loop
- mlt_properties_set( mlt_producer_properties( producer ), "eof", "loop" );
+ mlt_properties_set( MLT_PRODUCER_PROPERTIES( producer ), "eof", "loop" );
// Set the old resource
mlt_properties_set( properties, "_old_resource", resource );
if ( producer != NULL )
{
// Get the producer properties
- mlt_properties producer_properties = mlt_producer_properties( producer );
+ mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer );
// Now pass all producer. properties on the filter down
mlt_properties_pass( producer_properties, properties, "producer." );
if ( composite != NULL && producer != NULL )
{
// Get the service of the producer
- mlt_service service = mlt_producer_service( producer );
+ mlt_service service = MLT_PRODUCER_SERVICE( producer );
// We will get the 'b frame' from the producer
mlt_frame b_frame = NULL;
char *name = mlt_properties_get( properties, "_unique_id" );
// Get the original producer position
- mlt_position position = mlt_properties_get_position( mlt_frame_properties( frame ), name );
+ mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( frame ), name );
// Make sure the producer is in the correct position
mlt_producer_seek( producer, position );
if ( mlt_service_get_frame( service, &b_frame, 0 ) == 0 )
{
// Get the a and b frame properties
- mlt_properties a_props = mlt_frame_properties( frame );
- mlt_properties b_props = mlt_frame_properties( b_frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( frame );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
// Set the b frame to be in the same position and have same consumer requirements
mlt_frame_set_position( b_frame, position );
if ( mlt_properties_get_int( properties, "distort" ) )
{
- mlt_properties_set( mlt_transition_properties( composite ), "distort", "true" );
+ mlt_properties_set( MLT_TRANSITION_PROPERTIES( composite ), "distort", "true" );
mlt_properties_set( a_props, "distort", "true" );
mlt_properties_set( b_props, "distort", "true" );
}
if ( mlt_properties_get_int( properties, "reverse" ) == 0 )
{
// Apply all filters that are attached to this filter to the b frame
- mlt_service_apply_filters( mlt_filter_service( this ), b_frame, 0 );
+ mlt_service_apply_filters( MLT_FILTER_SERVICE( this ), b_frame, 0 );
// Process the frame
mlt_transition_process( composite, frame, b_frame );
mlt_properties_set_int( b_props, "consumer_deinterlace", 1 );
mlt_properties_set( a_props, "rescale.interp", "nearest" );
mlt_properties_set( b_props, "rescale.interp", "nearest" );
- mlt_service_apply_filters( mlt_filter_service( this ), b_frame, 0 );
+ mlt_service_apply_filters( MLT_FILTER_SERVICE( this ), b_frame, 0 );
error = mlt_frame_get_image( b_frame, image, format, width, height, 1 );
alpha = mlt_frame_get_alpha_mask( b_frame );
mlt_properties_set_data( a_props, "image", *image, *width * *height * 2, NULL, NULL );
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
// Get the properties of the frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Get a unique name to store the frame position
- char *name = mlt_properties_get( mlt_filter_properties( this ), "_unique_id" );
+ char *name = mlt_properties_get( MLT_FILTER_PROPERTIES( this ), "_unique_id" );
// Assign the current position to the name
mlt_properties_set_position( properties, name, mlt_frame_get_position( frame ) - mlt_filter_get_in( this ) );
mlt_filter this = mlt_filter_new( );
if ( this != NULL )
{
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
this->process = filter_process;
mlt_properties_set( properties, "factory", "fezzik" );
if ( arg != NULL )
if ( producer != NULL && mlt_producer_init( producer, NULL ) == 0 )
{
// Get the properties interface
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
// Callback registration
producer->get_frame = producer_get_frame;
int size = 0;
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Obtain the producer for this frame
mlt_producer producer = mlt_properties_get_data( properties, "producer_colour", NULL );
// Obtain properties of producer
- mlt_properties producer_props = mlt_producer_properties( producer );
+ mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
// Get the current image and dimensions cached in the producer
uint8_t *image = mlt_properties_get_data( producer_props, "image", &size );
if ( *frame != NULL )
{
// Obtain properties of frame and producer
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
// Obtain properties of producer
- mlt_properties producer_props = mlt_producer_properties( producer );
+ mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
// Determine if we're producing PAL or NTSC
int is_pal = mlt_properties_get_double( producer_props, "fps" ) == 25.0;
// Initialise the producer
if ( this != NULL )
{
- int is_pal = mlt_properties_get_int( mlt_producer_properties( this ), "normalised_height" ) == 576;
+ int is_pal = mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( this ), "normalised_height" ) == 576;
// Synthetic - aspect ratio of 1
- mlt_properties_set_double( mlt_producer_properties( this ), "aspect_ratio", is_pal ? 59.0/54.0 : 10.0/11.0 );
+ mlt_properties_set_double( MLT_PRODUCER_PROPERTIES( this ), "aspect_ratio", is_pal ? 59.0/54.0 : 10.0/11.0 );
// Callback registration
this->get_frame = producer_get_frame;
static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Calculate the size of the image
int size = *width * *height * 2;
static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the frame properties
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
int size = 0;
if ( *frame != NULL )
{
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
// Obtain properties of producer
- mlt_properties producer_props = mlt_producer_properties( this );
+ mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( this );
// Determine if we're producing PAL or NTSC
int is_pal = mlt_properties_get_double( producer_props, "fps" ) == 25.0;
if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 )
{
mlt_producer producer = &this->parent;
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
producer->get_frame = producer_get_frame;
producer->close = ( mlt_destructor )producer_close;
static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
if ( mlt_properties_get_int( properties, "has_image" ) )
{
static int producer_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
FILE *pipe = mlt_properties_get_data( properties, "audio.pipe", NULL );
producer_ppm_position( this, mlt_producer_frame( producer ) );
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
FILE *video = this->video;
FILE *audio = this->audio;
int i = 0;
// Get the properties of the transition
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// Get the in and out position
mlt_position in = mlt_transition_get_in( this );
mlt_position out = mlt_transition_get_out( this );
// Get the position of the frame
- char *name = mlt_properties_get( mlt_transition_properties( this ), "_unique_id" );
- mlt_position position = mlt_properties_get_position( mlt_frame_properties( frame ), name );
+ char *name = mlt_properties_get( MLT_TRANSITION_PROPERTIES( this ), "_unique_id" );
+ mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( frame ), name );
// Now do the calcs
float x = ( float )( position - in ) / ( float )( out - in + 1 );
if ( producer != NULL )
{
// Get the producer properties
- mlt_properties producer_properties = mlt_producer_properties( producer );
+ mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer );
// Ensure that we loop
mlt_properties_set( producer_properties, "eof", "loop" );
mlt_frame luma_frame = NULL;
// Get the luma frame
- if ( mlt_service_get_frame( mlt_producer_service( producer ), &luma_frame, 0 ) == 0 )
+ if ( mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &luma_frame, 0 ) == 0 )
{
uint8_t *luma_image;
mlt_image_format luma_format = mlt_image_yuv422;
// Get image from the luma producer
- mlt_properties_set( mlt_frame_properties( luma_frame ), "rescale.interp", "none" );
+ mlt_properties_set( MLT_FRAME_PROPERTIES( luma_frame ), "rescale.interp", "none" );
mlt_frame_get_image( luma_frame, &luma_image, &luma_format, &luma_width, &luma_height, 0 );
// Generate the luma map
mlt_image_format format = mlt_image_yuv422;
// Get the properties objects
- mlt_properties b_props = mlt_frame_properties( b_frame );
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
if ( mlt_properties_get( properties, "distort" ) == NULL && mlt_properties_get( b_props, "distort" ) == NULL && geometry->distort == 0 )
{
static struct geometry_s *composite_calculate( struct geometry_s *result, mlt_transition this, mlt_frame a_frame, float position )
{
// Get the properties from the transition
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// Get the properties from the frame
- mlt_properties a_props = mlt_frame_properties( a_frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( a_frame );
// Structures for geometry
struct geometry_s *start = mlt_properties_get_data( properties, "geometries", NULL );
mlt_frame b_frame = mlt_frame_init( );
// Get the properties of the a frame
- mlt_properties a_props = mlt_frame_properties( a_frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( a_frame );
// Get the properties of the b frame
- mlt_properties b_props = mlt_frame_properties( b_frame );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
// Get the position
float position = position_calculate( this, frame_position );
mlt_frame_get_image( a_frame, image, format, width, height, 1 );
// Get the properties from the transition
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
if ( b_frame != NULL )
{
// Get the properties of the a frame
- mlt_properties a_props = mlt_frame_properties( a_frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( a_frame );
// Get the properties of the b frame
- mlt_properties b_props = mlt_frame_properties( b_frame );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
// Structures for geometry
struct geometry_s result;
if ( mlt_properties_get_int( properties, "titles" ) )
{
if ( mlt_properties_get( b_props, "rescale.interp" ) == NULL )
- mlt_properties_set( b_props, "rescale.interp", "nearest" );
+ mlt_properties_set( b_props, "rescale.interp", "hyper" );
mlt_properties_set( properties, "fill", NULL );
width_b = mlt_properties_get_int( a_props, "dest_width" );
height_b = mlt_properties_get_int( a_props, "dest_height" );
static mlt_frame composite_process( mlt_transition this, mlt_frame a_frame, mlt_frame b_frame )
{
// Get a unique name to store the frame position
- char *name = mlt_properties_get( mlt_transition_properties( this ), "_unique_id" );
+ char *name = mlt_properties_get( MLT_TRANSITION_PROPERTIES( this ), "_unique_id" );
// Assign the current position to the name
- mlt_properties_set_position( mlt_frame_properties( a_frame ), name, mlt_frame_get_position( a_frame ) );
+ mlt_properties_set_position( MLT_FRAME_PROPERTIES( a_frame ), name, mlt_frame_get_position( a_frame ) );
// Propogate the transition properties to the b frame
- mlt_properties_set_double( mlt_frame_properties( b_frame ), "relative_position", position_calculate( this, mlt_frame_get_position( a_frame ) ) );
+ mlt_properties_set_double( MLT_FRAME_PROPERTIES( b_frame ), "relative_position", position_calculate( this, mlt_frame_get_position( a_frame ) ) );
mlt_frame_push_service( a_frame, this );
mlt_frame_push_frame( a_frame, b_frame );
mlt_transition this = calloc( sizeof( struct mlt_transition_s ), 1 );
if ( this != NULL && mlt_transition_init( this, NULL ) == 0 )
{
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
this->process = composite_process;
mlt_position out = mlt_transition_get_out( this );
// Get the position of the frame
- char *name = mlt_properties_get( mlt_transition_properties( this ), "_unique_id" );
- mlt_position position = mlt_properties_get_position( mlt_frame_properties( frame ), name );
+ char *name = mlt_properties_get( MLT_TRANSITION_PROPERTIES( this ), "_unique_id" );
+ mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( frame ), name );
// Now do the calcs
return ( float )( position - in ) / ( float )( out - in + 1 );
mlt_transition transition = mlt_frame_pop_service( a_frame );
// Get the properties of the transition
- mlt_properties properties = mlt_transition_properties( transition );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( transition );
// Get the properties of the a frame
- mlt_properties a_props = mlt_frame_properties( a_frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( a_frame );
// Get the properties of the b frame
- mlt_properties b_props = mlt_frame_properties( b_frame );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
// The cached luma map information
int luma_width = mlt_properties_get_int( properties, "width" );
if ( producer != NULL )
{
// Get the producer properties
- mlt_properties producer_properties = mlt_producer_properties( producer );
+ mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer );
// Ensure that we loop
mlt_properties_set( producer_properties, "eof", "loop" );
mlt_frame luma_frame = NULL;
// Get the luma frame
- if ( mlt_service_get_frame( mlt_producer_service( producer ), &luma_frame, 0 ) == 0 )
+ if ( mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &luma_frame, 0 ) == 0 )
{
uint8_t *luma_image;
mlt_image_format luma_format = mlt_image_yuv422;
// Get image from the luma producer
- mlt_properties_set( mlt_frame_properties( luma_frame ), "rescale.interp", "none" );
+ mlt_properties_set( MLT_FRAME_PROPERTIES( luma_frame ), "rescale.interp", "none" );
mlt_frame_get_image( luma_frame, &luma_image, &luma_format, &luma_width, &luma_height, 0 );
// Generate the luma map
static mlt_frame transition_process( mlt_transition transition, mlt_frame a_frame, mlt_frame b_frame )
{
// Get a unique name to store the frame position
- char *name = mlt_properties_get( mlt_transition_properties( transition ), "_unique_id" );
+ char *name = mlt_properties_get( MLT_TRANSITION_PROPERTIES( transition ), "_unique_id" );
// Assign the current position to the name
- mlt_properties_set_position( mlt_frame_properties( a_frame ), name, mlt_frame_get_position( a_frame ) );
+ mlt_properties_set_position( MLT_FRAME_PROPERTIES( a_frame ), name, mlt_frame_get_position( a_frame ) );
// Push the transition on to the frame
mlt_frame_push_service( a_frame, transition );
transition->process = transition_process;
// Default factory
- mlt_properties_set( mlt_transition_properties( transition ), "factory", "fezzik" );
+ mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "factory", "fezzik" );
// Set the main property
- mlt_properties_set( mlt_transition_properties( transition ), "resource", lumafile );
+ mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "resource", lumafile );
return transition;
}
static int transition_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties of the a frame
- mlt_properties a_props = mlt_frame_properties( frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( frame );
// Get the b frame from the stack
mlt_frame b_frame = mlt_frame_pop_audio( frame );
// Get the properties of the b frame
- mlt_properties b_props = mlt_frame_properties( b_frame );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
// Restore the original get_audio
frame->get_audio = mlt_properties_get_data( a_props, "mix.get_audio", NULL );
mix_start = 1 - mix_start;
mix_end = 1 - mix_end;
}
- //fprintf( stderr, "transition_mix: previous %f current %f\n", mix_start, mix_end );
mlt_frame_mix_audio( frame, b_frame, mix_start, mix_end, buffer, format, frequency, channels, samples );
static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt_frame b_frame )
{
- mlt_properties properties = mlt_transition_properties( this );
- mlt_properties b_props = mlt_frame_properties( b_frame );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
// Only if mix is specified, otherwise a producer may set the mix
if ( mlt_properties_get( properties, "start" ) != NULL )
}
// Ensure that the tractor knows this isn't test audio...
- if ( mlt_properties_get_int( mlt_frame_properties( a_frame ), "test_audio" ) )
+ if ( mlt_properties_get_int( MLT_FRAME_PROPERTIES( a_frame ), "test_audio" ) )
{
- mlt_properties_set_int( mlt_frame_properties( a_frame ), "test_audio", 0 );
- mlt_properties_set_int( mlt_frame_properties( a_frame ), "silent_audio", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( a_frame ), "test_audio", 0 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( a_frame ), "silent_audio", 1 );
}
// Backup the original get_audio (it's still needed)
- mlt_properties_set_data( mlt_frame_properties( a_frame ), "mix.get_audio", a_frame->get_audio, 0, NULL, NULL );
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( a_frame ), "mix.get_audio", a_frame->get_audio, 0, NULL, NULL );
// Override the get_audio method
a_frame->get_audio = transition_get_audio;
{
this->process = transition_process;
if ( arg != NULL )
- mlt_properties_set_double( mlt_transition_properties( this ), "start", atof( arg ) );
- mlt_properties_set_int( mlt_transition_properties( this ), "_accepts_blanks", 1 );
+ mlt_properties_set_double( MLT_TRANSITION_PROPERTIES( this ), "start", atof( arg ) );
+ mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( this ), "_accepts_blanks", 1 );
}
return this;
}
if ( filter != NULL )
{
// Properties of this
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// String to hold the property name
char id[ 256 ];
sprintf( key, "%s.", name );
// Just in case, let's assume that the filter here has a composite
- mlt_properties_set( mlt_filter_properties( filter ), "composite.start", "0%,0%:100%x100%" );
- mlt_properties_set( mlt_filter_properties( filter ), "composite.fill", "true" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( filter ), "composite.start", "0%,0%:100%x100%" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( filter ), "composite.fill", "true" );
// Pass all the key properties on the filter down
- mlt_properties_pass( mlt_filter_properties( filter ), properties, key );
+ mlt_properties_pass( MLT_FILTER_PROPERTIES( filter ), properties, key );
// Ensure that filter is assigned
mlt_properties_set_data( properties, id, filter, 0, ( mlt_destructor )mlt_filter_close, NULL );
uint8_t *alpha = NULL;
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get the shape frame
mlt_frame shape_frame = mlt_properties_get_data( properties, "shape_frame", NULL );
// Get the width and height of the image
- int region_width = mlt_properties_get_int( mlt_frame_properties( this ), "width" );
- int region_height = mlt_properties_get_int( mlt_frame_properties( this ), "height" );
+ int region_width = mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "width" );
+ int region_height = mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "height" );
uint8_t *image = NULL;
mlt_image_format format = mlt_image_yuv422;
// Get the shape image to trigger alpha creation
- mlt_properties_set( mlt_frame_properties( shape_frame ), "distort", "true" );
+ mlt_properties_set( MLT_FRAME_PROPERTIES( shape_frame ), "distort", "true" );
mlt_frame_get_image( shape_frame, &image, &format, ®ion_width, ®ion_height, 0 );
alpha = mlt_frame_get_alpha_mask( shape_frame );
*p ++ = *image ++;
image ++;
}
- mlt_properties_set_data( mlt_frame_properties( shape_frame ), "alpha", alpha,
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( shape_frame ), "alpha", alpha,
region_width * region_height, mlt_pool_release, NULL );
}
mlt_transition this = mlt_frame_pop_service( frame );
// Get the properties of the transition
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// Get the composite from the transition
mlt_transition composite = mlt_properties_get_data( properties, "composite", NULL );
char *name = mlt_properties_get( properties, "_unique_id" );
// Get the original producer position
- mlt_position position = mlt_properties_get_position( mlt_frame_properties( frame ), name );
+ mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( frame ), name );
// Create a composite if we don't have one
if ( composite == NULL )
if ( composite != NULL )
{
// Get the properties
- mlt_properties composite_properties = mlt_transition_properties( composite );
+ mlt_properties composite_properties = MLT_TRANSITION_PROPERTIES( composite );
// We want to ensure that we don't get a wobble...
mlt_properties_set( composite_properties, "distort", "true" );
else
{
// Pass all current properties down
- mlt_properties composite_properties = mlt_transition_properties( composite );
+ mlt_properties composite_properties = MLT_TRANSITION_PROPERTIES( composite );
mlt_properties_pass( composite_properties, properties, "composite." );
}
if ( temp != NULL )
{
- mlt_properties_pass( mlt_filter_properties( temp ), properties, key );
+ mlt_properties_pass( MLT_FILTER_PROPERTIES( temp ), properties, key );
count ++;
}
}
b_frame = composite_copy_region( composite, frame, position );
// Ensure a destructor
- mlt_properties_set_data( mlt_frame_properties( frame ), name, b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), name, b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
}
// Set the position of the b_frame
while ( filter != NULL )
{
// Stack this filter
- if ( mlt_properties_get_int( mlt_filter_properties( filter ), "off" ) == 0 )
+ if ( mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "off" ) == 0 )
mlt_filter_process( filter, b_frame );
// Generate the key for the next
// Allow filters to be attached to a region filter
filter = mlt_properties_get_data( properties, "_region_filter", NULL );
if ( filter != NULL )
- mlt_service_apply_filters( mlt_filter_service( filter ), b_frame, 0 );
+ mlt_service_apply_filters( MLT_FILTER_SERVICE( filter ), b_frame, 0 );
// Hmm - this is probably going to go wrong....
mlt_frame_set_position( frame, position );
if ( producer != NULL )
{
// Get the producer properties
- mlt_properties producer_properties = mlt_producer_properties( producer );
+ mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer );
// Ensure that we loop
mlt_properties_set( producer_properties, "eof", "loop" );
mlt_producer_seek( producer, position );
// Get the shape frame
- if ( mlt_service_get_frame( mlt_producer_service( producer ), &shape_frame, 0 ) == 0 )
+ if ( mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &shape_frame, 0 ) == 0 )
{
// Ensure that the shape frame will be closed
- mlt_properties_set_data( mlt_frame_properties( b_frame ), "shape_frame", shape_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( b_frame ), "shape_frame", shape_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
// Specify the callback for evaluation
b_frame->get_alpha_mask = filter_get_alpha_mask;
static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt_frame b_frame )
{
// Get the properties of the frame
- mlt_properties properties = mlt_frame_properties( a_frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( a_frame );
// Get a unique name to store the frame position
- char *name = mlt_properties_get( mlt_transition_properties( this ), "_unique_id" );
+ char *name = mlt_properties_get( MLT_TRANSITION_PROPERTIES( this ), "_unique_id" );
// Assign the current position to the name
mlt_properties_set_position( properties, name, mlt_frame_get_position( a_frame ) );
if ( this != NULL )
{
// Get the properties from the transition
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// Assign the transition process method
this->process = transition_process;
tickertape.filter[1].composite.start=101%,1%:300%x99%:100
tickertape.filter[1].composite.end=-300%,1%:300%x99%:100
tickertape.filter[1].composite.titles=1
+
+#
+# ETV Location
+#
+
+location=region
+location.description=Titles
+location.properties.markup=filter[1].producer.markup
+location.type.markup=text
+location.period=2
+location.properties.length[0]=filter[0].composite.out
+location.properties.length[1]=filter[1].composite.out
+location.composite.start=0,80:230x30
+location.filter[0]=watermark
+location.filter[0].resource=colour:0x6c010100
+location.filter[0].composite.start=0%,0%:100%x100%:0
+location.filter[0].composite.key[5]=0%,0%:100%x100%:100
+location.filter[1]=watermark
+location.filter[1].resource=pango:
+location.filter[1].producer.markup=Shotcut
+location.filter[1].producer.font=San 24
+location.filter[1].composite.start=0%,0%:100%x100%:0
+location.filter[1].composite.key[8]=0%,0%:100%x100%:100
+location.filter[1].composite.titles=1
+#location.filter[1].composite.halign=right
+
+courtesy=region
+courtesy.description=Titles
+courtesy.properties.markup=filter[1].producer.markup
+courtesy.type.markup=text
+courtesy.period=2
+courtesy.properties.length[0]=filter[0].composite.out
+courtesy.properties.length[1]=filter[1].composite.out
+courtesy.composite.start=0,115:230x30
+courtesy.filter[0]=watermark
+courtesy.filter[0].resource=colour:0x6c010100
+courtesy.filter[0].composite.start=0%,0%:100%x100%:0
+courtesy.filter[0].composite.key[5]=0%,0%:100%x100%:100
+courtesy.filter[1]=watermark
+courtesy.filter[1].resource=pango:
+courtesy.filter[1].producer.markup=ETV Exclusive
+courtesy.filter[1].producer.font=San 24
+courtesy.filter[1].composite.start=1%,1%:99%x99%:0
+courtesy.filter[1].composite.key[8]=1%,1%:99%x99%:100
+courtesy.filter[1].composite.titles=1
+#exclusive.filter[1].composite.halign=right
+
+exclusive=region
+exclusive.description=Titles
+exclusive.period=2
+exclusive.properties.length[0]=filter[0].composite.out
+exclusive.properties.length[1]=filter[1].composite.out
+exclusive.composite.start=0,115:230x30
+exclusive.filter[0]=watermark
+exclusive.filter[0].resource=colour:0x6c010100
+exclusive.filter[0].composite.start=0%,0%:100%x100%:0
+exclusive.filter[0].composite.key[5]=0%,0%:100%x100%:100
+exclusive.filter[1]=watermark
+exclusive.filter[1].resource=pango:
+exclusive.filter[1].producer.markup=ETV Exclusive
+exclusive.filter[1].producer.font=San 24
+exclusive.filter[1].composite.start=1%,1%:99%x99%:0
+exclusive.filter[1].composite.key[8]=1%,1%:99%x99%:100
+exclusive.filter[1].composite.titles=1
+#exclusive.filter[1].composite.halign=right
+
+shot=region
+shot.description=Titles
+shot.period=2
+shot.properties.length[0]=filter[0].composite.out
+shot.properties.length[1]=filter[1].composite.out
+shot.composite.start=590,160:80x25
+shot.filter[0]=watermark
+shot.filter[0].resource=colour:0x6c010100
+shot.filter[0].composite.start=0%,0%:100%x100%:0
+shot.filter[0].composite.key[5]=0%,0%:100%x100%:100
+shot.filter[1]=watermark
+shot.filter[1].resource=pango:
+shot.filter[1].producer.markup=Live
+shot.filter[1].producer.font=San 24
+shot.filter[1].composite.start=1%,1%:99%x99%:0
+shot.filter[1].composite.key[8]=1%,1%:99%x99%:100
+shot.filter[1].composite.titles=1
+#shot.filter[1].composite.halign=centre
+
+special=region
+special.description=Titles
+special.period=2
+special.properties.length[0]=filter[0].composite.out
+special.properties.length[1]=filter[1].composite.out
+special.composite.start=465,375:255x35
+special.filter[0]=watermark
+special.filter[0].resource=colour:0x6c010100
+special.filter[0].composite.start=0%,0%:100%x100%:0
+special.filter[0].composite.key[5]=0%,0%:100%x100%:100
+special.filter[1]=watermark
+special.filter[1].resource=pango:
+special.filter[1].producer.markup=Special
+special.filter[1].producer.font=San 24
+special.filter[1].composite.start=1%,1%:99%x99%:0
+special.filter[1].composite.key[8]=1%,1%:99%x99%:100
+special.filter[1].composite.titles=1
+#special.filter[1].composite.halign=centre
+
+name=region
+name.description=Titles
+name.properties.markup=filter[1].producer.markup
+name.type.markup=text
+name.period=2
+name.properties.length[0]=filter[0].composite.out
+name.properties.length[1]=filter[1].composite.out
+name.composite.start=0,410:720x45
+name.filter[0]=watermark
+name.filter[0].resource=colour:0xbbbbbb00
+name.filter[0].composite.start=0%,0%:100%x100%:0
+name.filter[0].composite.key[5]=0%,0%:100%x100%:100
+name.filter[1]=watermark
+name.filter[1].resource=pango:
+name.filter[1].producer.markup=Shotcut
+name.filter[1].producer.font=San 32
+name.filter[1].producer.fgcolour=0x6c010100
+name.filter[1].composite.start=1%,1%:99%x99%:0
+name.filter[1].composite.key[8]=1%,1%:99%x99%:100
+name.filter[1].composite.titles=1
+#name.filter[1].composite.halign=centre
+
+designation=region
+designation.description=Titles
+designation.properties.markup=filter[1].producer.markup
+designation.type.markup=text
+designation.period=2
+designation.properties.length[0]=filter[0].composite.out
+designation.properties.length[1]=filter[1].composite.out
+designation.composite.start=0,455:720x45
+designation.filter[0]=watermark
+designation.filter[0].resource=colour:0xbbbbbb00
+designation.filter[0].composite.start=0%,0%:100%x100%:0
+designation.filter[0].composite.key[5]=0%,0%:100%x100%:100
+designation.filter[1]=watermark
+designation.filter[1].resource=pango:
+designation.filter[1].producer.markup=Shotcut
+designation.filter[1].producer.font=San 32
+designation.filter[1].producer.fgcolour=0x6c010100
+designation.filter[1].composite.start=1%,1%:99%x99%:0
+designation.filter[1].composite.key[8]=1%,1%:99%x99%:100
+designation.filter[1].composite.titles=1
+#designation.filter[1].composite.halign=centre
+
+ticker=region
+ticker.description=Tickertape
+ticker.properties.markup=filter[1].producer.markup
+ticker.type.markup=text
+ticker.properties.length[0]=filter[1].composite.out
+ticker.composite.start=0,500:722x75
+ticker.filter[0]=watermark
+ticker.filter[0].resource=colour:0x6c010100
+ticker.filter[0].composite.start=0%,0%:100%x100%:100
+ticker.filter[1]=watermark
+ticker.filter[1].resource=pango:
+ticker.filter[1].producer.markup=Ticker - provided for reference
+ticker.filter[1].composite.start=0%,0%:100%x100%:100
+ticker.filter[1].composite.titles=0
+ticker.filter[1].producer.font=San 24
+ticker.filter[1].composite.halign=centre
+#ticker.filter[1].composite.valign=centre
+
if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 )
{
// Get properties from the consumer
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Assign close callback
this->close = consumer_close;
static int consumer_start( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Check that we're not already running
if ( !mlt_properties_get_int( properties, "running" ) )
static int consumer_stop( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Check that we're running
if ( mlt_properties_get_int( properties, "running" ) )
static int consumer_is_stopped( mlt_consumer this )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
return !mlt_properties_get_int( properties, "running" );
}
static dv_encoder_t *libdv_get_encoder( mlt_consumer this, mlt_frame frame )
{
// Get the properties of the consumer
- mlt_properties this_properties = mlt_consumer_properties( this );
+ mlt_properties this_properties = MLT_CONSUMER_PROPERTIES( this );
// Obtain the dv_encoder
dv_encoder_t *encoder = mlt_properties_get_data( this_properties, "dv_encoder", NULL );
dv_encoder_t *encoder = libdv_get_encoder( this, frame );
// Get the properties of the consumer
- mlt_properties this_properties = mlt_consumer_properties( this );
+ mlt_properties this_properties = MLT_CONSUMER_PROPERTIES( this );
// This will hold the size of the dv frame
int size = 0;
// Is the image rendered
- int rendered = mlt_properties_get_int( mlt_frame_properties( frame ), "rendered" );
+ int rendered = mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "rendered" );
// Get width and height
int width = mlt_properties_get_int( this_properties, "width" );
static void consumer_encode_audio( mlt_consumer this, uint8_t *dv_frame, mlt_frame frame )
{
// Get the properties of the consumer
- mlt_properties this_properties = mlt_consumer_properties( this );
+ mlt_properties this_properties = MLT_CONSUMER_PROPERTIES( this );
// Get the properties of the frame
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Obtain the dv_encoder
dv_encoder_t *encoder = libdv_get_encoder( this, frame );
static void consumer_output( mlt_consumer this, uint8_t *dv_frame, int size, mlt_frame frame )
{
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
FILE *output = stdout;
char *target = mlt_properties_get( properties, "target" );
mlt_consumer this = arg;
// Get the properties
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Get the terminate_on_pause property
int top = mlt_properties_get_int( properties, "terminate_on_pause" );
if ( frame != NULL )
{
// Terminate on pause
- if ( top && mlt_properties_get_double( mlt_frame_properties( frame ), "_speed" ) == 0 )
+ if ( top && mlt_properties_get_double( MLT_FRAME_PROPERTIES( frame ), "_speed" ) == 0 )
{
mlt_frame_close( frame );
break;
if ( filename != NULL && this != NULL && mlt_producer_init( &this->parent, this ) == 0 )
{
mlt_producer producer = &this->parent;
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
// Register transport implementation with the producer
producer->close = ( mlt_destructor )producer_close;
if ( valid )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( &this->parent );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( &this->parent );
// Get a dv_decoder
dv_decoder_t *dv_decoder = dv_decoder_alloc( );
uint8_t *pixels[3] = { NULL, NULL, NULL };
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get a dv_decoder
dv_decoder_t *decoder = dv_decoder_alloc( );
int16_t *audio_channels[ 4 ];
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get a dv_decoder
dv_decoder_t *decoder = dv_decoder_alloc( );
read_frame( this->fd, data, &this->is_pal ) )
{
// Get the frames properties
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
// Get a dv_decoder
dv_decoder_t *dv_decoder = dv_decoder_alloc( );
( *frame )->get_audio = producer_get_audio;
// Push the quality string
- mlt_frame_push_service( *frame, mlt_properties_get( mlt_producer_properties( producer ), "quality" ) );
+ mlt_frame_push_service( *frame, mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "quality" ) );
// Push the get_image method on to the stack
mlt_frame_push_get_image( *frame, producer_get_image );
rescaler=mcrescale,gtkrescale,rescale
resizer=resize
resampler=soxresample,avresample,resample
+data=data_feed:attr_check
mlt_filter filter = mlt_factory_filter( id, arg );
if ( filter != NULL )
{
- mlt_properties_set_int( mlt_filter_properties( filter ), "_fezzik", 1 );
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik", 1 );
mlt_producer_attach( producer, filter );
mlt_filter_close( filter );
*created = 1;
producer = create_producer( arg );
if ( producer != NULL )
- properties = mlt_producer_properties( producer );
+ 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 )
if ( this != NULL && producer != NULL )
{
// Get the properties of this producer
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Store the producer
mlt_properties_set_data( properties, "producer", producer, 0, ( mlt_destructor )mlt_producer_close, NULL );
static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
// Get the properties of the frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Obtain the real frame
mlt_frame real_frame = mlt_frame_pop_service( frame );
// Get the image from the real frame
int size = 0;
- *buffer = mlt_properties_get_data( mlt_frame_properties( real_frame ), "image", &size );
- *width = mlt_properties_get_int( mlt_frame_properties( real_frame ), "width" );
- *height = mlt_properties_get_int( mlt_frame_properties( real_frame ), "height" );
+ *buffer = mlt_properties_get_data( MLT_FRAME_PROPERTIES( real_frame ), "image", &size );
+ *width = mlt_properties_get_int( MLT_FRAME_PROPERTIES( real_frame ), "width" );
+ *height = mlt_properties_get_int( MLT_FRAME_PROPERTIES( real_frame ), "height" );
// If this is the first time, get it from the producer
if ( *buffer == NULL )
{
- mlt_properties_pass( mlt_frame_properties( real_frame ), properties, "" );
+ mlt_properties_pass( MLT_FRAME_PROPERTIES( real_frame ), properties, "" );
// We'll deinterlace on the downstream deinterlacer
- mlt_properties_set_int( mlt_frame_properties( real_frame ), "consumer_deinterlace", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( real_frame ), "consumer_deinterlace", 1 );
// We want distorted to ensure we don't hit the resize filter twice
- mlt_properties_set_int( mlt_frame_properties( real_frame ), "distort", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( real_frame ), "distort", 1 );
// Get the image
mlt_frame_get_image( real_frame, buffer, format, width, height, writable );
// Make sure we get the size
- *buffer = mlt_properties_get_data( mlt_frame_properties( real_frame ), "image", &size );
+ *buffer = mlt_properties_get_data( MLT_FRAME_PROPERTIES( real_frame ), "image", &size );
}
- mlt_properties_pass( properties, mlt_frame_properties( real_frame ), "" );
+ mlt_properties_pass( properties, MLT_FRAME_PROPERTIES( real_frame ), "" );
// Set the values obtained on the frame
if ( *buffer != NULL )
static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
{
// Get the properties of this producer
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Construct a new frame
*frame = mlt_frame_init( );
mlt_producer_seek( producer, position );
// Get the real frame
- mlt_service_get_frame( mlt_producer_service( producer ), &real_frame, index );
+ mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &real_frame, index );
// Ensure that the real frame gets wiped eventually
mlt_properties_set_data( properties, "real_frame", real_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
else
{
// Temporary fix - ensure that we aren't seen as a test frame
- int8_t *image = mlt_properties_get_data( mlt_frame_properties( real_frame ), "image", NULL );
- mlt_properties_set_data( mlt_frame_properties( *frame ), "image", image, 0, NULL, NULL );
- mlt_properties_set_int( mlt_frame_properties( *frame ), "test_image", 0 );
+ int8_t *image = mlt_properties_get_data( MLT_FRAME_PROPERTIES( real_frame ), "image", NULL );
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( *frame ), "image", image, 0, NULL, NULL );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "test_image", 0 );
}
// Stack the real frame and method
mlt_frame_push_service( *frame, producer_get_image );
// Ensure that the consumer sees what the real frame has
- mlt_properties_pass( mlt_frame_properties( *frame ), mlt_frame_properties( real_frame ), "" );
+ mlt_properties_pass( MLT_FRAME_PROPERTIES( *frame ), MLT_FRAME_PROPERTIES( real_frame ), "" );
}
// Move to the next position
// Now assign the lock/unlock callbacks
if ( consumer != NULL )
{
- mlt_properties properties = mlt_consumer_properties( consumer );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
mlt_properties_set_int( properties, "app_locked", 1 );
mlt_properties_set_data( properties, "app_lock", gdk_threads_enter, 0, NULL, NULL );
mlt_properties_set_data( properties, "app_unlock", gdk_threads_leave, 0, NULL, NULL );
static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format iformat, mlt_image_format oformat, int iwidth, int iheight, int owidth, int oheight )
{
// Get the properties
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Get the requested interpolation method
char *interps = mlt_properties_get( properties, "rescale.interp" );
if ( this != NULL )
{
// Get the properties
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
// Set the inerpolation
mlt_properties_set( properties, "interpolation", arg == NULL ? "bilinear" : arg );
g_type_init();
// Get the properties interface
- mlt_properties properties = mlt_producer_properties( &this->parent );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( &this->parent );
// Set the default properties
mlt_properties_set( properties, "fgcolour", "0xffffffff" );
GdkPixbuf *pixbuf = NULL;
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Obtain the producer pango for this frame
producer_pango this = mlt_properties_get_data( properties, "producer_pango", NULL );
mlt_producer producer = &this->parent;
// Obtain the producer properties
- mlt_properties producer_props = mlt_producer_properties( producer );
+ mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
// Get producer properties
char *fg = mlt_properties_get( producer_props, "fgcolour" );
static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
*width = mlt_properties_get_int( properties, "rescale_width" );
*height = mlt_properties_get_int( properties, "rescale_height" );
// Determine format
//mlt_producer this = mlt_properties_get_data( properties, "producer_pango", NULL );
- //*format = ( mlt_properties_get_int( mlt_producer_properties( this ), "bpp" ) == 4 ) ? mlt_image_rgb24a : mlt_image_rgb24;
+ //*format = ( mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( this ), "bpp" ) == 4 ) ? mlt_image_rgb24a : mlt_image_rgb24;
// May need to know the size of the image to clone it
int size = 0;
static uint8_t *producer_get_alpha_mask( mlt_frame this )
{
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Return the alpha mask
return mlt_properties_get_data( properties, "alpha", NULL );
*frame = mlt_frame_init( );
// Obtain properties of frame and producer
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
// Set the producer on the frame properties
mlt_properties_set_data( properties, "producer_pango", this, 0, NULL, NULL );
mlt_producer producer = &this->parent;
// Get the properties interface
- mlt_properties properties = mlt_producer_properties( &this->parent );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( &this->parent );
// Callback registration
producer->get_frame = producer_get_frame;
GError *error = NULL;
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Obtain the producer for this frame
producer_pixbuf this = mlt_properties_get_data( properties, "producer_pixbuf", NULL );
mlt_producer producer = &this->parent;
// Obtain properties of producer
- mlt_properties producer_props = mlt_producer_properties( producer );
+ mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
// Get the time to live for each frame
double ttl = mlt_properties_get_int( producer_props, "ttl" );
static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
*width = mlt_properties_get_int( properties, "rescale_width" );
*height = mlt_properties_get_int( properties, "rescale_height" );
static uint8_t *producer_get_alpha_mask( mlt_frame this )
{
// Obtain properties of frame
- mlt_properties properties = mlt_frame_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( this );
// Return the alpha mask
return mlt_properties_get_data( properties, "alpha", NULL );
// Get the real structure for this producer
producer_pixbuf this = producer->child;
- if ( this->count == 0 && mlt_properties_get( mlt_producer_properties( producer ), "resource" ) != NULL )
+ if ( this->count == 0 && mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "resource" ) != NULL )
{
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
char *filename = mlt_properties_get( properties, "resource" );
// Read xml string
if ( *frame != NULL && this->count > 0 )
{
// Obtain properties of frame and producer
- mlt_properties properties = mlt_frame_properties( *frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );
// Determine if we're rendering for PAL or NTSC
int is_pal = mlt_properties_get_int( properties, "normalised_height" ) == 576;
if ( result != NULL )
{
- mlt_properties properties = mlt_producer_properties( result );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( result );
mlt_properties_set( properties, "resource", file );
}
else if ( type == 2 )
mlt_service_attach( ( mlt_service )mlt_producer_cut_parent( producer ), filter );
- properties = mlt_filter_properties( filter );
+ properties = MLT_FILTER_PROPERTIES( filter );
mlt_properties_inherit( properties, group );
}
}
mlt_playlist_repeat_clip( playlist, mlt_playlist_count( playlist ) - 1, repeat );
mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 );
producer = info.cut;
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
}
}
else if ( !strcmp( argv[ i ], "-split" ) )
mlt_playlist_split( playlist, mlt_playlist_count( playlist ) - 1, split );
mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 );
producer = info.cut;
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
}
}
else if ( !strcmp( argv[ i ], "-swap" ) )
mlt_playlist_move( playlist, mlt_playlist_count( playlist ) - 2, mlt_playlist_count( playlist ) - 1 );
mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 );
producer = info.cut;
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
}
}
else if ( !strcmp( argv[ i ], "-join" ) )
mlt_playlist_join( playlist, mlt_playlist_count( playlist ) - clips - 1, clips, 0 );
mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 );
producer = info.cut;
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
}
}
else if ( !strcmp( argv[ i ], "-remove" ) )
mlt_playlist_remove( playlist, mlt_playlist_count( playlist ) - 1 );
mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 );
producer = info.cut;
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
}
}
else if ( !strcmp( argv[ i ], "-mix" ) )
transition = mlt_factory_transition( id, arg );
if ( transition != NULL )
{
- properties = mlt_transition_properties( transition );
+ properties = MLT_TRANSITION_PROPERTIES( transition );
mlt_properties_inherit( properties, group );
mlt_field_plant_transition( field, transition, 0, 1 );
mlt_properties_set_position( properties, "in", 0 );
mlt_filter filter = create_filter( field, argv[ ++ i ], track );
if ( filter != NULL )
{
- properties = mlt_filter_properties( filter );
+ properties = MLT_FILTER_PROPERTIES( filter );
mlt_properties_inherit( properties, group );
}
}
mlt_transition transition = create_transition( field, argv[ ++ i ], track - 1 );
if ( transition != NULL )
{
- properties = mlt_transition_properties( transition );
+ properties = MLT_TRANSITION_PROPERTIES( transition );
mlt_properties_inherit( properties, group );
}
}
if ( producer != NULL && !mlt_producer_is_cut( producer ) )
mlt_playlist_append( playlist, producer );
producer = NULL;
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist ), track ++ );
+ mlt_multitrack_connect( multitrack, MLT_PLAYLIST_PRODUCER( playlist ), track ++ );
track_service( field, playlist, ( mlt_destructor )mlt_playlist_close );
playlist = mlt_playlist_init( );
if ( playlist != NULL )
{
- properties = mlt_playlist_properties( playlist );
+ properties = MLT_PLAYLIST_PROPERTIES( playlist );
if ( !strcmp( argv[ i ], "-hide-track" ) )
mlt_properties_set_int( properties, "hide", 3 );
else if ( !strcmp( argv[ i ], "-hide-video" ) )
producer = create_producer( field, argv[ i ] );
if ( producer != NULL )
{
- properties = mlt_producer_properties( producer );
+ properties = MLT_PRODUCER_PROPERTIES( producer );
mlt_properties_inherit( properties, group );
}
}
// We must have a playlist to connect
if ( mlt_playlist_count( playlist ) > 0 )
- mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist ), track );
+ mlt_multitrack_connect( multitrack, MLT_PLAYLIST_PRODUCER( playlist ), track );
- mlt_producer prod = mlt_tractor_producer( tractor );
+ mlt_producer prod = MLT_TRACTOR_PRODUCER( tractor );
mlt_producer_optimise( prod );
- mlt_properties props = mlt_tractor_properties( tractor );
+ mlt_properties props = MLT_TRACTOR_PROPERTIES( tractor );
mlt_properties_set_data( props, "group", group, 0, ( mlt_destructor )mlt_properties_close, NULL );
- mlt_properties_set_position( props, "length", mlt_producer_get_out( mlt_multitrack_producer( multitrack ) ) + 1 );
- mlt_producer_set_in_and_out( prod, 0, mlt_producer_get_out( mlt_multitrack_producer( multitrack ) ) );
- mlt_properties_set_double( props, "fps", mlt_producer_get_fps( mlt_multitrack_producer( multitrack ) ) );
+ mlt_properties_set_position( props, "length", mlt_producer_get_out( MLT_MULTITRACK_PRODUCER( multitrack ) ) + 1 );
+ mlt_producer_set_in_and_out( prod, 0, mlt_producer_get_out( MLT_MULTITRACK_PRODUCER( multitrack ) ) );
+ mlt_properties_set_double( props, "fps", mlt_producer_get_fps( MLT_MULTITRACK_PRODUCER( multitrack ) ) );
if ( title != NULL )
mlt_properties_set( props, "title", strchr( title, '/' ) ? strrchr( title, '/' ) + 1 : title );
static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties of the a frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
double gain = mlt_properties_get_double( properties, "volume.gain" );
double max_gain = mlt_properties_get_double( properties, "volume.max_gain" );
double limiter_level = 0.5; /* -6 dBFS */
mlt_filter this = mlt_properties_get_data( properties, "filter_volume", NULL );
// Get the properties from the filter
- mlt_properties filter_props = mlt_filter_properties( this );
+ mlt_properties filter_props = MLT_FILTER_PROPERTIES( this );
if ( mlt_properties_get( properties, "volume.limiter" ) != NULL )
limiter_level = mlt_properties_get_double( properties, "volume.limiter" );
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
- mlt_properties properties = mlt_frame_properties( frame );
- mlt_properties filter_props = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
+ mlt_properties filter_props = MLT_FILTER_PROPERTIES( this );
// Parse the gain property
if ( mlt_properties_get( properties, "gain" ) == NULL )
mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 );
if ( this != NULL && mlt_filter_init( this, NULL ) == 0 )
{
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
this->process = filter_process;
if ( arg != NULL )
mlt_properties_set( properties, "gain", arg );
mlt_filter filter = mlt_frame_pop_service( this );
// Get the properties
- mlt_properties properties = mlt_filter_properties( filter );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
// Get the image
int error = mlt_frame_get_image( this, image, format, width, height, 0 );
if ( producer != NULL && transition != NULL )
{
char *name = mlt_properties_get( properties, "_unique_id" );
- mlt_position position = mlt_properties_get_position( mlt_frame_properties( this ), name );
- mlt_properties frame_properties = mlt_frame_properties( this );
+ mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( this ), name );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( this );
mlt_producer_seek( producer, position );
mlt_frame_set_position( this, position );
- mlt_properties_pass( mlt_producer_properties( producer ), properties, "producer." );
- mlt_properties_pass( mlt_transition_properties( transition ), properties, "transition." );
- mlt_service_get_frame( mlt_producer_service( producer ), &a_frame, 0 );
- mlt_properties_set( mlt_frame_properties( a_frame ), "rescale.interp", "nearest" );
- mlt_properties_set( mlt_frame_properties( a_frame ), "distort", "true" );
- mlt_properties_set_double( mlt_frame_properties( a_frame ), "consumer_aspect_ratio",
+ mlt_properties_pass( MLT_PRODUCER_PROPERTIES( producer ), properties, "producer." );
+ mlt_properties_pass( MLT_TRANSITION_PROPERTIES( transition ), properties, "transition." );
+ mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &a_frame, 0 );
+ mlt_properties_set( MLT_FRAME_PROPERTIES( a_frame ), "rescale.interp", "nearest" );
+ mlt_properties_set( MLT_FRAME_PROPERTIES( a_frame ), "distort", "true" );
+ mlt_properties_set_double( MLT_FRAME_PROPERTIES( a_frame ), "consumer_aspect_ratio",
mlt_properties_get_double( frame_properties, "consumer_aspect_ratio" ) );
mlt_transition_process( transition, a_frame, this );
mlt_frame_get_image( a_frame, image, format, width, height, writable );
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
// Get the properties of the frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Get a unique name to store the frame position
- char *name = mlt_properties_get( mlt_filter_properties( this ), "_unique_id" );
+ char *name = mlt_properties_get( MLT_FILTER_PROPERTIES( this ), "_unique_id" );
// Assign the current position to the name
mlt_properties_set_position( properties, name, mlt_frame_get_position( frame ) - mlt_filter_get_in( this ) );
if ( this != NULL )
{
this->process = filter_process;
- mlt_properties_set( mlt_filter_properties( this ), "background", "colour:black" );
- mlt_properties_set( mlt_filter_properties( this ), "transition.rotate_x", "10" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "background", "colour:black" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "transition.rotate_x", "10" );
}
return this;
}
if ( error == 0 && *format == mlt_image_yuv422 )
{
// Get the charcoal scatter value
- int x_scatter = mlt_properties_get_double( mlt_filter_properties( filter ), "x_scatter" );
- int y_scatter = mlt_properties_get_double( mlt_filter_properties( filter ), "y_scatter" );
- float scale = mlt_properties_get_double( mlt_filter_properties( filter ), "scale" );
- float mix = mlt_properties_get_double( mlt_filter_properties( filter ), "mix" );
- int invert = mlt_properties_get_int( mlt_filter_properties( filter ), "invert" );
+ int x_scatter = mlt_properties_get_double( MLT_FILTER_PROPERTIES( filter ), "x_scatter" );
+ int y_scatter = mlt_properties_get_double( MLT_FILTER_PROPERTIES( filter ), "y_scatter" );
+ float scale = mlt_properties_get_double( MLT_FILTER_PROPERTIES( filter ), "scale" );
+ float mix = mlt_properties_get_double( MLT_FILTER_PROPERTIES( filter ), "mix" );
+ int invert = mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "invert" );
// We'll process pixel by pixel
int x = 0;
*image = temp;
// Store new and destroy old
- mlt_properties_set_data( mlt_frame_properties( this ), "image", *image, *width * *height * 2, mlt_pool_release, NULL );
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "image", *image, *width * *height * 2, mlt_pool_release, NULL );
}
return error;
if ( this != NULL )
{
this->process = filter_process;
- mlt_properties_set( mlt_filter_properties( this ), "x_scatter", "1" );
- mlt_properties_set( mlt_filter_properties( this ), "y_scatter", "1" );
- mlt_properties_set( mlt_filter_properties( this ), "scale", "1.5" );
- mlt_properties_set( mlt_filter_properties( this ), "mix", "0" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "x_scatter", "1" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "y_scatter", "1" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "scale", "1.5" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "mix", "0" );
}
return this;
}
uint8_t *q = *image + *height * *width * 2;
// Get u and v values
- int u = mlt_properties_get_int( mlt_filter_properties( filter ), "u" );
- int v = mlt_properties_get_int( mlt_filter_properties( filter ), "v" );
+ int u = mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "u" );
+ int v = mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "v" );
// Loop through image
while ( p != q )
if ( this != NULL )
{
this->process = filter_process;
- mlt_properties_set( mlt_filter_properties( this ), "u", "75" );
- mlt_properties_set( mlt_filter_properties( this ), "v", "150" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "u", "75" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "v", "150" );
}
return this;
}
int i = 0;
// Get the properties of the transition
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// Get the in and out position
mlt_position in = mlt_transition_get_in( this );
struct geometry_s *composite_calculate( struct geometry_s *result, mlt_transition this, mlt_frame a_frame, float position )
{
// Get the properties from the transition
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// Get the properties from the frame
- mlt_properties a_props = mlt_frame_properties( a_frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( a_frame );
// Structures for geometry
struct geometry_s *start = mlt_properties_get_data( properties, "geometries", NULL );
mlt_transition this = mlt_frame_pop_service( a_frame );
// Get the properties of the transition
- mlt_properties properties = mlt_transition_properties( this );
+ mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// Get the properties of the a frame
- mlt_properties a_props = mlt_frame_properties( a_frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( a_frame );
// Get the properties of the b frame
- mlt_properties b_props = mlt_frame_properties( b_frame );
+ mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
// Image, format, width, height and image for the b frame
uint8_t *b_image = NULL;
static mlt_frame transition_process( mlt_transition transition, mlt_frame a_frame, mlt_frame b_frame )
{
// Get a unique name to store the frame position
- char *name = mlt_properties_get( mlt_transition_properties( transition ), "_unique_id" );
+ char *name = mlt_properties_get( MLT_TRANSITION_PROPERTIES( transition ), "_unique_id" );
// Assign the current position to the name
- mlt_properties a_props = mlt_frame_properties( a_frame );
+ mlt_properties a_props = MLT_FRAME_PROPERTIES( a_frame );
mlt_properties_set_position( a_props, name, mlt_frame_get_position( a_frame ) );
// Push the transition on to the frame
mlt_transition transition = mlt_transition_new( );
if ( transition != NULL )
{
- mlt_properties_set_int( mlt_transition_properties( transition ), "sx", 1 );
- mlt_properties_set_int( mlt_transition_properties( transition ), "sy", 1 );
- mlt_properties_set( mlt_transition_properties( transition ), "distort", NULL );
- mlt_properties_set( mlt_transition_properties( transition ), "start", "0,0:100%x100%" );
+ mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "sx", 1 );
+ mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "sy", 1 );
+ mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "distort", NULL );
+ mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "start", "0,0:100%x100%" );
transition->process = transition_process;
}
return transition;
static int resample_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties of the frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Get the filter service
mlt_filter filter = mlt_frame_pop_audio( frame );
// Get the filter properties
- mlt_properties filter_properties = mlt_filter_properties( filter );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
// Get the resample information
int output_rate = mlt_properties_get_int( filter_properties, "frequency" );
void *output_buffer = mlt_pool_alloc( BUFFER_LEN );
this->process = filter_process;
if ( arg != NULL )
- mlt_properties_set_int( mlt_filter_properties( this ), "frequency", atoi( arg ) );
- mlt_properties_set_int( mlt_filter_properties( this ), "channels", 2 );
- mlt_properties_set_data( mlt_filter_properties( this ), "state", state, 0, (mlt_destructor)src_delete, NULL );
- mlt_properties_set_data( mlt_filter_properties( this ), "input_buffer", input_buffer, BUFFER_LEN, mlt_pool_release, NULL );
- mlt_properties_set_data( mlt_filter_properties( this ), "output_buffer", output_buffer, BUFFER_LEN, mlt_pool_release, NULL );
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES( this ), "frequency", atoi( arg ) );
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES( this ), "channels", 2 );
+ mlt_properties_set_data( MLT_FILTER_PROPERTIES( this ), "state", state, 0, (mlt_destructor)src_delete, NULL );
+ mlt_properties_set_data( MLT_FILTER_PROPERTIES( this ), "input_buffer", input_buffer, BUFFER_LEN, mlt_pool_release, NULL );
+ mlt_properties_set_data( MLT_FILTER_PROPERTIES( this ), "output_buffer", output_buffer, BUFFER_LEN, mlt_pool_release, NULL );
}
else
{
parent->close = consumer_close;
// get a handle on properties
- mlt_service service = mlt_consumer_service( parent );
- this->properties = mlt_service_properties( service );
+ mlt_service service = MLT_CONSUMER_SERVICE( parent );
+ this->properties = MLT_SERVICE_PROPERTIES( service );
// Set the default volume
mlt_properties_set_double( this->properties, "volume", 1.0 );
if ( init_audio == 0 )
{
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
bytes = ( samples * channels * 2 );
pthread_mutex_lock( &this->audio_mutex );
while ( this->running && bytes > ( sizeof( this->audio_buffer) - this->audio_avail ) )
pthread_mutex_unlock( &this->video_mutex );
// Get the properties
- properties = mlt_frame_properties( next );
+ properties = MLT_FRAME_PROPERTIES( next );
// Get the speed of the frame
speed = mlt_properties_get_double( properties, "_speed" );
this->bpp = mlt_properties_get_int( this->properties, "bpp" );
- if ( mlt_properties_get_int( mlt_consumer_properties( consumer ), "sdl_started" ) == 0 )
+ if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "sdl_started" ) == 0 )
{
if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE ) < 0 )
{
}
}
- if ( !mlt_properties_get_int( mlt_consumer_properties( consumer ), "audio_off" ) )
+ if ( !mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "audio_off" ) )
SDL_InitSubSystem( SDL_INIT_AUDIO );
// Loop until told not to
if ( frame != NULL )
{
// Get the frame properties
- properties = mlt_frame_properties( frame );
+ properties = MLT_FRAME_PROPERTIES( frame );
// Play audio
init_audio = consumer_play_audio( this, frame, init_audio, &duration );
if ( this->sdl_overlay != NULL )
SDL_FreeYUVOverlay( this->sdl_overlay );
- if ( !mlt_properties_get_int( mlt_consumer_properties( consumer ), "audio_off" ) )
+ if ( !mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "audio_off" ) )
SDL_QuitSubSystem( SDL_INIT_AUDIO );
- if ( mlt_properties_get_int( mlt_consumer_properties( consumer ), "sdl_started" ) == 0 )
+ if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "sdl_started" ) == 0 )
SDL_Quit( );
while( mlt_deque_count( this->queue ) )
mlt_consumer parent = &this->parent;
// Get the properties
- mlt_properties properties = mlt_consumer_properties( parent );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( parent );
// Get the width and height
int width = mlt_properties_get_int( properties, "width" );
// Create child consumers
this->play = mlt_factory_consumer( "sdl", arg );
this->still = mlt_factory_consumer( "sdl_still", arg );
- mlt_properties_set( mlt_consumer_properties( parent ), "real_time", "0" );
- mlt_properties_set( mlt_consumer_properties( parent ), "rescale", "nearest" );
+ mlt_properties_set( MLT_CONSUMER_PROPERTIES( parent ), "real_time", "0" );
+ mlt_properties_set( MLT_CONSUMER_PROPERTIES( parent ), "rescale", "nearest" );
parent->close = consumer_close;
parent->start = consumer_start;
parent->stop = consumer_stop;
parent->is_stopped = consumer_is_stopped;
this->joined = 1;
- mlt_events_listen( mlt_consumer_properties( this->play ), this, "consumer-frame-show", ( mlt_listener )consumer_frame_show_cb );
- mlt_events_listen( mlt_consumer_properties( this->still ), this, "consumer-frame-show", ( mlt_listener )consumer_frame_show_cb );
- mlt_events_listen( mlt_consumer_properties( this->play ), this, "consumer-sdl-event", ( mlt_listener )consumer_sdl_event_cb );
- mlt_events_listen( mlt_consumer_properties( this->still ), this, "consumer-sdl-event", ( mlt_listener )consumer_sdl_event_cb );
+ mlt_events_listen( MLT_CONSUMER_PROPERTIES( this->play ), this, "consumer-frame-show", ( mlt_listener )consumer_frame_show_cb );
+ mlt_events_listen( MLT_CONSUMER_PROPERTIES( this->still ), this, "consumer-frame-show", ( mlt_listener )consumer_frame_show_cb );
+ mlt_events_listen( MLT_CONSUMER_PROPERTIES( this->play ), this, "consumer-sdl-event", ( mlt_listener )consumer_sdl_event_cb );
+ mlt_events_listen( MLT_CONSUMER_PROPERTIES( this->still ), this, "consumer-sdl-event", ( mlt_listener )consumer_sdl_event_cb );
return parent;
}
free( this );
void consumer_frame_show_cb( mlt_consumer sdl, mlt_consumer parent, mlt_frame frame )
{
consumer_sdl this = parent->child;
- this->last_speed = mlt_properties_get_double( mlt_frame_properties( frame ), "_speed" );
- mlt_events_fire( mlt_consumer_properties( parent ), "consumer-frame-show", frame, NULL );
+ this->last_speed = mlt_properties_get_double( MLT_FRAME_PROPERTIES( frame ), "_speed" );
+ mlt_events_fire( MLT_CONSUMER_PROPERTIES( parent ), "consumer-frame-show", frame, NULL );
}
static void consumer_sdl_event_cb( mlt_consumer sdl, mlt_consumer parent, SDL_Event *event )
{
- mlt_events_fire( mlt_consumer_properties( parent ), "consumer-sdl-event", event, NULL );
+ mlt_events_fire( MLT_CONSUMER_PROPERTIES( parent ), "consumer-sdl-event", event, NULL );
}
static int consumer_start( mlt_consumer parent )
if ( this->joined == 0 )
{
- mlt_properties properties = mlt_consumer_properties( parent );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( parent );
int app_locked = mlt_properties_get_int( properties, "app_locked" );
void ( *lock )( void ) = mlt_properties_get_data( properties, "app_lock", NULL );
void ( *unlock )( void ) = mlt_properties_get_data( properties, "app_unlock", NULL );
// Kill the thread and clean up
this->running = 0;
+ if ( this->play ) mlt_consumer_stop( this->play );
+ if ( this->still ) mlt_consumer_stop( this->still );
+
pthread_join( this->thread, NULL );
this->joined = 1;
mlt_frame frame = NULL;
// properties
- mlt_properties properties = mlt_consumer_properties( consumer );
- mlt_properties play = mlt_consumer_properties( this->play );
- mlt_properties still = mlt_consumer_properties( this->still );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
+ mlt_properties play = MLT_CONSUMER_PROPERTIES( this->play );
+ mlt_properties still = MLT_CONSUMER_PROPERTIES( this->still );
if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE ) < 0 )
{
mlt_properties_set_int( play, "progressive", 1 );
mlt_properties_set_int( still, "progressive", 1 );
- mlt_properties_pass( play, mlt_consumer_properties( consumer ), "play." );
- mlt_properties_pass( still, mlt_consumer_properties( consumer ), "still." );
+ mlt_properties_pass( play, MLT_CONSUMER_PROPERTIES( consumer ), "play." );
+ mlt_properties_pass( still, MLT_CONSUMER_PROPERTIES( consumer ), "still." );
mlt_properties_set_data( play, "app_lock", mlt_properties_get_data( properties, "app_lock", NULL ), 0, NULL, NULL );
mlt_properties_set_data( still, "app_lock", mlt_properties_get_data( properties, "app_lock", NULL ), 0, NULL, NULL );
if ( frame != NULL )
{
// Get the speed of the frame
- double speed = mlt_properties_get_double( mlt_frame_properties( frame ), "_speed" );
+ double speed = mlt_properties_get_double( MLT_FRAME_PROPERTIES( frame ), "_speed" );
// Determine which speed to use
double use_speed = first ? speed : this->last_speed;
mlt_properties_set_int( properties, "changed", 0 );
// Set the changed property on this frame for the benefit of still
- mlt_properties_set_int( mlt_frame_properties( frame ), "refresh", refresh );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "refresh", refresh );
// Make sure the recipient knows that this frame isn't really rendered
- mlt_properties_set_int( mlt_frame_properties( frame ), "rendered", 0 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 0 );
// If we're not the first frame and both consumers are stopped, then stop ourselves
if ( !first && mlt_consumer_is_stopped( this->play ) && mlt_consumer_is_stopped( this->still ) )
// Copy the rectangle info from the active consumer
if ( this->running )
{
- mlt_properties active = mlt_consumer_properties( this->active );
+ mlt_properties active = MLT_CONSUMER_PROPERTIES( this->active );
mlt_properties_set_int( properties, "rect_x", mlt_properties_get_int( active, "rect_x" ) );
mlt_properties_set_int( properties, "rect_y", mlt_properties_get_int( active, "rect_y" ) );
mlt_properties_set_int( properties, "rect_w", mlt_properties_get_int( active, "rect_w" ) );
parent->close = consumer_close;
// get a handle on properties
- mlt_service service = mlt_consumer_service( parent );
- this->properties = mlt_service_properties( service );
+ mlt_service service = MLT_CONSUMER_SERVICE( parent );
+ this->properties = MLT_SERVICE_PROPERTIES( service );
// Default scaler (for now we'll use nearest)
mlt_properties_set( this->properties, "rescale", "nearest" );
if ( !this->filtered )
{
mlt_filter filter = mlt_factory_filter( "avcolour_space", NULL );
- mlt_properties_set_int( mlt_filter_properties( filter ), "forced", mlt_image_yuv422 );
- mlt_service_attach( mlt_consumer_service( &this->parent ), filter );
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "forced", mlt_image_yuv422 );
+ mlt_service_attach( MLT_CONSUMER_SERVICE( parent ), filter );
mlt_filter_close( filter );
this->filtered = 1;
}
}
else
{
- changed = mlt_properties_get_int( properties, "changed" ) | mlt_properties_get_int( mlt_frame_properties( frame ), "refresh" );
+ changed = mlt_properties_get_int( properties, "changed" ) | mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "refresh" );
mlt_properties_set_int( properties, "changed", 0 );
}
if ( changed == 0 &&
this->last_position == mlt_frame_get_position( frame ) &&
- this->last_producer == mlt_properties_get_data( mlt_frame_properties( frame ), "_producer", NULL ) )
+ this->last_producer == mlt_properties_get_data( MLT_FRAME_PROPERTIES( frame ), "_producer", NULL ) )
{
sdl_unlock_display( );
if ( unlock != NULL )
// Update last frame shown info
this->last_position = mlt_frame_get_position( frame );
- this->last_producer = mlt_properties_get_data( mlt_frame_properties( frame ), "_producer", NULL );
+ this->last_producer = mlt_properties_get_data( MLT_FRAME_PROPERTIES( frame ), "_producer", NULL );
// Get the image, width and height
if ( image == NULL )
// Something? (or everything?) is too sensitive to aspect ratio
//width = this->rect.w;
//height = this->rect.h;
- //mlt_properties_set( mlt_frame_properties( frame ), "distort", "true" );
- //mlt_properties_set_int( mlt_frame_properties( frame ), "normalised_width", width );
- //mlt_properties_set_int( mlt_frame_properties( frame ), "normalised_height", height );
+ //mlt_properties_set( MLT_FRAME_PROPERTIES( frame ), "distort", "true" );
+ //mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "normalised_width", width );
+ //mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "normalised_height", height );
mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
}
mlt_properties_set_int( this->properties, "rect_h", this->rect.h );
}
- if ( this->sdl_screen != NULL )
+ if ( !mlt_consumer_is_stopped( &this->parent ) && this->sdl_screen != NULL && this->sdl_screen->pixels != NULL )
{
memset( this->sdl_screen->pixels, 0, this->window_width * this->window_height * this->sdl_screen->format->BytesPerPixel );
// internal intialization
mlt_frame frame = NULL;
- struct timespec tm = { 0, 10000000 };
+ struct timespec tm = { 0, 99999999 };
- if ( mlt_properties_get_int( mlt_consumer_properties( consumer ), "sdl_started" ) == 0 )
+ if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "sdl_started" ) == 0 )
{
if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE ) < 0 )
{
}
else
{
- mlt_properties_set_int( mlt_consumer_properties( consumer ), "changed", 2 );
+ mlt_properties_set_int( MLT_CONSUMER_PROPERTIES( consumer ), "changed", 2 );
if ( SDL_GetVideoSurface( ) != NULL )
{
this->sdl_screen = SDL_GetVideoSurface( );
consumer_get_dimensions( &this->window_width, &this->window_height );
- mlt_properties_set_int( mlt_consumer_properties( consumer ), "changed", 0 );
+ mlt_properties_set_int( MLT_CONSUMER_PROPERTIES( consumer ), "changed", 0 );
}
}
}
}
- if ( mlt_properties_get_int( mlt_consumer_properties( consumer ), "sdl_started" ) == 0 )
+ if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "sdl_started" ) == 0 )
SDL_Quit( );
this->sdl_screen = NULL;
sprintf( id, "_effect_%d_%d", count, channel );
// Save the effect state
- mlt_properties_set_data( mlt_filter_properties( this ), id, eff, 0, mlt_pool_release, NULL );
+ mlt_properties_set_data( MLT_FILTER_PROPERTIES( this ), id, eff, 0, mlt_pool_release, NULL );
error = 0;
}
}
static int filter_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties of the frame
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Get the filter service
mlt_filter filter = mlt_frame_pop_audio( frame );
// Get the filter properties
- mlt_properties filter_properties = mlt_filter_properties( filter );
+ mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
// Get the properties
st_sample_t *input_buffer = mlt_properties_get_data( filter_properties, "input_buffer", NULL );
frame->get_audio = filter_get_audio;
// Parse the window property and allocate smoothing buffer if needed
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
int window = mlt_properties_get_int( properties, "window" );
if ( mlt_properties_get( properties, "smooth_buffer" ) == NULL && window > 1 )
{
{
void *input_buffer = mlt_pool_alloc( BUFFER_LEN );
void *output_buffer = mlt_pool_alloc( BUFFER_LEN );
- mlt_properties properties = mlt_filter_properties( this );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( this );
this->process = filter_process;
{
char *temp = NULL;
int port = atoi( strchr( arg, ':' ) + 1 );
- mlt_properties_set( mlt_consumer_properties( this ), "server", arg );
- temp = mlt_properties_get( mlt_consumer_properties( this ), "server" );
+ mlt_properties_set( MLT_CONSUMER_PROPERTIES( this ), "server", arg );
+ temp = mlt_properties_get( MLT_CONSUMER_PROPERTIES( this ), "server" );
*( strchr( temp, ':' ) ) = '\0';
- mlt_properties_set_int( mlt_consumer_properties( this ), "port", port );
+ mlt_properties_set_int( MLT_CONSUMER_PROPERTIES( this ), "port", port );
}
else
{
- mlt_properties_set( mlt_consumer_properties( this ), "server", arg == NULL ? "localhost" : arg );
- mlt_properties_set_int( mlt_consumer_properties( this ), "port", 5250 );
+ mlt_properties_set( MLT_CONSUMER_PROPERTIES( this ), "server", arg == NULL ? "localhost" : arg );
+ mlt_properties_set_int( MLT_CONSUMER_PROPERTIES( this ), "port", 5250 );
}
- mlt_properties_set_int( mlt_consumer_properties( this ), "unit", 0 );
- mlt_properties_set( mlt_consumer_properties( this ), "command", "append" );
+ mlt_properties_set_int( MLT_CONSUMER_PROPERTIES( this ), "unit", 0 );
+ mlt_properties_set( MLT_CONSUMER_PROPERTIES( this ), "command", "append" );
// Allow thread to be started/stopped
this->start = consumer_start;
static int consumer_start( mlt_consumer this )
{
// Get the producer service
- mlt_service service = mlt_service_producer( mlt_consumer_service( this ) );
+ mlt_service service = mlt_service_producer( MLT_CONSUMER_SERVICE( this ) );
// Get the properties object
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
// Get all the properties now
char *server = mlt_properties_get( properties, "server" );
if ( service != NULL )
{
if ( title != NULL )
- mlt_properties_set( mlt_service_properties( service ), "title", title );
- else if ( mlt_properties_get( mlt_service_properties( service ), "title" ) == NULL )
- mlt_properties_set( mlt_service_properties( service ), "title", "Anonymous Submission" );
- title = mlt_properties_get( mlt_service_properties( service ), "title" );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), "title", title );
+ else if ( mlt_properties_get( MLT_SERVICE_PROPERTIES( service ), "title" ) == NULL )
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), "title", "Anonymous Submission" );
+ title = mlt_properties_get( MLT_SERVICE_PROPERTIES( service ), "title" );
}
strcpy( command, cmd == NULL ? "" : cmd );
if ( mlt_producer_init( this, NULL ) == 0 )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Set the resource property (required for all producers)
mlt_properties_set( properties, "resource", file );
if ( error == 0 )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Assign the ov structure
mlt_properties_set_data( properties, "ogg_vorbis_file", ov, 0, producer_file_close, NULL );
static double producer_time_of_frame( mlt_producer this, mlt_position position )
{
// Get the properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Obtain the fps
double fps = mlt_properties_get_double( properties, "fps" );
static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples )
{
// Get the properties from the frame
- mlt_properties frame_properties = mlt_frame_properties( frame );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
// Obtain the frame number of this frame
mlt_position position = mlt_properties_get_position( frame_properties, "vorbis_position" );
mlt_producer this = mlt_properties_get_data( frame_properties, "vorbis_producer", NULL );
// Get the producer properties
- mlt_properties properties = mlt_producer_properties( this );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
// Get the ogg vorbis file
OggVorbis_File *ov = mlt_properties_get_data( properties, "ogg_vorbis_file", NULL );
static void producer_set_up_audio( mlt_producer this, mlt_frame frame )
{
// Get the properties
- mlt_properties properties = mlt_frame_properties( frame );
+ mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
// Set the audio method
frame->get_audio = producer_get_audio;
mlt_frame_set_position( *frame, mlt_producer_position( this ) );
// Set the position of this producer
- mlt_properties_set_position( mlt_frame_properties( *frame ), "vorbis_position", mlt_producer_position( this ) );
+ mlt_properties_set_position( MLT_FRAME_PROPERTIES( *frame ), "vorbis_position", mlt_producer_position( this ) );
// Set up the audio
producer_set_up_audio( this, *frame );
if ( i >= mlt_properties_count( map ) && type != westley_existing )
{
// Attempt to reuse existing id
- id = mlt_properties_get( mlt_service_properties( service ), "id" );
+ id = mlt_properties_get( MLT_SERVICE_PROPERTIES( service ), "id" );
// If no id, or the id is used in the map (for another service), then
// create a new one.
this->start = consumer_start;
this->is_stopped = consumer_is_stopped;
- mlt_properties_set( mlt_consumer_properties( this ), "resource", arg );
+ mlt_properties_set( MLT_CONSUMER_PROPERTIES( this ), "resource", arg );
// Return the consumer produced
return this;
return NULL;
}
-static inline void serialise_properties( serialise_context context, mlt_properties properties, xmlNode *node )
+static void serialise_properties( serialise_context context, mlt_properties properties, xmlNode *node )
{
int i;
xmlNode *p;
}
}
-static inline void serialise_store_properties( serialise_context context, mlt_properties properties, xmlNode *node )
+static void serialise_store_properties( serialise_context context, mlt_properties properties, xmlNode *node, char *store )
{
int i;
xmlNode *p;
// Enumerate the properties
- for ( i = 0; context->store != NULL && i < mlt_properties_count( properties ); i++ )
+ for ( i = 0; store != NULL && i < mlt_properties_count( properties ); i++ )
{
char *name = mlt_properties_get_name( properties, i );
- if ( !strncmp( name, context->store, strlen( context->store ) ) )
+ if ( !strncmp( name, store, strlen( store ) ) )
{
char *value = mlt_properties_get_value( properties, i );
if ( value != NULL )
// Enumerate the filters
for ( i = 0; ( filter = mlt_producer_filter( MLT_PRODUCER( service ), i ) ) != NULL; i ++ )
{
- mlt_properties properties = mlt_filter_properties( filter );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
if ( mlt_properties_get_int( properties, "_fezzik" ) == 0 )
{
// Get a new id - if already allocated, do nothing
- char *id = westley_get_id( context, mlt_filter_service( filter ), westley_filter );
+ char *id = westley_get_id( context, MLT_FILTER_SERVICE( filter ), westley_filter );
if ( id != NULL )
{
int in = mlt_properties_get_position( properties, "in" );
xmlNewProp( p, "out", temp );
}
serialise_properties( context, properties, p );
- serialise_service_filters( context, mlt_filter_service( filter ), p );
+ serialise_service_filters( context, MLT_FILTER_SERVICE( filter ), p );
}
}
}
if ( context->pass == 0 )
{
- mlt_properties properties = mlt_service_properties( parent );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( parent );
// Get a new id - if already allocated, do nothing
char *id = westley_get_id( context, parent, westley_producer );
if ( id == NULL )
else
{
char *id = westley_get_id( context, parent, westley_existing );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
xmlNewProp( node, "parent", id );
xmlNewProp( node, "in", mlt_properties_get( properties, "in" ) );
xmlNewProp( node, "out", mlt_properties_get( properties, "out" ) );
xmlNode *track = xmlNewChild( node, NULL, "track", NULL );
int hide = 0;
mlt_producer producer = mlt_multitrack_track( MLT_MULTITRACK( service ), i );
- mlt_properties properties = mlt_producer_properties( producer );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
mlt_service parent = MLT_SERVICE( mlt_producer_cut_parent( producer ) );
char *id = westley_get_id( context, MLT_SERVICE( parent ), westley_existing );
xmlNewProp( track, "producer", id );
- if ( mlt_properties_get_int( properties, "_cut" ) == 1 )
+ if ( mlt_producer_is_cut( producer ) )
{
xmlNewProp( track, "in", mlt_properties_get( properties, "in" ) );
xmlNewProp( track, "out", mlt_properties_get( properties, "out" ) );
+ serialise_store_properties( context, MLT_PRODUCER_PROPERTIES( producer ), track, context->store );
+ serialise_store_properties( context, MLT_PRODUCER_PROPERTIES( producer ), track, "meta." );
+ serialise_service_filters( context, MLT_PRODUCER_SERVICE( producer ), track );
}
hide = mlt_properties_get_int( context->hide_map, id );
int i;
xmlNode *child = node;
mlt_playlist_clip_info info;
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
if ( context->pass == 0 )
{
if ( info.producer != NULL )
{
mlt_producer producer = mlt_producer_cut_parent( info.producer );
- char *service_s = mlt_properties_get( mlt_producer_properties( producer ), "mlt_service" );
- char *resource_s = mlt_properties_get( mlt_producer_properties( producer ), "resource" );
+ char *service_s = mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "mlt_service" );
+ char *resource_s = mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "resource" );
if ( resource_s != NULL && !strcmp( resource_s, "<playlist>" ) )
serialise_playlist( context, MLT_SERVICE( producer ), node );
else if ( service_s != NULL && strcmp( service_s, "blank" ) != 0 )
xmlNewProp( child, "id", id );
// Store application specific properties
- serialise_store_properties( context, properties, child );
+ serialise_store_properties( context, properties, child, context->store );
+ serialise_store_properties( context, properties, child, "meta." );
// Add producer to the map
mlt_properties_set_int( context->hide_map, id, mlt_properties_get_int( properties, "hide" ) );
if ( ! mlt_playlist_get_clip_info( MLT_PLAYLIST( service ), &info, i ) )
{
mlt_producer producer = mlt_producer_cut_parent( info.producer );
- char *service_s = mlt_properties_get( mlt_producer_properties( producer ), "mlt_service" );
+ char *service_s = mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "mlt_service" );
if ( service_s != NULL && strcmp( service_s, "blank" ) == 0 )
{
char length[ 20 ];
xmlNewProp( entry, "repeat", temp );
}
if ( mlt_producer_is_cut( info.cut ) )
- serialise_service_filters( context, mlt_producer_service( info.cut ), entry );
+ {
+ serialise_store_properties( context, MLT_PRODUCER_PROPERTIES( info.cut ), entry, context->store );
+ serialise_store_properties( context, MLT_PRODUCER_PROPERTIES( info.cut ), entry, "meta." );
+ serialise_service_filters( context, MLT_PRODUCER_SERVICE( info.cut ), entry );
+ }
}
}
}
static void serialise_tractor( serialise_context context, mlt_service service, xmlNode *node )
{
xmlNode *child = node;
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
if ( context->pass == 0 )
{
xmlNewProp( child, "out", mlt_properties_get( properties, "out" ) );
// Store application specific properties
- serialise_store_properties( context, mlt_service_properties( service ), child );
+ serialise_store_properties( context, MLT_SERVICE_PROPERTIES( service ), child, context->store );
+ serialise_store_properties( context, MLT_SERVICE_PROPERTIES( service ), child, "meta." );
// Recurse on connected producer
serialise_service( context, mlt_service_producer( service ), child );
static void serialise_filter( serialise_context context, mlt_service service, xmlNode *node )
{
xmlNode *child = node;
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
// Recurse on connected producer
serialise_service( context, mlt_service_producer( service ), node );
static void serialise_transition( serialise_context context, mlt_service service, xmlNode *node )
{
xmlNode *child = node;
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
// Recurse on connected producer
serialise_service( context, MLT_SERVICE( MLT_TRANSITION( service )->producer ), node );
// Iterate over consumer/producer connections
while ( service != NULL )
{
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
char *mlt_type = mlt_properties_get( properties, "mlt_type" );
// Tell about the producer
xmlDocPtr westley_make_doc( mlt_consumer consumer, mlt_service service )
{
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
xmlDocPtr doc = xmlNewDoc( "1.0" );
xmlNodePtr root = xmlNewNode( NULL, "westley" );
struct serialise_context_s *context = calloc( 1, sizeof( struct serialise_context_s ) );
}
// Assign the additional 'storage' pattern for properties
- context->store = mlt_properties_get( mlt_consumer_properties( consumer ), "store" );
+ context->store = mlt_properties_get( MLT_CONSUMER_PROPERTIES( consumer ), "store" );
// Assign a title property
if ( mlt_properties_get( properties, "title" ) != NULL )
context->hide_map = mlt_properties_new();
// Ensure producer is a framework producer
- mlt_properties_set( mlt_service_properties( service ), "mlt_type", "mlt_producer" );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), "mlt_type", "mlt_producer" );
// In pass one, we serialise the end producers and playlists,
// adding them to a map keyed by address.
xmlDocPtr doc = NULL;
// Get the producer service
- mlt_service service = mlt_service_producer( mlt_consumer_service( this ) );
+ mlt_service service = mlt_service_producer( MLT_CONSUMER_SERVICE( this ) );
if ( service != NULL )
{
- mlt_properties properties = mlt_consumer_properties( this );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( this );
char *resource = mlt_properties_get( properties, "resource" );
// Set the title if provided
if ( mlt_properties_get( properties, "title" ) )
- mlt_properties_set( mlt_service_properties( service ), "title", mlt_properties_get( properties, "title" ) );
- else if ( mlt_properties_get( mlt_service_properties( service ), "title" ) == NULL )
- mlt_properties_set( mlt_service_properties( service ), "title", "Anonymous Submission" );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), "title", mlt_properties_get( properties, "title" ) );
+ else if ( mlt_properties_get( MLT_SERVICE_PROPERTIES( service ), "title" ) == NULL )
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), "title", "Anonymous Submission" );
// Check for a root on the consumer properties and pass to service
if ( mlt_properties_get( properties, "root" ) )
- mlt_properties_set( mlt_service_properties( service ), "root", mlt_properties_get( properties, "root" ) );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), "root", mlt_properties_get( properties, "root" ) );
// Specify roots in other cases...
if ( resource != NULL && mlt_properties_get( properties, "root" ) == NULL )
{
// Get the current working directory
char *cwd = getcwd( NULL, 0 );
- mlt_properties_set( mlt_service_properties( service ), "root", cwd );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), "root", cwd );
free( cwd );
}
this->stack_types[ this->stack_service_size++ ] = type;
// Record the tree branch on which this service lives
- if ( that != NULL && mlt_properties_get( mlt_service_properties( that ), "_westley_branch" ) == NULL )
+ if ( that != NULL && mlt_properties_get( MLT_SERVICE_PROPERTIES( that ), "_westley_branch" ) == NULL )
{
char s[ BRANCH_SIG_LEN ];
- mlt_properties_set( mlt_service_properties( that ), "_westley_branch", serialise_branch( this, s ) );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( that ), "_westley_branch", serialise_branch( this, s ) );
}
}
return ret;
if ( service != NULL && container != NULL )
{
- char *container_branch = mlt_properties_get( mlt_service_properties( container ), "_westley_branch" );
- char *service_branch = mlt_properties_get( mlt_service_properties( service ), "_westley_branch" );
+ char *container_branch = mlt_properties_get( MLT_SERVICE_PROPERTIES( container ), "_westley_branch" );
+ char *service_branch = mlt_properties_get( MLT_SERVICE_PROPERTIES( service ), "_westley_branch" );
contained = !strncmp( container_branch, service_branch, strlen( container_branch ) );
}
if ( contained )
{
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
char *hide_s = mlt_properties_get( properties, "hide" );
// Indicate that this service is no longer top of stack
for ( i = 0; ( filter = mlt_service_filter( that, i ) ) != NULL; i ++ )
{
mlt_service_attach( this, filter );
- attach_filters( mlt_filter_service( filter ), mlt_filter_service( filter ) );
+ attach_filters( MLT_FILTER_SERVICE( filter ), MLT_FILTER_SERVICE( filter ) );
}
}
}
static void on_start_tractor( deserialise_context context, const xmlChar *name, const xmlChar **atts)
{
- mlt_service service = mlt_tractor_service( mlt_tractor_new( ) );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_tractor tractor = mlt_tractor_new( );
+ mlt_service service = MLT_TRACTOR_SERVICE( tractor );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
track_service( context->destructors, service, (mlt_destructor) mlt_tractor_close );
for ( ; atts != NULL && *atts != NULL; atts += 2 )
- mlt_properties_set( mlt_service_properties( service ), (char*) atts[0], (char*) atts[1] );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), (char*) atts[0], (char*) atts[1] );
if ( mlt_properties_get( properties, "id" ) != NULL )
mlt_properties_set_data( context->producer_map, mlt_properties_get( properties, "id" ), service, 0, NULL, NULL );
if ( add_producer( context, tractor, 0, mlt_producer_get_out( MLT_PRODUCER( tractor ) ) ) == 0 )
context_push_service( context, tractor, type );
}
+ else
+ {
+ fprintf( stderr, "Invalid state for tractor\n" );
+ }
}
static void on_start_multitrack( deserialise_context context, const xmlChar *name, const xmlChar **atts)
// If we don't have a parent, then create one now, providing we're in a state where we can
if ( parent == NULL || ( type == mlt_playlist_type || type == mlt_multitrack_type ) )
{
+ mlt_tractor tractor = NULL;
// Push the parent back
if ( parent != NULL )
context_push_service( context, parent, type );
// Create a tractor to contain the multitrack
- parent = mlt_tractor_service( mlt_tractor_new( ) );
+ tractor = mlt_tractor_new( );
+ parent = MLT_TRACTOR_SERVICE( tractor );
track_service( context->destructors, parent, (mlt_destructor) mlt_tractor_close );
type = mlt_tractor_type;
// Flag it as a synthesised tractor for clean up later
- mlt_properties_set_int( mlt_service_properties( parent ), "fezzik_synth", 1 );
+ mlt_properties_set_int( MLT_SERVICE_PROPERTIES( parent ), "fezzik_synth", 1 );
}
if ( type == mlt_tractor_type )
{
mlt_service service = MLT_SERVICE( mlt_tractor_multitrack( MLT_TRACTOR( parent ) ) );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
for ( ; atts != NULL && *atts != NULL; atts += 2 )
mlt_properties_set( properties, (char*) atts[0], (char*) atts[1] );
static void on_start_playlist( deserialise_context context, const xmlChar *name, const xmlChar **atts)
{
- mlt_service service = mlt_playlist_service( mlt_playlist_init() );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_playlist playlist = mlt_playlist_init( );
+ mlt_service service = MLT_PLAYLIST_SERVICE( playlist );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
track_service( context->destructors, service, (mlt_destructor) mlt_playlist_close );
if ( service != NULL && type == mlt_playlist_type )
{
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
mlt_position in = mlt_properties_get_position( properties, "in" );
mlt_position out = mlt_properties_get_position( properties, "out" );
mlt_service service = calloc( 1, sizeof( struct mlt_service_s ) );
mlt_service_init( service, NULL );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
context_push_service( context, service, mlt_dummy_producer_type );
{
enum service_type type;
mlt_service service = context_pop_service( context, &type );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
if ( service != NULL && type == mlt_dummy_producer_type )
{
if ( producer == NULL && resource != NULL )
producer = MLT_SERVICE( mlt_factory_producer( "fezzik", resource ) );
+ if ( producer == NULL )
+ producer = MLT_SERVICE( mlt_factory_producer( "fezzik", "+INVALID.txt" ) );
+
// Track this producer
track_service( context->destructors, producer, (mlt_destructor) mlt_producer_close );
mlt_properties_set( properties, "out", NULL );
// Inherit the properties
- mlt_properties_inherit( mlt_service_properties( producer ), properties );
+ mlt_properties_inherit( MLT_SERVICE_PROPERTIES( producer ), properties );
// Attach all filters from service onto producer
attach_filters( producer, service );
if ( parent != NULL )
{
// Get the parent properties
- properties = mlt_service_properties( parent );
+ properties = MLT_SERVICE_PROPERTIES( parent );
char *resource = mlt_properties_get( properties, "resource" );
}
// Push the cut onto the stack
- context_push_service( context, mlt_producer_service( entry ), mlt_entry_type );
+ context_push_service( context, MLT_PRODUCER_SERVICE( entry ), mlt_entry_type );
mlt_properties_close( temp );
}
// Push the dummy service onto the stack
context_push_service( context, service, mlt_entry_type );
- mlt_properties_set( mlt_service_properties( service ), "resource", "<track>" );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), "resource", "<track>" );
for ( ; atts != NULL && *atts != NULL; atts += 2 )
{
- mlt_properties_set( mlt_service_properties( service ), (char*) atts[0], (char*) atts[1] );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), (char*) atts[0], (char*) atts[1] );
// Look for the producer attribute
if ( strcmp( atts[ 0 ], "producer" ) == 0 )
{
mlt_producer producer = mlt_properties_get_data( context->producer_map, (char*) atts[1], NULL );
if ( producer != NULL )
- mlt_properties_set_data( mlt_service_properties( service ), "producer", producer, 0, NULL, NULL );
+ mlt_properties_set_data( MLT_SERVICE_PROPERTIES( service ), "producer", producer, 0, NULL, NULL );
}
}
}
if ( track != NULL && track_type == mlt_entry_type )
{
- mlt_properties track_props = mlt_service_properties( track );
+ mlt_properties track_props = MLT_SERVICE_PROPERTIES( track );
enum service_type parent_type;
mlt_service parent = context_pop_service( context, &parent_type );
mlt_multitrack multitrack = NULL;
mlt_producer producer = mlt_properties_get_data( track_props, "producer", NULL );
- mlt_properties producer_props = mlt_producer_properties( producer );
+ mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
if ( parent_type == mlt_tractor_type )
multitrack = mlt_tractor_multitrack( MLT_TRACTOR( parent ) );
mlt_producer cut = mlt_producer_cut( MLT_PRODUCER( producer ),
mlt_properties_get_position( track_props, "in" ),
mlt_properties_get_position( track_props, "out" ) );
- mlt_properties_set_int( mlt_producer_properties( cut ), "cut", 1 );
mlt_multitrack_connect( multitrack, cut, mlt_multitrack_count( multitrack ) );
+ mlt_properties_inherit( MLT_PRODUCER_PROPERTIES( cut ), track_props );
+ track_props = MLT_PRODUCER_PROPERTIES( cut );
mlt_producer_close( cut );
}
else
mlt_service service = calloc( 1, sizeof( struct mlt_service_s ) );
mlt_service_init( service, NULL );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
context_push_service( context, service, mlt_dummy_filter_type );
{
enum service_type type;
mlt_service service = context_pop_service( context, &type );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
enum service_type parent_type;
mlt_service parent = context_pop_service( context, &parent_type );
if ( service != NULL && type == mlt_dummy_filter_type )
{
mlt_service filter = MLT_SERVICE( mlt_factory_filter( mlt_properties_get( properties, "mlt_service" ), NULL ) );
- mlt_properties filter_props = mlt_service_properties( filter );
+ mlt_properties filter_props = MLT_SERVICE_PROPERTIES( filter );
track_service( context->destructors, filter, (mlt_destructor) mlt_filter_close );
mlt_service service = calloc( 1, sizeof( struct mlt_service_s ) );
mlt_service_init( service, NULL );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
context_push_service( context, service, mlt_dummy_transition_type );
{
enum service_type type;
mlt_service service = context_pop_service( context, &type );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
enum service_type parent_type;
mlt_service parent = context_pop_service( context, &parent_type );
if ( service != NULL && type == mlt_dummy_transition_type )
{
mlt_service effect = MLT_SERVICE( mlt_factory_transition(mlt_properties_get(properties,"mlt_service"), NULL ) );
- mlt_properties effect_props = mlt_service_properties( effect );
+ mlt_properties effect_props = MLT_SERVICE_PROPERTIES( effect );
track_service( context->destructors, effect, (mlt_destructor) mlt_transition_close );
{
enum service_type type;
mlt_service service = context_pop_service( context, &type );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
char *value = NULL;
if ( service != NULL )
{
enum service_type type;
mlt_service service = context_pop_service( context, &type );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
if ( service != NULL )
{
char *value = calloc( len + 1, 1 );
enum service_type type;
mlt_service service = context_pop_service( context, &type );
- mlt_properties properties = mlt_service_properties( service );
+ mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
if ( service != NULL )
context_push_service( context, service, type );
{
// Verify it is a producer service (mlt_type="mlt_producer")
// (producer, playlist, multitrack)
- char *type = mlt_properties_get( mlt_service_properties( service ), "mlt_type" );
+ char *type = mlt_properties_get( MLT_SERVICE_PROPERTIES( service ), "mlt_type" );
if ( type == NULL || ( strcmp( type, "mlt_producer" ) != 0 && strcmp( type, "producer" ) != 0 ) )
service = NULL;
}
// We are done referencing destructor property list
// Set this var to service properties for convenience
- properties = mlt_service_properties( service );
+ properties = MLT_SERVICE_PROPERTIES( service );
// Assign the title
mlt_properties_set( properties, "title", title );
// Check that we want progressive and we aren't already progressive
if ( *format == mlt_image_yuv422 &&
- !mlt_properties_get_int( mlt_frame_properties( this ), "progressive" ) &&
- mlt_properties_get_int( mlt_frame_properties( this ), "consumer_deinterlace" ) )
+ !mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "progressive" ) &&
+ mlt_properties_get_int( MLT_FRAME_PROPERTIES( this ), "consumer_deinterlace" ) )
{
// Get the input image
error = mlt_frame_get_image( this, image, format, width, height, 1 );
// Determine deinterlace method
- char *method_str = mlt_properties_get( mlt_filter_properties( filter ), "method" );
+ char *method_str = mlt_properties_get( MLT_FILTER_PROPERTIES( filter ), "method" );
int method = DEINTERLACE_LINEARBLEND;
if ( strcmp( method_str, "bob" ) == 0 )
deinterlace_yuv( *image, image, *width * 2, *height, method );
// Make sure that others know the frame is deinterlaced
- mlt_properties_set_int( mlt_frame_properties( this ), "progressive", 1 );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( this ), "progressive", 1 );
}
else
{
if ( this != NULL )
{
this->process = deinterlace_process;
- mlt_properties_set( mlt_filter_properties( this ), "method", arg == NULL ? "linearblend" : arg );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "method", arg == NULL ? "linearblend" : arg );
}
return this;
}
if ( service != NULL )
{
mlt_consumer consumer = mlt_factory_consumer( "westley", "buffer" );
- mlt_properties properties = mlt_consumer_properties( consumer );
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
char *buffer = NULL;
mlt_consumer_connect( consumer, service );
mlt_consumer_start( consumer );