/* * factory.c -- the factory method interfaces * Copyright (C) 2003-2004 Ushodaya Enterprises Limited * Author: Charles Yates * * 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 * Lesser General Public License for more details. * * 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 */ #include #include extern mlt_consumer consumer_null_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_brightness_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_channelcopy_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_data_feed_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_data_show_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_gamma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_greyscale_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_mirror_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_obscure_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_region_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_rescale_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_resize_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_transition_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_watermark_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_producer producer_colour_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_producer producer_noise_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_producer producer_ppm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); #include "transition_composite.h" extern mlt_transition transition_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_transition transition_mix_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); #include "transition_region.h" void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg ) { if ( !strcmp( id, "color" ) ) return producer_colour_init( profile, type, id, arg ); if ( !strcmp( id, "colour" ) ) return producer_colour_init( profile, type, id, arg ); if ( !strcmp( id, "noise" ) ) return producer_noise_init( profile, type, id, arg ); if ( !strcmp( id, "ppm" ) ) return producer_ppm_init( profile, type, id, arg ); return NULL; } void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, void *arg ) { if ( !strcmp( id, "brightness" ) ) return filter_brightness_init( profile, type, id, arg ); if ( !strcmp( id, "channelcopy" ) ) return filter_channelcopy_init( profile, type, id, arg ); if ( !strcmp( id, "data_feed" ) ) return filter_data_feed_init( profile, type, id, arg ); if ( !strcmp( id, "data_show" ) ) return filter_data_show_init( profile, type, id, arg ); if ( !strcmp( id, "gamma" ) ) return filter_gamma_init( profile, type, id, arg ); if ( !strcmp( id, "greyscale" ) ) return filter_greyscale_init( profile, type, id, arg ); if ( !strcmp( id, "luma" ) ) return filter_luma_init( profile, type, id, arg ); if ( !strcmp( id, "mirror" ) ) return filter_mirror_init( profile, type, id, arg ); if ( !strcmp( id, "mono" ) ) return filter_mono_init( profile, type, id, arg ); if ( !strcmp( id, "obscure" ) ) return filter_obscure_init( profile, type, id, arg ); if ( !strcmp( id, "region" ) ) return filter_region_init( profile, type, id, arg ); if ( !strcmp( id, "rescale" ) ) return filter_rescale_init( profile, type, id, arg ); if ( !strcmp( id, "resize" ) ) return filter_resize_init( profile, type, id, arg ); if ( !strcmp( id, "transition" ) ) return filter_transition_init( profile, type, id, arg ); if ( !strcmp( id, "watermark" ) ) return filter_watermark_init( profile, type, id, arg ); return NULL; } void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, void *arg ) { if ( !strcmp( id, "composite" ) ) return transition_composite_init( profile, type, id, arg ); if ( !strcmp( id, "luma" ) ) return transition_luma_init( profile, type, id, arg ); if ( !strcmp( id, "mix" ) ) return transition_mix_init( profile, type, id, arg ); if ( !strcmp( id, "region" ) ) return transition_region_init( profile, type, id, arg ); return NULL; } void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, void *arg ) { if ( !strcmp( id, "null" ) ) return consumer_null_init( profile, type, id, arg ); return NULL; }