gmerlin
Data Fields
bg_codec_plugin_s Struct Reference

Codec plugin. More...

#include <plugin.h>

Data Fields

bg_plugin_common_t common
 Infos and functions common to all plugin types.
 
const gavl_codec_id_t *(* get_compressions )(void *priv)
 Get supported compressions.
 
gavl_audio_sink_t *(* open_encode_audio )(void *priv, gavl_compression_info_t *ci, gavl_audio_format_t *fmt, gavl_metadata_t *m)
 Connect audio encoder.
 
gavl_video_sink_t *(* open_encode_video )(void *priv, gavl_compression_info_t *ci, gavl_video_format_t *fmt, gavl_metadata_t *m)
 Connect video encoder.
 
gavl_video_sink_t *(* open_encode_overlay )(void *priv, gavl_compression_info_t *ci, gavl_video_format_t *fmt, gavl_metadata_t *m)
 Connect overlay encoder.
 
void(* set_packet_sink )(void *priv, gavl_packet_sink_t *s)
 Set a packet sink.
 
gavl_audio_source_t *(* connect_decode_audio )(void *priv, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_audio_format_t *fmt, gavl_metadata_t *m)
 Connect audio decoder.
 
gavl_video_source_t *(* connect_decode_video )(void *priv, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_video_format_t *fmt, gavl_metadata_t *m)
 Connect video decoder.
 
gavl_video_source_t *(* connect_decode_overlay )(void *priv, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_video_format_t *fmt, gavl_metadata_t *m)
 Connect overlay decoder.
 
void(* reset )(void *priv)
 Reset a decoder.
 
int64_t(* skip )(void *priv, int64_t t)
 Skip to a time.
 
int(* set_pass )(void *priv, int pass, int total_passes, const char *stats_file)
 Set pass for an encoder.
 

Detailed Description

Codec plugin.

Transform audio frames into compressed packets or back

Field Documentation

bg_plugin_common_t bg_codec_plugin_s::common

Infos and functions common to all plugin types.

const gavl_codec_id_t*(* bg_codec_plugin_s::get_compressions)(void *priv)

Get supported compressions.

Parameters
privThe handle returned by the create() method
Returns
A list of compressions terminated with GAVL_COMPRESSION_NONE
gavl_audio_sink_t*(* bg_codec_plugin_s::open_encode_audio)(void *priv, gavl_compression_info_t *ci, gavl_audio_format_t *fmt, gavl_metadata_t *m)

Connect audio encoder.

Parameters
privThe handle returned by the create() method
ciCompression info (must be freed by the caller)
fmtFormat of the source
mStream metadata (might get changed by the call)
Returns
An audio sink for sending uncompressed frames
gavl_video_sink_t*(* bg_codec_plugin_s::open_encode_video)(void *priv, gavl_compression_info_t *ci, gavl_video_format_t *fmt, gavl_metadata_t *m)

Connect video encoder.

Parameters
privThe handle returned by the create() method
ciCompression info (must be freed by the caller)
fmtFormat of the source
mStream metadata (might get changed by the call)
Returns
A video sink for sending uncompressed frames
gavl_video_sink_t*(* bg_codec_plugin_s::open_encode_overlay)(void *priv, gavl_compression_info_t *ci, gavl_video_format_t *fmt, gavl_metadata_t *m)

Connect overlay encoder.

Parameters
privThe handle returned by the create() method
ciCompression info (must be freed by the caller)
fmtFormat of the source
mStream metadata (might get changed by the call)
Returns
A video sink for sending uncompressed frames
void(* bg_codec_plugin_s::set_packet_sink)(void *priv, gavl_packet_sink_t *s)

Set a packet sink.

Parameters
privThe handle returned by the create() method
sinkA sink where the encoder can send completed packets
gavl_audio_source_t*(* bg_codec_plugin_s::connect_decode_audio)(void *priv, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_audio_format_t *fmt, gavl_metadata_t *m)

Connect audio decoder.

Parameters
privThe handle returned by the create() method
sinkSource where get the packets
fmtFormat from the container (possibly incomplete)
mStream metadata (might get changed by the call)
Returns
An audio source for reading uncompressed frames
gavl_video_source_t*(* bg_codec_plugin_s::connect_decode_video)(void *priv, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_video_format_t *fmt, gavl_metadata_t *m)

Connect video decoder.

Parameters
privThe handle returned by the create() method
sinkSource where get the packets
fmtFormat from the container (possibly incomplete)
mStream metadata (might get changed by the call)
Returns
A video source for reading uncompressed frames
gavl_video_source_t*(* bg_codec_plugin_s::connect_decode_overlay)(void *priv, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_video_format_t *fmt, gavl_metadata_t *m)

Connect overlay decoder.

Parameters
privThe handle returned by the create() method
sinkSource where get the packets
fmtFormat from the container (possibly incomplete)
mStream metadata (might get changed by the call)
Returns
A video source for reading uncompressed overlays
void(* bg_codec_plugin_s::reset)(void *priv)

Reset a decoder.

Parameters
privThe handle returned by the create() method

Call this after seeking

int64_t(* bg_codec_plugin_s::skip)(void *priv, int64_t t)

Skip to a time.

Parameters
privThe handle returned by the create() method
tTime to skip to
Returns
Actual time of the next frame/sample
int(* bg_codec_plugin_s::set_pass)(void *priv, int pass, int total_passes, const char *stats_file)

Set pass for an encoder.

Parameters
privThe handle returned by the create() method
passNumber of this pass (starting with 1)
total_passesNumber of total passes
stats_fileName of a file, which can be used for multipass statistics
Returns
0 if multipass transcoding is not supported and can be ommitted, 1 else

The documentation for this struct was generated from the following file: