#include <stdlib.h>
#include <sys/time.h>
+static void mlt_consumer_frame_render( mlt_listener listener, mlt_properties owner, mlt_service this, void **args );
static void mlt_consumer_frame_show( mlt_listener listener, mlt_properties owner, mlt_service this, void **args );
/** Public final methods
this->format = mlt_image_yuv422;
mlt_events_register( properties, "consumer-frame-show", ( mlt_transmitter )mlt_consumer_frame_show );
+ mlt_events_register( properties, "consumer-frame-render", ( mlt_transmitter )mlt_consumer_frame_render );
mlt_events_register( properties, "consumer-stopped", NULL );
// Create the push mutex and condition
listener( owner, this, ( mlt_frame )args[ 0 ] );
}
+static void mlt_consumer_frame_render( mlt_listener listener, mlt_properties owner, mlt_service this, void **args )
+{
+ if ( listener != NULL )
+ listener( owner, this, ( mlt_frame )args[ 0 ] );
+}
+
/** Create a new consumer.
*/
// Get the image of the first frame
if ( !video_off )
+ {
+ mlt_events_fire( MLT_CONSUMER_PROPERTIES( this ), "consumer-frame-render", frame, NULL );
mlt_frame_get_image( frame, &image, &this->format, &width, &height, 0 );
+ }
if ( !audio_off )
{
// All non normal playback frames should be shown
if ( mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "_speed" ) != 1 )
{
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "consumer_deinterlace", 1 );
skipped = 0;
time_frame = 0;
time_process = 0;
{
// Get the image, mark as rendered and time it
if ( !video_off )
+ {
+ mlt_events_fire( MLT_CONSUMER_PROPERTIES( this ), "consumer-frame-render", frame, NULL );
mlt_frame_get_image( frame, &image, &this->format, &width, &height, 0 );
+ }
mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 1 );
}
else
static void consumer_read_ahead_start( mlt_consumer this )
{
- pthread_attr_t thread_attributes;
-
// We're running now
this->ahead = 1;
// Create the condition
pthread_cond_init( &this->cond, NULL );
- // Inherit the scheduling priority
- pthread_attr_init( &thread_attributes );
- pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
-
// Create the read ahead
- pthread_create( &this->ahead_thread, &thread_attributes, consumer_read_ahead_thread, this );
+ pthread_create( &this->ahead_thread, NULL, consumer_read_ahead_thread, this );
}
static void consumer_read_ahead_stop( mlt_consumer this )