gmerlin
converters.h
1 /*****************************************************************
2  * gmerlin - a general purpose multimedia framework and applications
3  *
4  * Copyright (c) 2001 - 2011 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 #include <gavl/gavl.h>
23 #include <gmerlin/plugin.h>
24 
44 typedef struct bg_audio_converter_s bg_audio_converter_t;
45 
50 typedef struct bg_video_converter_s bg_video_converter_t;
51 
52 /* Audio */
53 
61 
73  const gavl_audio_format_t * in_format,
74  const gavl_audio_format_t * out_format);
75 
84  bg_read_audio_func_t func, void * priv,
85  int stream);
86 
97 int bg_audio_converter_read(void * priv, gavl_audio_frame_t* frame, int stream,
98  int num_samples);
99 
105 
113 
114 /* Video */
115 
123 
135  const gavl_video_format_t * in_format,
136  const gavl_video_format_t * out_format);
137 
146  bg_read_video_func_t func, void * priv,
147  int stream);
148 
158 int bg_video_converter_read(void * priv, gavl_video_frame_t* frame, int stream);
159 
165 
173 
struct gavl_audio_options_s gavl_audio_options_t
struct bg_audio_converter_s bg_audio_converter_t
Audio converter.
Definition: converters.h:44
void bg_audio_converter_destroy(bg_audio_converter_t *cnv)
Destroy an audio converter and free all associated memory.
struct gavl_video_options_s gavl_video_options_t
int bg_audio_converter_init(bg_audio_converter_t *cnv, const gavl_audio_format_t *in_format, const gavl_audio_format_t *out_format)
Initialize an audio converter.
bg_audio_converter_t * bg_audio_converter_create(const gavl_audio_options_t *opt)
Create an audio converter.
int bg_video_converter_init(bg_video_converter_t *cnv, const gavl_video_format_t *in_format, const gavl_video_format_t *out_format)
Initialize a video converter.
void bg_audio_converter_reset(bg_audio_converter_t *cnv)
Reset an audio converter as if no samples have been processed since initialization.
int bg_video_converter_read(void *priv, gavl_video_frame_t *frame, int stream)
Read a video frame from a video converter.
bg_video_converter_t * bg_video_converter_create(const gavl_video_options_t *opt)
Create a video converter.
int bg_audio_converter_read(void *priv, gavl_audio_frame_t *frame, int stream, int num_samples)
Read samples from an audio converter.
void bg_video_converter_connect_input(bg_video_converter_t *cnv, bg_read_video_func_t func, void *priv, int stream)
Set input callback of a video converter.
int(* bg_read_video_func_t)(void *priv, gavl_video_frame_t *frame, int stream)
Generic prototype for reading video.
Definition: plugin.h:90
void bg_video_converter_destroy(bg_video_converter_t *cnv)
Destroy a video converter and free all associated memory.
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:75
void bg_video_converter_reset(bg_video_converter_t *cnv)
Reset a video converter as if no samples have been processed since initialization.
struct bg_video_converter_s bg_video_converter_t
Video converter.
Definition: converters.h:50
void bg_audio_converter_connect_input(bg_audio_converter_t *cnv, bg_read_audio_func_t func, void *priv, int stream)
Set input callback of an audio converter.