A/V Converters


Typedefs

typedef struct bg_audio_converter_s bg_audio_converter_t
 Audio converter.
typedef struct bg_video_converter_s bg_video_converter_t
 Video converter.

Functions

bg_audio_converter_tbg_audio_converter_create (const gavl_audio_options_t *opt)
 Create an audio converter.
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.
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.
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_audio_converter_destroy (bg_audio_converter_t *cnv)
 Destroy an audio converter and free all associated memory.
void bg_audio_converter_reset (bg_audio_converter_t *cnv)
 Reset an audio converter as if no samples have been processed since initialization.
bg_video_converter_tbg_video_converter_create (const gavl_video_options_t *opt)
 Create a video 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_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_video_converter_read (void *priv, gavl_video_frame_t *frame, int stream)
 Read a video frame from a video converter.
void bg_video_converter_destroy (bg_video_converter_t *cnv)
 Destroy a video converter and free all associated memory.
void bg_video_converter_reset (bg_video_converter_t *cnv)
 Reset a video converter as if no samples have been processed since initialization.

Detailed Description

A/V converters, which can be plugged together with filters and input plugins. These are basically wrappers around the gavl_audio_converter_t and the gavl_video_converter_t with the difference, that they work asynchronous with the advantage, that the video converter can do framerate conversion as well.

The functions for reading A/V frames are compatible with the read functions of input plugins and filters for easy generation of processing pipelines.


Typedef Documentation

typedef struct bg_audio_converter_s bg_audio_converter_t

Audio converter.

Opaque audio converter structure. You don't want to know, what's inside.

typedef struct bg_video_converter_s bg_video_converter_t

Video converter.

Opaque video converter structure. You don't want to know, what's inside.


Function Documentation

bg_audio_converter_t* bg_audio_converter_create ( const gavl_audio_options_t opt  ) 

Create an audio converter.

Parameters:
opt Audio options
The options should be valid for the whole lifetime of the converter.

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.

Parameters:
cnv An audio converter
in_format Input format
out_format Output format
Returns:
The number of conversion steps
When this function returns 0 it means, that the converter can be bypassed. It should not be used then until the next initialization, which returns nonzero.

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.

Parameters:
cnv An audio converter
func The function to call
priv The private handle to pass to func
stream The stream argument to pass to func

int bg_audio_converter_read ( void *  priv,
gavl_audio_frame_t frame,
int  stream,
int  num_samples 
)

Read samples from an audio converter.

Parameters:
priv An audio converter
frame An audio frame
stream Stream number (must be 0)
num_samples Number of samples to read
Returns:
The number of samples read. 0 means EOF.
This function can be used as an input callback for audio filters.

void bg_audio_converter_destroy ( bg_audio_converter_t cnv  ) 

Destroy an audio converter and free all associated memory.

Parameters:
cnv An audio converter

void bg_audio_converter_reset ( bg_audio_converter_t cnv  ) 

Reset an audio converter as if no samples have been processed since initialization.

Parameters:
cnv An audio converter
Reset an audio converter as if no samples have been processed since initialization.

bg_video_converter_t* bg_video_converter_create ( const gavl_video_options_t opt  ) 

Create a video converter.

Parameters:
opt Video options
The options should be valid for the whole lifetime of the 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.

Parameters:
cnv A video converter
in_format Input format
out_format Output format
Returns:
The number of conversion steps
When this function returns 0 it means, that the converter can be bypassed. It should not be used then until the next initialization, which returns nonzero.

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.

Parameters:
cnv A video converter
func The function to call
priv The private handle to pass to func
stream The stream argument to pass to func

int bg_video_converter_read ( void *  priv,
gavl_video_frame_t frame,
int  stream 
)

Read a video frame from a video converter.

Parameters:
priv A video converter
frame A video frame
stream Stream number (must be 0)
Returns:
1 if a frame was read, 0 means EOF.
This function can be used as an input callback for video filters.

void bg_video_converter_destroy ( bg_video_converter_t cnv  ) 

Destroy a video converter and free all associated memory.

Parameters:
cnv A video converter

void bg_video_converter_reset ( bg_video_converter_t cnv  ) 

Reset a video converter as if no samples have been processed since initialization.

Parameters:
cnv A video converter
Reset a video converter as if no frame has been processed since initialization.


Generated on Mon Jun 15 12:25:51 2009 for gmerlin by  doxygen 1.5.9