X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_consumer.c;h=0f2a97f93e9253c780567efb1cdbbd4eb39ba00a;hb=95f429b56026f5897ebad9060608b6631dcf7515;hp=f363248122d9f7813fe69cef25c3fb8cbb16b707;hpb=52c1bb26fcbb895824cd9237c228ea4834ce1433;p=melted diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c index f363248..0f2a97f 100644 --- a/src/framework/mlt_consumer.c +++ b/src/framework/mlt_consumer.c @@ -28,6 +28,8 @@ #include #include +static void mlt_consumer_frame_show( mlt_listener listener, mlt_properties owner, mlt_service this, void **args ); + /** Public final methods */ @@ -83,10 +85,19 @@ int mlt_consumer_init( mlt_consumer this, void *child ) // Hmm - default all consumers to yuv422 :-/ this->format = mlt_image_yuv422; + + mlt_events_register( properties, "consumer-frame-show", ( mlt_transmitter )mlt_consumer_frame_show ); + mlt_events_register( properties, "consumer-stopped", NULL ); } return error; } +static void mlt_consumer_frame_show( 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. */ @@ -477,6 +488,15 @@ mlt_frame mlt_consumer_rt_frame( mlt_consumer this ) return frame; } +/** Callback for the implementation to indicate a stopped condition. +*/ + +void mlt_consumer_stopped( mlt_consumer this ) +{ + mlt_properties_set_int( mlt_consumer_properties( this ), "running", 0 ); + mlt_events_fire( mlt_consumer_properties( this ), "consumer-stopped", NULL ); +} + /** Stop the consumer. */