|
mlt 0.7.6
|
00001 00025 #ifndef _MLT_CONSUMER_H_ 00026 #define _MLT_CONSUMER_H_ 00027 00028 #include "mlt_service.h" 00029 #include "mlt_events.h" 00030 #include <pthread.h> 00031 00075 struct mlt_consumer_s 00076 { 00078 struct mlt_service_s parent; 00079 00085 int ( *start )( mlt_consumer ); 00086 00092 int ( *stop )( mlt_consumer ); 00093 00099 int ( *is_stopped )( mlt_consumer ); 00100 00105 void ( *close )( mlt_consumer ); 00106 00107 void *local; 00108 void *child; 00110 int real_time; 00111 int ahead; 00112 mlt_image_format format; 00113 mlt_deque queue; 00114 pthread_t ahead_thread; 00115 pthread_mutex_t queue_mutex; 00116 pthread_cond_t queue_cond; 00117 pthread_mutex_t put_mutex; 00118 pthread_cond_t put_cond; 00119 mlt_frame put; 00120 int put_active; 00121 mlt_event event_listener; 00122 mlt_position position; 00123 00124 /* additional fields added for the parallel work queue */ 00125 mlt_deque worker_threads; 00126 pthread_mutex_t done_mutex; 00127 pthread_cond_t done_cond; 00128 int consecutive_dropped; 00129 int consecutive_rendered; 00130 int process_head; 00131 int started; 00132 }; 00133 00134 #define MLT_CONSUMER_SERVICE( consumer ) ( &( consumer )->parent ) 00135 #define MLT_CONSUMER_PROPERTIES( consumer ) MLT_SERVICE_PROPERTIES( MLT_CONSUMER_SERVICE( consumer ) ) 00136 00137 extern int mlt_consumer_init( mlt_consumer self, void *child, mlt_profile profile ); 00138 extern mlt_consumer mlt_consumer_new( mlt_profile profile ); 00139 extern mlt_service mlt_consumer_service( mlt_consumer self ); 00140 extern mlt_properties mlt_consumer_properties( mlt_consumer self ); 00141 extern int mlt_consumer_connect( mlt_consumer self, mlt_service producer ); 00142 extern int mlt_consumer_start( mlt_consumer self ); 00143 extern void mlt_consumer_purge( mlt_consumer self ); 00144 extern int mlt_consumer_put_frame( mlt_consumer self, mlt_frame frame ); 00145 extern mlt_frame mlt_consumer_get_frame( mlt_consumer self ); 00146 extern mlt_frame mlt_consumer_rt_frame( mlt_consumer self ); 00147 extern int mlt_consumer_stop( mlt_consumer self ); 00148 extern int mlt_consumer_is_stopped( mlt_consumer self ); 00149 extern void mlt_consumer_stopped( mlt_consumer self ); 00150 extern void mlt_consumer_close( mlt_consumer ); 00151 extern mlt_position mlt_consumer_position( mlt_consumer ); 00152 00153 #endif
1.7.3