return &this->parent;
}
+/** Get the consumer properties.
+*/
+
+mlt_properties mlt_consumer_properties( mlt_consumer this )
+{
+ return mlt_service_properties( &this->parent );
+}
+
/** Connect the consumer to the producer.
*/
extern int mlt_consumer_init( mlt_consumer this, void *child );
extern mlt_service mlt_consumer_service( mlt_consumer this );
+extern mlt_properties mlt_consumer_properties( mlt_consumer this );
extern int mlt_consumer_connect( mlt_consumer this, mlt_service producer );
extern void mlt_consumer_close( mlt_consumer );
}
mlt_image_format;
+typedef enum
+{
+ mlt_video_standard_pal = 0,
+ mlt_video_standard_ntsc
+}
+mlt_video_standard;
+
typedef enum
{
mlt_audio_none = 0,
producer->close = producer_close;
this->markup = strdup( markup );
- this->is_pal = 1;
g_type_init();
+ // Get the properties interface
+ mlt_properties properties = mlt_producer_properties( &this->parent );
+
+ // Set the default properties
+ mlt_properties_set_int( properties, "video_standard", mlt_video_standard_pal );
+ mlt_properties_set_int( properties, "fgcolor", 0xffffffff );
+ mlt_properties_set_int( properties, "bgcolor", 0x00000000 );
+ mlt_properties_set_int( properties, "align", pango_align_left );
+ mlt_properties_set_int( properties, "pad", 0 );
+
return producer;
}
free( this );
}
else
{
- // the following four will be replaced by properties
- rgba_color fg = { 0xff, 0xff, 0xff, 0xff };
- rgba_color bg = { 0, 0, 0, 0x7f };
- int pad = 8;
- int align = 0; /* left */
+ // Obtain properties of producer
+ mlt_properties props = mlt_producer_properties( producer );
+
+ // Get properties
+ int fg = mlt_properties_get_int( props, "fgcolor" );
+ int bg = mlt_properties_get_int( props, "bgcolor" );
+ int align = mlt_properties_get_int( props, "align" );
+ int pad = mlt_properties_get_int( props, "pad" );
+ rgba_color fgcolor =
+ {
+ ( fg & 0xff000000 ) >> 24,
+ ( fg & 0x00ff0000 ) >> 16,
+ ( fg & 0x0000ff00 ) >> 8,
+ ( fg & 0x000000ff )
+ };
+ rgba_color bgcolor =
+ {
+ ( bg & 0xff000000 ) >> 24,
+ ( bg & 0x00ff0000 ) >> 16,
+ ( bg & 0x0000ff00 ) >> 8,
+ ( bg & 0x000000ff )
+ };
// Render the title
- pixbuf = pango_get_pixbuf( this->markup, fg, bg, pad, align );
+ pixbuf = pango_get_pixbuf( this->markup, fgcolor, bgcolor, pad, align );
}
// If we have a pixbuf
if ( pixbuf )
{
// Scale to adjust for sample aspect ratio
- if ( this->is_pal )
+ if ( mlt_properties_get_int( properties, "video_standard" ) == mlt_video_standard_pal )
{
GdkPixbuf *temp = pixbuf;
GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf,
int height;
uint8_t *image;
uint8_t *alpha;
- int is_pal;
};
+typedef enum
+{
+ pango_align_left = 0,
+ pango_align_center,
+ pango_align_right
+} pango_align;
+
extern mlt_producer producer_pango_init( const char *markup );
#endif
static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index );
static void producer_close( mlt_producer parent );
+typedef enum
+{
+ SIGNAL_FORMAT_PAL,
+ SIGNAL_FORMAT_NTSC
+} mlt_signal_format;
+
mlt_producer producer_pixbuf_init( const char *filename )
{
producer_pixbuf this = calloc( sizeof( struct producer_pixbuf_s ), 1 );
this->filename = strdup( filename );
this->counter = -1;
- this->is_pal = 1;
+
+ // Get the properties interface
+ mlt_properties properties = mlt_producer_properties( &this->parent );
+
+ // Set the default properties
+ mlt_properties_set_int( properties, "video_standard", mlt_video_standard_pal );
+
g_type_init();
return producer;
if ( pixbuf )
{
// Scale to adjust for sample aspect ratio
- if ( this->is_pal )
+ if ( mlt_properties_get_int( properties, "video_stadnard" ) == mlt_video_standard_pal )
{
GdkPixbuf *temp = pixbuf;
GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf,
int height;
uint8_t *image;
uint8_t *alpha;
- int is_pal;
};
extern mlt_producer producer_pixbuf_init( const char *filename );
file2 = argv[ 2 ];
// Start the consumer...
- mlt_consumer consumer = mlt_factory_consumer( "bluefish", NULL );
+ int vstd = mlt_video_standard_ntsc;
+ mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd );
+ mlt_properties_set_int( mlt_consumer_properties( consumer ), "video_standard", mlt_video_standard_ntsc );
// Create the producer(s)
mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
+#if 0
+ // Connect the tractor to the consumer
+ mlt_consumer_connect( consumer, mlt_producer_service( dv1 ) );
+
+ // Do stuff until we're told otherwise...
+ fprintf( stderr, "Press return to continue\n" );
+ fgets( temp, 132, stdin );
+ mlt_consumer_close( consumer );
+ return 0;
+#endif
+
//mlt_producer dv1 = producer_pixbuf_init( file1 );
//mlt_producer dv2 = producer_libdv_init( file2 );
//mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
mlt_producer dv2 = mlt_factory_producer( "pango", "<span font_desc=\"Sans Bold 36\">Mutton <span font_desc=\"Luxi Serif Bold Oblique 36\">Lettuce</span> Tomato</span>" );
+ mlt_properties_set_int( mlt_producer_properties( dv2 ), "video_standard", mlt_video_standard_ntsc );
+ mlt_properties_set_int( mlt_producer_properties( dv2 ), "bgcolor", 0x0000007f );
+ mlt_properties_set_int( mlt_producer_properties( dv2 ), "pad", 8 );
// Register producers(s) with a multitrack object
mlt_multitrack multitrack = mlt_multitrack_init( );
return &this->parent;
}
+/** Get the consumer properties.
+*/
+
+mlt_properties mlt_consumer_properties( mlt_consumer this )
+{
+ return mlt_service_properties( &this->parent );
+}
+
/** Connect the consumer to the producer.
*/
extern int mlt_consumer_init( mlt_consumer this, void *child );
extern mlt_service mlt_consumer_service( mlt_consumer this );
+extern mlt_properties mlt_consumer_properties( mlt_consumer this );
extern int mlt_consumer_connect( mlt_consumer this, mlt_service producer );
extern void mlt_consumer_close( mlt_consumer );
}
mlt_image_format;
+typedef enum
+{
+ mlt_video_standard_pal = 0,
+ mlt_video_standard_ntsc
+}
+mlt_video_standard;
+
typedef enum
{
mlt_audio_none = 0,
producer->close = producer_close;
this->markup = strdup( markup );
- this->is_pal = 1;
g_type_init();
+ // Get the properties interface
+ mlt_properties properties = mlt_producer_properties( &this->parent );
+
+ // Set the default properties
+ mlt_properties_set_int( properties, "video_standard", mlt_video_standard_pal );
+ mlt_properties_set_int( properties, "fgcolor", 0xffffffff );
+ mlt_properties_set_int( properties, "bgcolor", 0x00000000 );
+ mlt_properties_set_int( properties, "align", pango_align_left );
+ mlt_properties_set_int( properties, "pad", 0 );
+
return producer;
}
free( this );
}
else
{
- // the following four will be replaced by properties
- rgba_color fg = { 0xff, 0xff, 0xff, 0xff };
- rgba_color bg = { 0, 0, 0, 0x7f };
- int pad = 8;
- int align = 0; /* left */
+ // Obtain properties of producer
+ mlt_properties props = mlt_producer_properties( producer );
+
+ // Get properties
+ int fg = mlt_properties_get_int( props, "fgcolor" );
+ int bg = mlt_properties_get_int( props, "bgcolor" );
+ int align = mlt_properties_get_int( props, "align" );
+ int pad = mlt_properties_get_int( props, "pad" );
+ rgba_color fgcolor =
+ {
+ ( fg & 0xff000000 ) >> 24,
+ ( fg & 0x00ff0000 ) >> 16,
+ ( fg & 0x0000ff00 ) >> 8,
+ ( fg & 0x000000ff )
+ };
+ rgba_color bgcolor =
+ {
+ ( bg & 0xff000000 ) >> 24,
+ ( bg & 0x00ff0000 ) >> 16,
+ ( bg & 0x0000ff00 ) >> 8,
+ ( bg & 0x000000ff )
+ };
// Render the title
- pixbuf = pango_get_pixbuf( this->markup, fg, bg, pad, align );
+ pixbuf = pango_get_pixbuf( this->markup, fgcolor, bgcolor, pad, align );
}
// If we have a pixbuf
if ( pixbuf )
{
// Scale to adjust for sample aspect ratio
- if ( this->is_pal )
+ if ( mlt_properties_get_int( properties, "video_standard" ) == mlt_video_standard_pal )
{
GdkPixbuf *temp = pixbuf;
GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf,
int height;
uint8_t *image;
uint8_t *alpha;
- int is_pal;
};
+typedef enum
+{
+ pango_align_left = 0,
+ pango_align_center,
+ pango_align_right
+} pango_align;
+
extern mlt_producer producer_pango_init( const char *markup );
#endif
static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index );
static void producer_close( mlt_producer parent );
+typedef enum
+{
+ SIGNAL_FORMAT_PAL,
+ SIGNAL_FORMAT_NTSC
+} mlt_signal_format;
+
mlt_producer producer_pixbuf_init( const char *filename )
{
producer_pixbuf this = calloc( sizeof( struct producer_pixbuf_s ), 1 );
this->filename = strdup( filename );
this->counter = -1;
- this->is_pal = 1;
+
+ // Get the properties interface
+ mlt_properties properties = mlt_producer_properties( &this->parent );
+
+ // Set the default properties
+ mlt_properties_set_int( properties, "video_standard", mlt_video_standard_pal );
+
g_type_init();
return producer;
if ( pixbuf )
{
// Scale to adjust for sample aspect ratio
- if ( this->is_pal )
+ if ( mlt_properties_get_int( properties, "video_stadnard" ) == mlt_video_standard_pal )
{
GdkPixbuf *temp = pixbuf;
GdkPixbuf *scaled = gdk_pixbuf_scale_simple( pixbuf,
int height;
uint8_t *image;
uint8_t *alpha;
- int is_pal;
};
extern mlt_producer producer_pixbuf_init( const char *filename );
file2 = argv[ 2 ];
// Start the consumer...
- mlt_consumer consumer = mlt_factory_consumer( "bluefish", NULL );
+ int vstd = mlt_video_standard_ntsc;
+ mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd );
+ mlt_properties_set_int( mlt_consumer_properties( consumer ), "video_standard", mlt_video_standard_ntsc );
// Create the producer(s)
mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 );
+#if 0
+ // Connect the tractor to the consumer
+ mlt_consumer_connect( consumer, mlt_producer_service( dv1 ) );
+
+ // Do stuff until we're told otherwise...
+ fprintf( stderr, "Press return to continue\n" );
+ fgets( temp, 132, stdin );
+ mlt_consumer_close( consumer );
+ return 0;
+#endif
+
//mlt_producer dv1 = producer_pixbuf_init( file1 );
//mlt_producer dv2 = producer_libdv_init( file2 );
//mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
mlt_producer dv2 = mlt_factory_producer( "pango", "<span font_desc=\"Sans Bold 36\">Mutton <span font_desc=\"Luxi Serif Bold Oblique 36\">Lettuce</span> Tomato</span>" );
+ mlt_properties_set_int( mlt_producer_properties( dv2 ), "video_standard", mlt_video_standard_ntsc );
+ mlt_properties_set_int( mlt_producer_properties( dv2 ), "bgcolor", 0x0000007f );
+ mlt_properties_set_int( mlt_producer_properties( dv2 ), "pad", 8 );
// Register producers(s) with a multitrack object
mlt_multitrack multitrack = mlt_multitrack_init( );