1 /*****************************************************************************
2 * video.h: video filters
3 *****************************************************************************
4 * Copyright (C) 2010-2016 x264 project
6 * Authors: Steven Walters <kemuri9@gmail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
22 * This program is also available under a commercial proprietary license.
23 * For more information, contact us at licensing@x264.com.
24 *****************************************************************************/
26 #ifndef X264_FILTER_VIDEO_H
27 #define X264_FILTER_VIDEO_H
29 #include "input/input.h"
30 #include "filters/filters.h"
32 typedef struct cli_vid_filter_t cli_vid_filter_t;
34 struct cli_vid_filter_t
36 /* name of the filter */
38 /* help: a short message on what the filter does and how to use it.
39 * this should only be implemented by filters directly accessible by the user */
40 void (*help)( int longhelp );
41 /* init: initializes the filter given the input clip properties and parameter to adjust them as necessary
42 * with the given options provided by the user.
43 * returns 0 on success, nonzero on error. */
44 int (*init)( hnd_t *handle, cli_vid_filter_t *filter, video_info_t *info, x264_param_t *param, char *opt_string );
45 /* get_frame: given the storage for the output frame and desired frame number, generate the frame accordingly.
46 * the image data returned by get_frame should be treated as const and not be altered.
47 * returns 0 on success, nonzero on error. */
48 int (*get_frame)( hnd_t handle, cli_pic_t *output, int frame );
49 /* release_frame: frame is done being used and is signaled for cleanup.
50 * returns 0 on succeess, nonzero on error. */
51 int (*release_frame)( hnd_t handle, cli_pic_t *pic, int frame );
52 /* free: run filter cleanup procedures. */
53 void (*free)( hnd_t handle );
54 /* next registered filter, unused by filters themselves */
55 cli_vid_filter_t *next;
58 void x264_register_vid_filters( void );
59 void x264_vid_filter_help( int longhelp );
60 int x264_init_vid_filter( const char *name, hnd_t *handle, cli_vid_filter_t *filter,
61 video_info_t *info, x264_param_t *param, char *opt_string );