#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sched.h>
/* Application header files */
#include <miracle/miracle_local.h>
}
else
{
+ struct sched_param scp;
+
+ // Use realtime scheduling if possible
+ memset( &scp, '\0', sizeof( scp ) );
+ scp.sched_priority = sched_get_priority_max( SCHED_FIFO ) - 1;
+ sched_setscheduler( 0, SCHED_RR, &scp );
+
printf( "Miracle Standalone Instance\n" );
parser = miracle_parser_init_local( );
response = valerie_parser_connect( parser );
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 )
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sched.h>
#include <framework/mlt.h>
mlt_producer inigo = NULL;
FILE *store = NULL;
char *name = NULL;
+ struct sched_param scp;
+
+ // Use realtime scheduling if possible
+ memset( &scp, '\0', sizeof( scp ) );
+ scp.sched_priority = sched_get_priority_max( SCHED_FIFO ) - 1;
+ sched_setscheduler( 0, SCHED_FIFO, &scp );
// Construct the factory
mlt_factory_init( NULL );
#include <sys/types.h>
#include <unistd.h>
#include <time.h>
+#include <sched.h>
#include <framework/mlt.h>
int index = 0;
int background = 1;
struct timespec tm = { 5, 0 };
+ struct sched_param scp;
+
+ // Use realtime scheduling if possible
+ memset( &scp, '\0', sizeof( scp ) );
+ scp.sched_priority = sched_get_priority_max( SCHED_FIFO ) - 1;
+ sched_setscheduler( 0, SCHED_RR, &scp );
mlt_factory_init( NULL );
their resources get freed automatically. (CY: ... hmmph...) */
pthread_attr_init( &thread_attributes );
pthread_attr_setdetachstate( &thread_attributes, PTHREAD_CREATE_DETACHED );
- pthread_attr_init( &thread_attributes );
- pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
- /* pthread_attr_setschedpolicy( &thread_attributes, SCHED_RR ); */
while ( !server->shutdown )
{
if ( response != NULL )
{
- pthread_attr_t attr;
int result;
- pthread_attr_init( &attr );
- pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE );
- pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
- pthread_attr_setschedpolicy( &attr, SCHED_FIFO );
- pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
valerie_response_close( response );
- result = pthread_create( &server->thread, &attr, miracle_server_run, server );
+ result = pthread_create( &server->thread, NULL, miracle_server_run, server );
if ( result )
{
- miracle_log( LOG_WARNING, "Failed to schedule realtime (%s)", strerror(errno) );
- pthread_attr_setschedpolicy( &attr, SCHED_OTHER );
- result = pthread_create( &server->thread, &attr, miracle_server_run, server );
- if ( result )
- {
- miracle_log( LOG_CRIT, "Failed to launch TCP listener thread" );
- error = -1;
- }
+ miracle_log( LOG_CRIT, "Failed to launch TCP listener thread" );
+ error = -1;
}
}
}
{
// Allocate a thread
pthread_t *thread = calloc( 1, sizeof( pthread_t ) );
- pthread_attr_t thread_attributes;
// Get the width and height
int width = mlt_properties_get_int( properties, "width" );
// Set the running state
mlt_properties_set_int( properties, "running", 1 );
- // Inherit the scheduling priority
- pthread_attr_init( &thread_attributes );
- pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
-
// Create the thread
- pthread_create( thread, &thread_attributes, consumer_thread, this );
+ pthread_create( thread, NULL, consumer_thread, this );
}
return 0;
}
{
// Allocate a thread
pthread_t *thread = calloc( 1, sizeof( pthread_t ) );
- pthread_attr_t thread_attributes;
// Assign the thread to properties
mlt_properties_set_data( properties, "thread", thread, sizeof( pthread_t ), free, NULL );
// Set the running state
mlt_properties_set_int( properties, "running", 1 );
- // Inherit the scheduling priority
- pthread_attr_init( &thread_attributes );
- pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
-
// Create the thread
- pthread_create( thread, &thread_attributes, consumer_thread, this );
+ pthread_create( thread, NULL, consumer_thread, this );
}
return 0;
}
{
// Allocate a thread
pthread_t *thread = calloc( 1, sizeof( pthread_t ) );
- pthread_attr_t thread_attributes;
// Assign the thread to properties
mlt_properties_set_data( properties, "thread", thread, sizeof( pthread_t ), free, NULL );
// Set the running state
mlt_properties_set_int( properties, "running", 1 );
- // Inherit the scheduling priority
- pthread_attr_init( &thread_attributes );
- pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
-
// Create the thread
- pthread_create( thread, &thread_attributes, consumer_thread, this );
+ pthread_create( thread, NULL, consumer_thread, this );
}
return 0;
}
this->quality = DV_QUALITY_COLOR | DV_QUALITY_AC_2;
this->audio->arg_audio_emphasis = 2;
dv_set_audio_correction( this, DV_AUDIO_CORRECT_AVERAGE );
+ dv_set_error_log( this, NULL );
// Register it with the properties to ensure clean up
sprintf( label, "%p", this );
mlt_properties_set_position( properties, "out", 25 );
mlt_properties_set_position( properties, "length", 15000 );
mlt_properties_set( properties, "resource", arg );
+ mlt_properties_set( properties, "method", "onefield" );
// Override the get_frame method
this->get_frame = producer_get_frame;
// Ensure that the consumer sees what the real frame has
mlt_properties_pass( MLT_FRAME_PROPERTIES( *frame ), MLT_FRAME_PROPERTIES( real_frame ), "" );
+
+ mlt_properties_set( MLT_FRAME_PROPERTIES( real_frame ), "deinterlace_method",
+ mlt_properties_get( properties, "method" ) );
}
// Move to the next position
else if ( strchr( filename, '%' ) != NULL )
{
// handle picture sequences
- int i = 0;
+ int i = mlt_properties_get_int( properties, "begin" );
int gap = 0;
char full[1024];
if ( !this->running )
{
- pthread_attr_t thread_attributes;
-
consumer_stop( parent );
this->running = 1;
mlt_properties_set_int( this->properties, "height", this->height );
}
- // Inherit the scheduling priority
- pthread_attr_init( &thread_attributes );
- pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
-
- pthread_create( &this->thread, &thread_attributes, consumer_thread, this );
+ pthread_create( &this->thread, NULL, consumer_thread, this );
}
return 0;
if ( !this->running )
{
- pthread_attr_t thread_attributes;
-
consumer_stop( parent );
this->running = 1;
this->joined = 0;
this->last_speed = 1;
- // Inherit the scheduling priority
- pthread_attr_init( &thread_attributes );
- pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
-
- pthread_create( &this->thread, &thread_attributes, consumer_thread, this );
+ pthread_create( &this->thread, NULL, consumer_thread, this );
}
return 0;
if ( !this->running )
{
- pthread_attr_t thread_attributes;
-
// Attach a colour space converter
if ( !this->filtered )
{
//this->width = this->height * this->display_aspect;
- // Inherit the scheduling priority
- pthread_attr_init( &thread_attributes );
- pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
-
- pthread_create( &this->thread, &thread_attributes, consumer_thread, this );
+ pthread_create( &this->thread, NULL, consumer_thread, this );
}
return 0;
char *method_str = mlt_properties_get( MLT_FILTER_PROPERTIES( filter ), "method" );
int method = DEINTERLACE_LINEARBLEND;
- if ( strcmp( method_str, "bob" ) == 0 )
+ if ( method_str == NULL )
+ method_str = mlt_properties_get( MLT_FRAME_PROPERTIES( this ), "deinterlace_method" );
+
+ if ( method_str == NULL )
+ mlt_properties_set( MLT_FILTER_PROPERTIES( filter ), "method", "linearblend" );
+ else if ( strcmp( method_str, "bob" ) == 0 )
method = DEINTERLACE_BOB;
else if ( strcmp( method_str, "weave" ) == 0 )
method = DEINTERLACE_BOB;
if ( this != NULL )
{
this->process = deinterlace_process;
- mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "method", arg == NULL ? "linearblend" : arg );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "method", arg );
}
return this;
}