int mlt_consumer_stop( mlt_consumer this )
{
+ // Get the properies
+ mlt_properties properties = mlt_consumer_properties( this );
+
+ // Stop the consumer
if ( this->stop != NULL )
return this->stop( this );
+
+ // Kill the test card
+ mlt_properties_set_data( properties, "test_card_producer", NULL, 0, NULL, NULL );
+
return 0;
}
int mlt_consumer_is_stopped( mlt_consumer this )
{
- // Get the properies
- mlt_properties properties = mlt_consumer_properties( this );
-
// Stop the consumer
if ( this->is_stopped != NULL )
return this->is_stopped( this );
- // Kill the test card
- mlt_properties_set_data( properties, "test_card_producer", NULL, 0, NULL, NULL );
-
return 0;
}
return error;
}
+/** Rename a property.
+*/
+
+int mlt_properties_rename( mlt_properties this, char *source, char *dest )
+{
+ mlt_property value = mlt_properties_find( this, dest );
+
+ if ( value == NULL )
+ {
+ property_list *list = this->private;
+ int i = 0;
+
+ // Locate the item
+ for ( i = 0; i < list->count; i ++ )
+ {
+ if ( !strcmp( list->name[ i ], source ) )
+ {
+ free( list->name[ i ] );
+ list->name[ i ] = strdup( dest );
+ break;
+ }
+ }
+ }
+
+ return value != NULL;
+}
+
+/** Dump the properties.
+*/
+
+void mlt_properties_dump( mlt_properties this, FILE *output )
+{
+ property_list *list = this->private;
+ int i = 0;
+ for ( i = 0; i < list->count; i ++ )
+ fprintf( stderr, "%s = %s\n", list->name[ i ], mlt_properties_get( this, list->name[ i ] ) );
+}
+
/** Close the list.
*/
#define _MLT_PROPERTIES_H_
#include "mlt_types.h"
+#include <stdio.h>
/** The properties base class defines the basic property propagation and
handling.
extern int mlt_properties_set_position( mlt_properties this, char *name, mlt_position value );
extern int mlt_properties_set_data( mlt_properties this, char *name, void *value, int length, mlt_destructor, mlt_serialiser );
extern void *mlt_properties_get_data( mlt_properties this, char *name, int *length );
+extern int mlt_properties_rename( mlt_properties this, char *source, char *dest );
extern int mlt_properties_count( mlt_properties this );
+extern void mlt_properties_dump( mlt_properties this, FILE *output );
extern void mlt_properties_close( mlt_properties this );
#endif