gmerlin
|
Encoder plugin. More...
#include <plugin.h>
Data Fields | |
bg_plugin_common_t | common |
Infos and functions common to all plugin types. | |
int | max_audio_streams |
Maximum number of audio streams. -1 means infinite. | |
int | max_video_streams |
Maximum number of video streams. -1 means infinite. | |
int | max_text_streams |
Maximum number of text subtitle streams. -1 means infinite. | |
int | max_overlay_streams |
Maximum number of overlay subtitle streams. -1 means infinite. | |
void(* | set_callbacks )(void *priv, bg_encoder_callbacks_t *cb) |
Set callbacks. | |
int(* | writes_compressed_audio )(void *priv, const gavl_audio_format_t *format, const gavl_compression_info_t *info) |
Query for writing compressed audio packets. | |
int(* | writes_compressed_video )(void *priv, const gavl_video_format_t *format, const gavl_compression_info_t *info) |
Query for writing compressed video packets. | |
int(* | writes_compressed_overlay )(void *priv, const gavl_video_format_t *format, const gavl_compression_info_t *info) |
Query for writing compressed overlay packets. | |
int(* | open )(void *data, const char *filename, const gavl_metadata_t *metadata, const gavl_chapter_list_t *chapter_list) |
Open a file. | |
int(* | open_io )(void *data, gavf_io_t *io, const gavl_metadata_t *metadata, const gavl_chapter_list_t *chapter_list) |
Open an encoder with a gavf IO handle. | |
const bg_parameter_info_t *(* | get_audio_parameters )(void *priv) |
Get audio related parameters. | |
const bg_parameter_info_t *(* | get_video_parameters )(void *priv) |
Get video related parameters. | |
const bg_parameter_info_t *(* | get_text_parameters )(void *priv) |
Get text subtitle related parameters. | |
const bg_parameter_info_t *(* | get_overlay_parameters )(void *priv) |
Get overlay subtitle related parameters. | |
int(* | add_audio_stream )(void *priv, const gavl_metadata_t *m, const gavl_audio_format_t *format) |
Add an audio stream. | |
int(* | add_audio_stream_compressed )(void *priv, const gavl_metadata_t *m, const gavl_audio_format_t *format, const gavl_compression_info_t *info) |
Add an audio stream fpr compressed writing. | |
int(* | add_video_stream )(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format) |
Add a video stream. | |
int(* | add_video_stream_compressed )(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format, const gavl_compression_info_t *info) |
Add a video stream for compressed writing. | |
int(* | add_text_stream )(void *priv, const gavl_metadata_t *m, uint32_t *timescale) |
Add a text subtitle stream. | |
int(* | add_overlay_stream_compressed )(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format, const gavl_compression_info_t *ci) |
Add an overlay subtitle stream. | |
int(* | add_overlay_stream )(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format) |
Add a text subtitle stream. | |
void(* | set_audio_parameter )(void *priv, int stream, const char *name, const bg_parameter_value_t *v) |
Set audio encoding parameter. | |
void(* | set_video_parameter )(void *priv, int stream, const char *name, const bg_parameter_value_t *v) |
Set video encoding parameter. | |
void(* | set_text_parameter )(void *priv, int stream, const char *name, const bg_parameter_value_t *v) |
Set text subtitle encoding parameter. | |
void(* | set_overlay_parameter )(void *priv, int stream, const char *name, const bg_parameter_value_t *v) |
Set text subtitle encoding parameter. | |
int(* | set_video_pass )(void *priv, int stream, int pass, int total_passes, const char *stats_file) |
Setup multipass video encoding. | |
int(* | start )(void *priv) |
Set up all codecs and prepare for encoding. | |
gavl_audio_sink_t *(* | get_audio_sink )(void *priv, int stream) |
Get audio sink. | |
gavl_packet_sink_t *(* | get_audio_packet_sink )(void *priv, int stream) |
Get audio packet sink. | |
gavl_video_sink_t *(* | get_video_sink )(void *priv, int stream) |
Get video sink. | |
gavl_packet_sink_t *(* | get_video_packet_sink )(void *priv, int stream) |
Get video sink. | |
gavl_packet_sink_t *(* | get_text_sink )(void *priv, int stream) |
Get text subtitle sink. | |
gavl_video_sink_t *(* | get_overlay_sink )(void *priv, int stream) |
Get overlay subtitle sink. | |
gavl_packet_sink_t *(* | get_overlay_packet_sink )(void *priv, int stream) |
Get overlay subtitle sink. | |
void(* | update_metadata )(void *priv, const gavl_metadata_t *m) |
Update metadata. | |
int(* | close )(void *data, int do_delete) |
Close encoder. |
Encoder plugin.
Infos and functions common to all plugin types.
Maximum number of audio streams. -1 means infinite.
Maximum number of video streams. -1 means infinite.
Maximum number of text subtitle streams. -1 means infinite.
Maximum number of overlay subtitle streams. -1 means infinite.
void(* bg_encoder_plugin_s::set_callbacks)(void *priv, bg_encoder_callbacks_t *cb) |
Set callbacks.
priv | The handle returned by the create() method |
cb | Callback structure |
int(* bg_encoder_plugin_s::writes_compressed_audio)(void *priv, const gavl_audio_format_t *format, const gavl_compression_info_t *info) |
Query for writing compressed audio packets.
priv | The handle returned by the create() method |
format | Format of the source |
info | Compression info |
Call this function after all global parameters are set.
int(* bg_encoder_plugin_s::writes_compressed_video)(void *priv, const gavl_video_format_t *format, const gavl_compression_info_t *info) |
Query for writing compressed video packets.
priv | The handle returned by the create() method |
format | Format of the source |
info | Compression info |
Call this function after all global parameters are set.
int(* bg_encoder_plugin_s::writes_compressed_overlay)(void *priv, const gavl_video_format_t *format, const gavl_compression_info_t *info) |
Query for writing compressed overlay packets.
priv | The handle returned by the create() method |
format | Format of the source |
info | Compression info |
Call this function after all global parameters are set.
int(* bg_encoder_plugin_s::open)(void *data, const char *filename, const gavl_metadata_t *metadata, const gavl_chapter_list_t *chapter_list) |
Open a file.
priv | The handle returned by the create() method |
filename | Name of the file to be opened (without extension!) |
metadata | Metadata to be written to the file |
chapter_list | Chapter list (optional, can be NULL) |
The extension is added automatically by the plugin. To keep track of the written files, use the bg_encoder_callbacks_t.
int(* bg_encoder_plugin_s::open_io)(void *data, gavf_io_t *io, const gavl_metadata_t *metadata, const gavl_chapter_list_t *chapter_list) |
Open an encoder with a gavf IO handle.
priv | The handle returned by the create() method |
io | IO handle |
metadata | Metadata to be written to the file |
chapter_list | Chapter list (optional, can be NULL) |
const bg_parameter_info_t*(* bg_encoder_plugin_s::get_audio_parameters)(void *priv) |
Get audio related parameters.
priv | The handle returned by the create() method |
The returned parameters are owned by the plugin and must not be freed.
const bg_parameter_info_t*(* bg_encoder_plugin_s::get_video_parameters)(void *priv) |
Get video related parameters.
priv | The handle returned by the create() method |
The returned parameters are owned by the plugin and must not be freed.
const bg_parameter_info_t*(* bg_encoder_plugin_s::get_text_parameters)(void *priv) |
Get text subtitle related parameters.
priv | The handle returned by the create() method |
The returned parameters are owned by the plugin and must not be freed.
const bg_parameter_info_t*(* bg_encoder_plugin_s::get_overlay_parameters)(void *priv) |
Get overlay subtitle related parameters.
priv | The handle returned by the create() method |
The returned parameters are owned by the plugin and must not be freed.
int(* bg_encoder_plugin_s::add_audio_stream)(void *priv, const gavl_metadata_t *m, const gavl_audio_format_t *format) |
Add an audio stream.
priv | The handle returned by the create() method |
language | as ISO 639-2 code (3 characters+'\0') or NULL |
format | Format of the source |
The format might be changed to the nearest format supported by the plugin. Use get_audio_format to get the actual format needed by the plugin, after start() was called.
int(* bg_encoder_plugin_s::add_audio_stream_compressed)(void *priv, const gavl_metadata_t *m, const gavl_audio_format_t *format, const gavl_compression_info_t *info) |
Add an audio stream fpr compressed writing.
priv | The handle returned by the create() method |
language | as ISO 639-2 code (3 characters+'\0') or NULL |
format | Format of the source |
info | Compression info of the source |
The format might be changed to the nearest format supported by the plugin. Use get_audio_format to get the actual format needed by the plugin, after start() was called.
int(* bg_encoder_plugin_s::add_video_stream)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format) |
Add a video stream.
priv | The handle returned by the create() method |
format | Format of the source |
The format might be changed to the nearest format supported by the plugin. Use get_video_format to get the actual format needed by the plugin, after start() was called.
int(* bg_encoder_plugin_s::add_video_stream_compressed)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format, const gavl_compression_info_t *info) |
Add a video stream for compressed writing.
priv | The handle returned by the create() method |
format | Format of the source |
info | Compression info of the source |
The format might be changed to the nearest format supported by the plugin. Use get_video_format to get the actual format needed by the plugin, after start() was called.
int(* bg_encoder_plugin_s::add_text_stream)(void *priv, const gavl_metadata_t *m, uint32_t *timescale) |
Add a text subtitle stream.
priv | The handle returned by the create() method |
language | as ISO 639-2 code (3 characters+'\0') or NULL |
int(* bg_encoder_plugin_s::add_overlay_stream_compressed)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format, const gavl_compression_info_t *ci) |
Add an overlay subtitle stream.
priv | The handle returned by the create() method |
m | Metadata |
format | Format of the source |
The format might be changed to the nearest format supported by the plugin. Use get_subtitle_overlay_format to get the actual format needed by the plugin, after start was called.
int(* bg_encoder_plugin_s::add_overlay_stream)(void *priv, const gavl_metadata_t *m, const gavl_video_format_t *format) |
Add a text subtitle stream.
priv | The handle returned by the create() method |
language | as ISO 639-2 code (3 characters+'\0') or NULL |
format | Format of the source |
The format might be changed to the nearest format supported by the plugin. Use get_subtitle_overlay_format to get the actual format needed by the plugin, after start was called.
void(* bg_encoder_plugin_s::set_audio_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v) |
Set audio encoding parameter.
priv | The handle returned by the create() method |
stream | Stream index (starting with 0) |
name | Name of the parameter |
v | Value |
Use this function with parameters obtained by get_audio_parameters.
void(* bg_encoder_plugin_s::set_video_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v) |
Set video encoding parameter.
priv | The handle returned by the create() method |
stream | Stream index (starting with 0) |
name | Name of the parameter |
v | Value |
Use this function with parameters obtained by get_video_parameters.
void(* bg_encoder_plugin_s::set_text_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v) |
Set text subtitle encoding parameter.
priv | The handle returned by the create() method |
stream | Stream index (starting with 0) |
name | Name of the parameter |
v | Value |
Use this function with parameters obtained by get_subtitle_text_parameters.
void(* bg_encoder_plugin_s::set_overlay_parameter)(void *priv, int stream, const char *name, const bg_parameter_value_t *v) |
Set text subtitle encoding parameter.
priv | The handle returned by the create() method |
stream | Stream index (starting with 0) |
name | Name of the parameter |
v | Value |
Use this function with parameters obtained by get_subtitle_overlay_parameters.
int(* bg_encoder_plugin_s::set_video_pass)(void *priv, int stream, int pass, int total_passes, const char *stats_file) |
Setup multipass video encoding.
priv | The handle returned by the create() method |
stream | Stream index (starting with 0) |
pass | Number of this pass (starting with 1) |
total_passes | Number of total passes |
stats_file | Name of a file, which can be used for multipass statistics |
int(* bg_encoder_plugin_s::start)(void *priv) |
Set up all codecs and prepare for encoding.
priv | The handle returned by the create() method |
Optional function for preparing the actual encoding. Applications must check for this function and call it when available.
gavl_audio_sink_t*(* bg_encoder_plugin_s::get_audio_sink)(void *priv, int stream) |
Get audio sink.
priv | The handle returned by the create() method |
gavl_packet_sink_t*(* bg_encoder_plugin_s::get_audio_packet_sink)(void *priv, int stream) |
Get audio packet sink.
priv | The handle returned by the create() method |
gavl_video_sink_t*(* bg_encoder_plugin_s::get_video_sink)(void *priv, int stream) |
Get video sink.
priv | The handle returned by the create() method |
gavl_packet_sink_t*(* bg_encoder_plugin_s::get_video_packet_sink)(void *priv, int stream) |
Get video sink.
priv | The handle returned by the create() method |
gavl_packet_sink_t*(* bg_encoder_plugin_s::get_text_sink)(void *priv, int stream) |
Get text subtitle sink.
priv | The handle returned by the create() method |
gavl_video_sink_t*(* bg_encoder_plugin_s::get_overlay_sink)(void *priv, int stream) |
Get overlay subtitle sink.
priv | The handle returned by the create() method |
gavl_packet_sink_t*(* bg_encoder_plugin_s::get_overlay_packet_sink)(void *priv, int stream) |
Get overlay subtitle sink.
priv | The handle returned by the create() method |
void(* bg_encoder_plugin_s::update_metadata)(void *priv, const gavl_metadata_t *m) |
Update metadata.
priv | The handle returned by the create() method |
m | Metadata |
Update metadata for broadcasting plugins.
int(* bg_encoder_plugin_s::close)(void *data, int do_delete) |
Close encoder.
priv | The handle returned by the create() method |
do_delete | Set this to 1 to delete all created files |
After calling this function, the plugin should be destroyed.