X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_filter.c;h=6723d2f1c0dcc7dc67a3179edd28a22c4b3be993;hb=bf3264b9e340ba5c11cbf59835a8af3db94e0cc2;hp=37f91db3b8ed7cbd63660b0a907fb42d586fcb98;hpb=52c1bb26fcbb895824cd9237c228ea4834ce1433;p=melted diff --git a/src/framework/mlt_filter.c b/src/framework/mlt_filter.c index 37f91db..6723d2f 100644 --- a/src/framework/mlt_filter.c +++ b/src/framework/mlt_filter.c @@ -3,19 +3,19 @@ * Copyright (C) 2003-2004 Ushodaya Enterprises Limited * Author: Charles Yates * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * 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 program is distributed in the hope that it will be useful, + * 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 General Public License for more details. + * 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 General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * 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 "config.h" @@ -39,7 +39,7 @@ int mlt_filter_init( mlt_filter this, void *child ) this->child = child; if ( mlt_service_init( service, this ) == 0 ) { - mlt_properties properties = mlt_service_properties( service ); + mlt_properties properties = MLT_SERVICE_PROPERTIES( service ); // Override the get_frame method service->get_frame = filter_get_frame; @@ -82,7 +82,7 @@ mlt_service mlt_filter_service( mlt_filter this ) mlt_properties mlt_filter_properties( mlt_filter this ) { - return mlt_service_properties( mlt_filter_service( this ) ); + return MLT_SERVICE_PROPERTIES( MLT_FILTER_SERVICE( this ) ); } /** Connect this filter to a producers track. Note that a filter only operates @@ -96,7 +96,7 @@ int mlt_filter_connect( mlt_filter this, mlt_service producer, int index ) // If the connection was successful, grab the producer, track and reset in/out if ( ret == 0 ) { - mlt_properties properties = mlt_service_properties( &this->parent ); + mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent ); mlt_properties_set_position( properties, "in", 0 ); mlt_properties_set_position( properties, "out", 0 ); mlt_properties_set_int( properties, "track", index ); @@ -110,7 +110,7 @@ int mlt_filter_connect( mlt_filter this, mlt_service producer, int index ) void mlt_filter_set_in_and_out( mlt_filter this, mlt_position in, mlt_position out ) { - mlt_properties properties = mlt_service_properties( &this->parent ); + mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent ); mlt_properties_set_position( properties, "in", in ); mlt_properties_set_position( properties, "out", out ); } @@ -120,7 +120,7 @@ void mlt_filter_set_in_and_out( mlt_filter this, mlt_position in, mlt_position o int mlt_filter_get_track( mlt_filter this ) { - mlt_properties properties = mlt_service_properties( &this->parent ); + mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent ); return mlt_properties_get_int( properties, "track" ); } @@ -129,7 +129,7 @@ int mlt_filter_get_track( mlt_filter this ) mlt_position mlt_filter_get_in( mlt_filter this ) { - mlt_properties properties = mlt_service_properties( &this->parent ); + mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent ); return mlt_properties_get_position( properties, "in" ); } @@ -138,7 +138,7 @@ mlt_position mlt_filter_get_in( mlt_filter this ) mlt_position mlt_filter_get_out( mlt_filter this ) { - mlt_properties properties = mlt_service_properties( &this->parent ); + mlt_properties properties = MLT_SERVICE_PROPERTIES( &this->parent ); return mlt_properties_get_position( properties, "out" ); } @@ -147,7 +147,8 @@ mlt_position mlt_filter_get_out( mlt_filter this ) mlt_frame mlt_filter_process( mlt_filter this, mlt_frame frame ) { - if ( this->process == NULL ) + int disable = mlt_properties_get_int( MLT_FILTER_PROPERTIES( this ), "disable" ); + if ( disable || this->process == NULL ) return frame; else return this->process( this, frame ); @@ -169,7 +170,7 @@ static int filter_get_frame( mlt_service service, mlt_frame_ptr frame, int index mlt_service producer = mlt_service_producer( &this->parent ); // If the frame request is for this filters track, we need to process it - if ( index == track ) + if ( index == track || track == -1 ) { int ret = mlt_service_get_frame( producer, frame, index ); if ( ret == 0 ) @@ -196,7 +197,7 @@ static int filter_get_frame( mlt_service service, mlt_frame_ptr frame, int index void mlt_filter_close( mlt_filter this ) { - if ( this != NULL && mlt_properties_dec_ref( mlt_filter_properties( this ) ) <= 0 ) + if ( this != NULL && mlt_properties_dec_ref( MLT_FILTER_PROPERTIES( this ) ) <= 0 ) { if ( this->close != NULL ) {