-/*
- * mlt_consumer.c -- abstraction for all consumer services
- * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
- * Author: Charles Yates <charles.yates@pandora.be>
+/**
+ * \file mlt_consumer.c
+ * \brief abstraction for all consumer services
+ *
+ * Copyright (C) 2003-2008 Ushodaya Enterprises Limited
+ * \author Charles Yates <charles.yates@pandora.be>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static void mlt_consumer_property_changed( mlt_service owner, mlt_consumer this, char *name );
static void apply_profile_properties( mlt_consumer this, mlt_profile profile, mlt_properties properties );
-/** Public final methods
-*/
-
int mlt_consumer_init( mlt_consumer this, void *child, mlt_profile profile )
{
int error = 0;
{
// Get the properties from the service
mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent );
-
+
// Apply profile to properties
if ( profile == NULL )
{
int frame_duration = 1000000 / mlt_properties_get_int( properties, "frame_rate_num" ) *
mlt_properties_get_int( properties, "frame_rate_den" );
mlt_properties_set_int( properties, "frame_duration", frame_duration );
-
+
// Check and run an ante command
if ( mlt_properties_get( properties, "ante" ) )
system( mlt_properties_get( properties, "ante" ) );
// Create the condition
pthread_cond_init( &this->cond, NULL );
- // Create the read ahead
+ // Create the read ahead
if ( mlt_properties_get( MLT_CONSUMER_PROPERTIES( this ), "priority" ) )
{
struct sched_param priority;
if ( buffer > 1 )
size = prefill > 0 && prefill < buffer ? prefill : buffer;
}
-
+
// Get frame from queue
pthread_mutex_lock( &this->mutex );
while( this->ahead && mlt_deque_count( this->queue ) < size )