X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_consumer.h;h=224570413c6cf87dfc0609e20b71fcfb5a6c773d;hb=cddee0085dfff8fc8600fe1940cccadbc024de9b;hp=290d02b88293a7648ebca9bb3abb0c01e88c9bc3;hpb=9ab18ed63c37a9ef65e06697ae25f5c198d788bb;p=melted diff --git a/src/framework/mlt_consumer.h b/src/framework/mlt_consumer.h index 290d02b..2245704 100644 --- a/src/framework/mlt_consumer.h +++ b/src/framework/mlt_consumer.h @@ -1,66 +1,82 @@ -/* - * mlt_consumer.h -- abstraction for all consumer services - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Charles Yates +/** + * \file mlt_consumer.h + * \brief abstraction for all consumer services * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Copyright (C) 2003-2008 Ushodaya Enterprises Limited + * \author Charles Yates * - * This program is distributed in the hope that it will be useful, + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _MLT_CONSUMER_H_ #define _MLT_CONSUMER_H_ #include "mlt_service.h" +#include "mlt_events.h" #include -/** The interface definition for all consumers. -*/ +/** \brief Consumer abstract service class + * + * \extends mlt_service_s + */ struct mlt_consumer_s { - // We're implementing service here + /* We're implementing service here */ struct mlt_service_s parent; - // public virtual + /* public virtual */ int ( *start )( mlt_consumer ); int ( *stop )( mlt_consumer ); int ( *is_stopped )( mlt_consumer ); void ( *close )( mlt_consumer ); - // Private data - void *private; + /* Private data */ + void *local; void *child; + int real_time; int ahead; - int width; - int height; mlt_image_format format; mlt_deque queue; pthread_t ahead_thread; + pthread_mutex_t mutex; + pthread_cond_t cond; + pthread_mutex_t put_mutex; + pthread_cond_t put_cond; + mlt_frame put; + int put_active; + mlt_event event_listener; }; -/** Public final methods -*/ +#define MLT_CONSUMER_SERVICE( consumer ) ( &( consumer )->parent ) +#define MLT_CONSUMER_PROPERTIES( consumer ) MLT_SERVICE_PROPERTIES( MLT_CONSUMER_SERVICE( consumer ) ) -extern int mlt_consumer_init( mlt_consumer this, void *child ); -extern mlt_service mlt_consumer_service( mlt_consumer this ); -extern mlt_properties mlt_consumer_properties( mlt_consumer this ); -extern int mlt_consumer_connect( mlt_consumer this, mlt_service producer ); -extern int mlt_consumer_start( mlt_consumer this ); -extern mlt_frame mlt_consumer_get_frame( mlt_consumer this ); -extern int mlt_consumer_stop( mlt_consumer this ); -extern int mlt_consumer_is_stopped( mlt_consumer this ); +extern int mlt_consumer_init( mlt_consumer self, void *child, mlt_profile profile ); +extern mlt_consumer mlt_consumer_new( mlt_profile profile ); +extern mlt_service mlt_consumer_service( mlt_consumer self ); +extern mlt_properties mlt_consumer_properties( mlt_consumer self ); +extern int mlt_consumer_connect( mlt_consumer self, mlt_service producer ); +extern int mlt_consumer_start( mlt_consumer self ); +extern void mlt_consumer_purge( mlt_consumer self ); +extern int mlt_consumer_put_frame( mlt_consumer self, mlt_frame frame ); +extern mlt_frame mlt_consumer_get_frame( mlt_consumer self ); +extern mlt_frame mlt_consumer_rt_frame( mlt_consumer self ); +extern int mlt_consumer_stop( mlt_consumer self ); +extern int mlt_consumer_is_stopped( mlt_consumer self ); +extern void mlt_consumer_stopped( mlt_consumer self ); extern void mlt_consumer_close( mlt_consumer ); #endif