uint8_t *q;
test_card.vfmt = *format;
- test_card.width = 720;
- test_card.height = 576;
+ test_card.width = *width == 0 ? 720 : *width;
+ test_card.height = *height == 0 ? 576 : *height;
switch( *format )
{
pthread_cond_t audio_cond;
int window_width;
int window_height;
+ int width;
+ int height;
};
/** Forward references to static functions.
via the argument, but keep it simple.
*/
-mlt_consumer consumer_sdl_init( void *dummy )
+mlt_consumer consumer_sdl_init( char *arg )
{
// Create the consumer object
consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 );
pthread_mutex_init( &this->audio_mutex, NULL );
pthread_cond_init( &this->audio_cond, NULL);
- // TODO: process actual param
-
+ // process actual param
+ if ( arg == NULL || !strcmp( arg, "PAL" ) )
+ {
+ this->width = 720;
+ this->height = 576;
+ }
+ else if ( !strcmp( arg, "NTSC" ) )
+ {
+ this->width = 720;
+ this->height = 480;
+ }
+ else if ( sscanf( arg, "%dx%d", &this->width, &this->height ) != 2 )
+ {
+ this->width = 720;
+ this->height = 576;
+ }
+
+
// Create the the thread
pthread_create( &this->thread, NULL, consumer_thread, this );
if ( mlt_service_get_frame( service, &frame, 0 ) == 0 )
{
mlt_image_format vfmt = mlt_image_yuv422;
- int width, height;
+ int width = this->width, height = this->height;
uint8_t *image;
mlt_audio_format afmt = mlt_audio_pcm;
#include <framework/mlt_consumer.h>
-extern mlt_consumer consumer_sdl_init( void * );
+extern mlt_consumer consumer_sdl_init( char * );
#endif
result = mlt_factory_producer( "mcdv", file );
else if ( strstr( file, ".jpg" ) )
result = mlt_factory_producer( "pixbuf", file );
+ else if ( strstr( file, ".JPG" ) )
+ result = mlt_factory_producer( "pixbuf", file );
+ else if ( strstr( file, ".jpeg" ) )
+ result = mlt_factory_producer( "pixbuf", file );
else if ( strstr( file, ".png" ) )
result = mlt_factory_producer( "pixbuf", file );
uint8_t *q;
test_card.vfmt = *format;
- test_card.width = 720;
- test_card.height = 576;
+ test_card.width = *width == 0 ? 720 : *width;
+ test_card.height = *height == 0 ? 576 : *height;
switch( *format )
{
pthread_cond_t audio_cond;
int window_width;
int window_height;
+ int width;
+ int height;
};
/** Forward references to static functions.
via the argument, but keep it simple.
*/
-mlt_consumer consumer_sdl_init( void *dummy )
+mlt_consumer consumer_sdl_init( char *arg )
{
// Create the consumer object
consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 );
pthread_mutex_init( &this->audio_mutex, NULL );
pthread_cond_init( &this->audio_cond, NULL);
- // TODO: process actual param
-
+ // process actual param
+ if ( arg == NULL || !strcmp( arg, "PAL" ) )
+ {
+ this->width = 720;
+ this->height = 576;
+ }
+ else if ( !strcmp( arg, "NTSC" ) )
+ {
+ this->width = 720;
+ this->height = 480;
+ }
+ else if ( sscanf( arg, "%dx%d", &this->width, &this->height ) != 2 )
+ {
+ this->width = 720;
+ this->height = 576;
+ }
+
+
// Create the the thread
pthread_create( &this->thread, NULL, consumer_thread, this );
if ( mlt_service_get_frame( service, &frame, 0 ) == 0 )
{
mlt_image_format vfmt = mlt_image_yuv422;
- int width, height;
+ int width = this->width, height = this->height;
uint8_t *image;
mlt_audio_format afmt = mlt_audio_pcm;
#include <framework/mlt_consumer.h>
-extern mlt_consumer consumer_sdl_init( void * );
+extern mlt_consumer consumer_sdl_init( char * );
#endif
result = mlt_factory_producer( "mcdv", file );
else if ( strstr( file, ".jpg" ) )
result = mlt_factory_producer( "pixbuf", file );
+ else if ( strstr( file, ".JPG" ) )
+ result = mlt_factory_producer( "pixbuf", file );
+ else if ( strstr( file, ".jpeg" ) )
+ result = mlt_factory_producer( "pixbuf", file );
else if ( strstr( file, ".png" ) )
result = mlt_factory_producer( "pixbuf", file );