]> git.sesse.net Git - mlt/commitdiff
More SDL updates
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 26 Dec 2003 10:29:05 +0000 (10:29 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 26 Dec 2003 10:29:05 +0000 (10:29 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@18 d19143bc-622f-0410-bfdd-b5b2a6649095

mlt/src/framework/mlt_frame.c
mlt/src/modules/sdl/consumer_sdl.c
mlt/src/modules/sdl/consumer_sdl.h
mlt/src/tests/charlie.c
src/framework/mlt_frame.c
src/modules/sdl/consumer_sdl.c
src/modules/sdl/consumer_sdl.h
src/tests/charlie.c

index 5eacb943030aa08a54ce7d389d54a99cd61d8063..d1f69131c2e28657990c76ac198816a8dcb90739 100644 (file)
@@ -184,8 +184,8 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
                        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 )
                        {
index 2d70b903d17be032987defdae4e240fd4da9f4e6..c685296ef1a819196500140652d2ff1e23617b0b 100644 (file)
@@ -46,6 +46,8 @@ struct consumer_sdl_s
        pthread_cond_t audio_cond;
        int window_width;
        int window_height;
+       int width;
+       int height;
 };
 
 /** Forward references to static functions.
@@ -59,7 +61,7 @@ static int consumer_get_dimensions( int *width, int *height );
        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 );
@@ -85,8 +87,24 @@ mlt_consumer consumer_sdl_init( void *dummy )
                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 );
 
@@ -194,7 +212,7 @@ static void *consumer_thread( void *arg )
                if ( mlt_service_get_frame( service, &frame, 0 ) == 0 )
                {
                        mlt_image_format vfmt = mlt_image_yuv422;
-                       int widthheight;
+                       int width = this->width, height = this->height;
                        uint8_t *image;
 
                        mlt_audio_format afmt = mlt_audio_pcm;
index 6c8114e48c6678d41f9792629ebd95639299641c..bf2fefd4244d5234de8a40299c9e8d2159dd08c9 100644 (file)
@@ -23,6 +23,6 @@
 
 #include <framework/mlt_consumer.h>
 
-extern mlt_consumer consumer_sdl_init( void * );
+extern mlt_consumer consumer_sdl_init( char * );
 
 #endif
index f807b5d67e3c910d99031b3c92949d5268762481..b8c7d4f8ae32248897468c0fb0e281d2c3f9ebc3 100644 (file)
@@ -19,6 +19,10 @@ mlt_producer create_producer( char *file )
                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 );
 
index 5eacb943030aa08a54ce7d389d54a99cd61d8063..d1f69131c2e28657990c76ac198816a8dcb90739 100644 (file)
@@ -184,8 +184,8 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
                        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 )
                        {
index 2d70b903d17be032987defdae4e240fd4da9f4e6..c685296ef1a819196500140652d2ff1e23617b0b 100644 (file)
@@ -46,6 +46,8 @@ struct consumer_sdl_s
        pthread_cond_t audio_cond;
        int window_width;
        int window_height;
+       int width;
+       int height;
 };
 
 /** Forward references to static functions.
@@ -59,7 +61,7 @@ static int consumer_get_dimensions( int *width, int *height );
        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 );
@@ -85,8 +87,24 @@ mlt_consumer consumer_sdl_init( void *dummy )
                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 );
 
@@ -194,7 +212,7 @@ static void *consumer_thread( void *arg )
                if ( mlt_service_get_frame( service, &frame, 0 ) == 0 )
                {
                        mlt_image_format vfmt = mlt_image_yuv422;
-                       int widthheight;
+                       int width = this->width, height = this->height;
                        uint8_t *image;
 
                        mlt_audio_format afmt = mlt_audio_pcm;
index 6c8114e48c6678d41f9792629ebd95639299641c..bf2fefd4244d5234de8a40299c9e8d2159dd08c9 100644 (file)
@@ -23,6 +23,6 @@
 
 #include <framework/mlt_consumer.h>
 
-extern mlt_consumer consumer_sdl_init( void * );
+extern mlt_consumer consumer_sdl_init( char * );
 
 #endif
index f807b5d67e3c910d99031b3c92949d5268762481..b8c7d4f8ae32248897468c0fb0e281d2c3f9ebc3 100644 (file)
@@ -19,6 +19,10 @@ mlt_producer create_producer( char *file )
                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 );