gmerlin
filters.h
1 /*****************************************************************
2  * gmerlin - a general purpose multimedia framework and applications
3  *
4  * Copyright (c) 2001 - 2012 Members of the Gmerlin project
5  * gmerlin-general@lists.sourceforge.net
6  * http://gmerlin.sourceforge.net
7  *
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.
12  *
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.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  * *****************************************************************/
21 
22 
23 #include <gavl/gavl.h>
24 #include <gmerlin/bggavl.h>
25 #include <gmerlin/plugin.h>
26 
27 
28 
41 typedef struct bg_audio_filter_chain_s bg_audio_filter_chain_t;
42 
49 typedef struct bg_video_filter_chain_s bg_video_filter_chain_t;
50 
51 /* Audio */
52 
61 bg_audio_filter_chain_create(const bg_gavl_audio_options_t * opt,
62  bg_plugin_registry_t * plugin_reg);
63 
72 const bg_parameter_info_t *
74 
86  const char * name,
87  const bg_parameter_value_t * val);
88 
99 
100 
101 
113  void * priv,
114  int stream);
115 
123  const gavl_audio_format_t * in_format,
124  gavl_audio_format_t * out_format);
125 
136  const gavl_audio_format_t * out_format);
137 
147  int stream,
148  int num_samples);
149 
155 
164 
173 
181 
192 gavl_audio_source_t *
194  gavl_audio_source_t * src);
195 
196 
197 /* Video */
198 
207 bg_video_filter_chain_create(const bg_gavl_video_options_t * opt,
208  bg_plugin_registry_t * plugin_reg);
209 
218 const bg_parameter_info_t *
220 
232 void bg_video_filter_chain_set_parameter(void * data, const char * name,
233  const bg_parameter_value_t * val);
234 
245 
246 
258  void * priv, int stream);
259 
267  const gavl_video_format_t * in_format,
268  gavl_video_format_t * out_format);
269 
279  const gavl_video_format_t * out_format);
280 
281 
290  int stream);
291 
302 gavl_video_source_t *
304  gavl_video_source_t * src);
305 
311 
320 
329 
337 
void bg_audio_filter_chain_lock(void *ch)
Lock an audio filter chain.
void bg_video_filter_chain_unlock(void *ch)
Unlock a video filter chain.
void bg_audio_filter_chain_destroy(bg_audio_filter_chain_t *ch)
Destroy an audio filter chain.
bg_audio_filter_chain_t * bg_audio_filter_chain_create(const bg_gavl_audio_options_t *opt, bg_plugin_registry_t *plugin_reg)
Create an audio filter chain.
const bg_parameter_info_t * bg_audio_filter_chain_get_parameters(bg_audio_filter_chain_t *ch)
Return parameters.
const bg_parameter_info_t * bg_video_filter_chain_get_parameters(bg_video_filter_chain_t *ch)
Return parameters.
int bg_audio_filter_chain_read(void *priv, gavl_audio_frame_t *frame, int stream, int num_samples)
Read a audio samples from an audio filter chain.
int bg_audio_filter_chain_need_restart(bg_audio_filter_chain_t *ch)
Check if an audio filter chain needs to be restarted.
int bg_audio_filter_chain_init(bg_audio_filter_chain_t *ch, const gavl_audio_format_t *in_format, gavl_audio_format_t *out_format)
Initialize an audio filter chain.
void bg_audio_filter_chain_connect_input(bg_audio_filter_chain_t *ch, bg_read_audio_func_t func, void *priv, int stream)
Set input callback of an audio filter chain.
bg_video_filter_chain_t * bg_video_filter_chain_create(const bg_gavl_video_options_t *opt, bg_plugin_registry_t *plugin_reg)
Create a video filter chain.
void bg_video_filter_chain_destroy(bg_video_filter_chain_t *ch)
Destroy a video filter chain.
void bg_video_filter_chain_reset(bg_video_filter_chain_t *ch)
Reset a video filter chain.
int bg_video_filter_chain_need_restart(bg_video_filter_chain_t *ch)
Check if a video filter chain needs to be restarted.
void bg_audio_filter_chain_unlock(void *ch)
Unlock an audio filter chain.
struct bg_video_filter_chain_s bg_video_filter_chain_t
Video filter chain.
Definition: filters.h:49
void bg_audio_filter_chain_reset(bg_audio_filter_chain_t *ch)
Reset an audio filter chain.
struct bg_audio_filter_chain_s bg_audio_filter_chain_t
Audio filter chain.
Definition: filters.h:41
int bg_video_filter_chain_read(void *priv, gavl_video_frame_t *frame, int stream)
Read a video frame from a video filter chain.
void bg_audio_filter_chain_set_parameter(void *data, const char *name, const bg_parameter_value_t *val)
Set a parameter for an audio chain.
int bg_audio_filter_chain_set_out_format(bg_audio_filter_chain_t *ch, const gavl_audio_format_t *out_format)
Set output format of an audio filter chain.
void bg_video_filter_chain_connect_input(bg_video_filter_chain_t *ch, bg_read_video_func_t func, void *priv, int stream)
Set input callback of a video filter chain.
void bg_video_filter_chain_set_parameter(void *data, const char *name, const bg_parameter_value_t *val)
Set a parameter for a video chain.
int bg_video_filter_chain_init(bg_video_filter_chain_t *ch, const gavl_video_format_t *in_format, gavl_video_format_t *out_format)
Initialize a video filter chain.
gavl_video_source_t * bg_video_filter_chain_connect(bg_video_filter_chain_t *ch, gavl_video_source_t *src)
Connect using video sources.
int bg_video_filter_chain_set_out_format(bg_video_filter_chain_t *ch, const gavl_video_format_t *out_format)
Set output format of a video filter chain.
void bg_video_filter_chain_lock(void *ch)
Lock a video filter chain.
gavl_audio_source_t * bg_audio_filter_chain_connect(bg_audio_filter_chain_t *ch, gavl_audio_source_t *src)
Connect using audio sources.
struct bg_plugin_registry_s bg_plugin_registry_t
Opaque handle for a plugin registry.
Definition: pluginregistry.h:143
int(* bg_read_audio_func_t)(void *priv, gavl_audio_frame_t *frame, int stream, int num_samples)
Generic prototype for reading audio.
Definition: plugin.h:81
int(* bg_read_video_func_t)(void *priv, gavl_video_frame_t *frame, int stream)
Generic prototype for reading video.
Definition: plugin.h:96
Parmeter description.
Definition: parameter.h:135
Container for a parameter value.
Definition: parameter.h:83