]> git.sesse.net Git - mlt/commitdiff
Added ref_count method to properties; temporary work around for test card; titles...
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Wed, 17 Nov 2004 10:40:04 +0000 (10:40 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Wed, 17 Nov 2004 10:40:04 +0000 (10:40 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@527 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_consumer.c
src/framework/mlt_frame.c
src/framework/mlt_properties.c
src/framework/mlt_properties.h
src/modules/sdl/consumer_sdl_still.c
src/modules/valerie/consumer_valerie.c

index c6babd85637bc206caf0bc33b08d5ed6eab47f77..b904f13796f1a29bd7e87af357bd6d77e8a3822c 100644 (file)
@@ -170,7 +170,9 @@ int mlt_consumer_start( mlt_consumer this )
                        if ( producer != NULL )
                        {
                                // Test card should loop I guess...
-                               mlt_properties_set( mlt_producer_properties( producer ), "eof", "loop" );
+                               mlt_properties_set( mlt_producer_properties( producer ), "eof", "pause" );
+                               mlt_producer_set_speed( producer, 0 );
+                               mlt_producer_set_in_and_out( producer, 0, 0 );
 
                                // Set the test card on the consumer
                                mlt_properties_set_data( properties, "test_card_producer", producer, 0, ( mlt_destructor )mlt_producer_close, NULL );
index 6e23964e82e79d0b755b92f84595dac8fe8c7bef..ff92fbffc45225c08133c85c58ba9312e084ab39 100644 (file)
@@ -120,7 +120,8 @@ int mlt_frame_set_aspect_ratio( mlt_frame this, double value )
 
 mlt_position mlt_frame_get_position( mlt_frame this )
 {
-       return 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;
 }
 
 /** Set the position of this frame.
index 01c4ba2d9a736a1ed04565d238abe14281ec0b27..e84ee0725bf8adcb261237b23b16772a01eaff40 100644 (file)
@@ -202,6 +202,19 @@ int mlt_properties_dec_ref( mlt_properties this )
        return 0;
 }
 
+/** Return the ref count of this object.
+*/
+
+int mlt_properties_ref_count( mlt_properties this )
+{
+       if ( this != NULL )
+       {
+               property_list *list = this->local;
+               return list->ref_count;
+       }
+       return 0;
+}
+
 /** Allow the specification of a mirror.
 */
 
index a331029ec53d8182304624cc6fb66a5d324928d2..ff87dc0989f6008fd0274a5bf258e68b60a4daaa 100644 (file)
@@ -45,6 +45,7 @@ extern mlt_properties mlt_properties_new( );
 extern mlt_properties mlt_properties_load( char *file );
 extern int mlt_properties_inc_ref( mlt_properties self );
 extern int mlt_properties_dec_ref( mlt_properties self );
+extern int mlt_properties_ref_count( mlt_properties self );
 extern void mlt_properties_mirror( mlt_properties self, mlt_properties that );
 extern int mlt_properties_inherit( mlt_properties self, mlt_properties that );
 extern int mlt_properties_pass( mlt_properties self, mlt_properties that, char *prefix );
index 82a231d332e867db5388990e9fbfe01bd7bb008a..998d3e09fc9a94fd5dd0f8a3a6e7f5544baa2832 100644 (file)
@@ -446,7 +446,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
                mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
        }
 
-       if ( 1 )
+       if ( image != NULL )
        {
                char *rescale = mlt_properties_get( properties, "rescale" );
                if ( rescale != NULL && strcmp( rescale, "none" ) )
@@ -512,7 +512,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
 
        if ( unlock != NULL ) unlock( );
 
-       return 0;
+       return 1;
 }
 
 /** Threaded wrapper for pipe.
@@ -528,7 +528,7 @@ static void *consumer_thread( void *arg )
 
        // internal intialization
        mlt_frame frame = NULL;
-       struct timespec tm = { 0, 400000 };
+       struct timespec tm = { 0, 1000000 };
 
        if ( mlt_properties_get_int( mlt_consumer_properties( consumer ), "sdl_started" ) == 0 )
        {
@@ -561,9 +561,9 @@ static void *consumer_thread( void *arg )
                // Ensure that we have a frame
                if ( frame != NULL )
                {
-                       consumer_play_video( this, frame );
+                       if ( consumer_play_video( this, frame ) == 0 )
+                               nanosleep( &tm, NULL );
                        mlt_frame_close( frame );
-                       nanosleep( &tm, NULL );
                }
        }
 
index 512670139134a2138fba56d09121c4642cadb732..4c36a9ec4ae0ad747139a2c532d23f57e3454c76 100644 (file)
@@ -86,9 +86,10 @@ static int consumer_start( mlt_consumer this )
        // Get all the properties now
        char *server = mlt_properties_get( properties, "server" );
        int port = mlt_properties_get_int( properties, "port" );
-       char *command = mlt_properties_get( properties, "command" );
+       char *cmd = mlt_properties_get( properties, "command" );
        int unit = mlt_properties_get_int( properties, "unit" );
        char *title = mlt_properties_get( properties, "title" );
+       char command[ 2048 ];
 
        // If this is a reuse, then a valerie object will exist
        valerie connection = mlt_properties_get_data( properties, "connection", NULL );
@@ -96,6 +97,24 @@ static int consumer_start( mlt_consumer this )
        // Special case - we can get a doc too...
        char *doc = mlt_properties_get( properties, "westley" );
 
+       // Set the title if provided
+       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" );
+       }
+
+       strcpy( command, cmd == NULL ? "" : cmd );
+       if ( strstr( command, "title=" ) == NULL && title != NULL )
+       {
+               strcat( command, " title=\"" );
+               strcat( command, title );
+               strcat( command, "\"" );
+       }
+
        if ( service != NULL || doc != NULL )
        {
                // Initiate the connection if required
@@ -125,12 +144,6 @@ static int consumer_start( mlt_consumer this )
                        {
                                int error;
 
-                               // Set the title if provided
-                               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" );
-
                                // Push the service
                                error = valerie_unit_push( connection, unit, command, service );