]> git.sesse.net Git - mlt/commitdiff
Move firing consumer-frame-show to after done with image.
authorDan Dennedy <dan@dennedy.org>
Thu, 5 Aug 2010 06:12:54 +0000 (23:12 -0700)
committerDan Dennedy <dan@dennedy.org>
Thu, 5 Aug 2010 06:12:54 +0000 (23:12 -0700)
src/modules/avformat/consumer_avformat.c
src/modules/dv/consumer_libdv.c
src/modules/linsys/consumer_SDIstream.c
src/modules/sdl/consumer_sdl.c
src/modules/sdl/consumer_sdl_still.c

index 7cd56e0a9c780c920eac7de635b62a00eb687dba..db63b487289fdfa1ed601c7e175bbfe30a8e4bb1 100644 (file)
@@ -1264,8 +1264,6 @@ static void *consumer_thread( void *arg )
                                                uint8_t *p;
                                                uint8_t *q;
 
-                                               mlt_events_fire( properties, "consumer-frame-show", frame, NULL );
-
                                                mlt_frame_get_image( frame, &image, &img_fmt, &img_width, &img_height, 0 );
 
                                                q = image;
@@ -1293,6 +1291,8 @@ static void *consumer_thread( void *arg )
                                                img_convert( ( AVPicture * )output, video_st->codec->pix_fmt, ( AVPicture * )input, PIX_FMT_YUYV422, width, height );
 #endif
 
+                                               mlt_events_fire( properties, "consumer-frame-show", frame, NULL );
+
                                                // Apply the alpha if applicable
                                                if ( video_st->codec->pix_fmt == PIX_FMT_RGB32 )
                                                {
index f9a8ba644cb510e7966a90af740ec65ffcd476be..3a9949c277ed7683dbc39ae8d7af9df3c6106887 100644 (file)
@@ -218,7 +218,6 @@ static int consumer_encode_video( mlt_consumer this, uint8_t *dv_frame, mlt_fram
                uint8_t *image = NULL;
 
                // Get the image
-               mlt_events_fire( this_properties, "consumer-frame-show", frame, NULL );
                mlt_frame_get_image( frame, &image, &fmt, &width, &height, 0 );
 
                // Check that we get what we expected
@@ -242,6 +241,7 @@ static int consumer_encode_video( mlt_consumer this, uint8_t *dv_frame, mlt_fram
                        // Encode the image
                        dv_encode_full_frame( encoder, &image, e_dv_color_yuv, dv_frame );
                }
+               mlt_events_fire( this_properties, "consumer-frame-show", frame, NULL );
        }
        else if ( encoder != NULL )
        {
index aa251c22308d23ef27fb9012cf4cbf609b50e467..429555ab935280a2f390eb7f53e6c28613034bc4 100644 (file)
@@ -500,6 +500,7 @@ static void *consumer_thread(void *arg) {
                                        } else if (save_jpegs > 0) {
                                                counter++;
                                        }
+                                       mlt_events_fire(MLT_CONSUMER_PROPERTIES( consumer ), "consumer-frame-show", frame, NULL );
                                } else {
                                        mlt_log_warning(MLT_CONSUMER_SERVICE(consumer), "Videobuffer was NULL, skipping playout!\n");
                                }
index b4fe3934cd3f75c1af0b53ba691eb02b6ad562a0..8d53c19e8779e765e34d3e1c0ba944cf9650536d 100644 (file)
@@ -462,7 +462,6 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
                // Get the image, width and height
                mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
                mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "format", vfmt );
-               mlt_events_fire( properties, "consumer-frame-show", frame, NULL );
                
                void *pool = mlt_cocoa_autorelease_init();
 
@@ -614,6 +613,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
 
                sdl_unlock_display();
                mlt_cocoa_autorelease_close( pool );
+               mlt_events_fire( properties, "consumer-frame-show", frame, NULL );
        }
        else if ( this->running )
        {
index 7ab97d1c4f49325542631ab8ab0043577f2176f2..b08a4cb8df12a86e9c98841aba447f7cf3a35c11 100644 (file)
@@ -466,7 +466,6 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
 
        // Get the image, width and height
        mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
-       mlt_events_fire( properties, "consumer-frame-show", frame, NULL );
 
        if ( image != NULL )
        {
@@ -533,6 +532,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
        sdl_unlock_display();
        mlt_cocoa_autorelease_close( pool );
        if ( unlock != NULL ) unlock( );
+       mlt_events_fire( properties, "consumer-frame-show", frame, NULL );
 
        return 1;
 }