Exemplo n.º 1
0
Arquivo: melt.c Projeto: hrshadhin/mlt
static void setup_jack_transport( mlt_consumer consumer, mlt_profile profile )
{
    mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
    mlt_filter jack = mlt_factory_filter( profile, "jackrack", NULL );
    mlt_properties jack_properties = MLT_FILTER_PROPERTIES(jack);

    mlt_service_attach( MLT_CONSUMER_SERVICE(consumer), jack );
    mlt_properties_set_int( properties, "audio_off", 1 );
    mlt_properties_set_data( properties, "jack_filter", jack, 0, (mlt_destructor) mlt_filter_close, NULL );
//	mlt_properties_set( jack_properties, "out_1", "system:playback_1" );
//	mlt_properties_set( jack_properties, "out_2", "system:playback_2" );
    mlt_events_listen( jack_properties, consumer, "jack-started", (mlt_listener) on_jack_started );
    mlt_events_listen( jack_properties, consumer, "jack-stopped", (mlt_listener) on_jack_stopped );
}
Exemplo n.º 2
0
static void create_filter( mlt_profile profile, mlt_service service, char *effect, int *created )
{
    char *id = strdup( effect );
    char *arg = strchr( id, ':' );
    if ( arg != NULL )
        *arg ++ = '\0';

    // The swscale and avcolor_space filters require resolution as arg to test compatibility
    if ( strncmp( effect, "swscale", 7 ) == 0 || strncmp( effect, "avcolo", 6 ) == 0 )
        arg = (char*) mlt_properties_get_int( MLT_SERVICE_PROPERTIES( service ), "meta.media.width" );

    mlt_filter filter = mlt_factory_filter( profile, id, arg );
    if ( filter != NULL )
    {
        mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_loader", 1 );
        mlt_service_attach( service, filter );
        mlt_filter_close( filter );
        *created = 1;
    }
    free( id );
}
Exemplo n.º 3
0
int mlt_producer_attach( mlt_producer self, mlt_filter filter )
{
	return mlt_service_attach( MLT_PRODUCER_SERVICE( self ), filter );
}