/*****************************************************************************1* video.c: video filters2*****************************************************************************3* Copyright (C) 2010-2016 x264 project4*5* Authors: Steven Walters <[email protected]>6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.20*21* This program is also available under a commercial proprietary license.22* For more information, contact us at [email protected].23*****************************************************************************/2425#include "video.h"2627static cli_vid_filter_t *first_filter = NULL;2829static void register_vid_filter( cli_vid_filter_t *new_filter )30{31cli_vid_filter_t *filter_i = first_filter;32while( filter_i->next )33filter_i = filter_i->next;34filter_i->next = new_filter;35new_filter->next = NULL;36}3738#define REGISTER_VFILTER(name)\39{\40extern cli_vid_filter_t name##_filter;\41register_vid_filter( &name##_filter );\42}4344void x264_register_vid_filters( void )45{46extern cli_vid_filter_t source_filter;47first_filter = &source_filter;48REGISTER_VFILTER( cache );49REGISTER_VFILTER( crop );50REGISTER_VFILTER( fix_vfr_pts );51REGISTER_VFILTER( resize );52REGISTER_VFILTER( select_every );53REGISTER_VFILTER( depth );54#if HAVE_GPL55#endif56}5758int x264_init_vid_filter( const char *name, hnd_t *handle, cli_vid_filter_t *filter,59video_info_t *info, x264_param_t *param, char *opt_string )60{61cli_vid_filter_t *filter_i = first_filter;62while( filter_i && strcasecmp( name, filter_i->name ) )63filter_i = filter_i->next;64FAIL_IF_ERR( !filter_i, "x264", "invalid filter `%s'\n", name );65if( filter_i->init( handle, filter, info, param, opt_string ) )66return -1;6768return 0;69}7071void x264_vid_filter_help( int longhelp )72{73for( cli_vid_filter_t *filter_i = first_filter; filter_i; filter_i = filter_i->next )74if( filter_i->help )75filter_i->help( longhelp );76}777879