#include <plugin.h>
Data Fields | |
bg_plugin_common_t | common |
Infos and functions common to all plugin types. | |
char * | protocols |
Space separated list of protocols this plugin can handle. | |
void(* | set_callbacks )(void *priv, bg_input_callbacks_t *callbacks) |
Set callbacks. | |
int(* | open )(void *priv, const char *arg) |
Open file/url/device. | |
int(* | open_fd )(void *priv, int fd, int64_t total_bytes, const char *mimetype) |
Open plugin from filedescriptor (optional). | |
const char *(* | get_disc_name )(void *priv) |
Get the disc name (optional). | |
int(* | eject_disc )(const char *device) |
Eject disc (optional). | |
int(* | get_num_tracks )(void *priv) |
Get the number of tracks. | |
bg_track_info_t *(* | get_track_info )(void *priv, int track) |
Return information about a track. | |
int(* | set_track )(void *priv, int track) |
Set the track to be played. | |
int(* | set_audio_stream )(void *priv, int stream, bg_stream_action_t action) |
Setup audio stream. | |
int(* | set_video_stream )(void *priv, int stream, bg_stream_action_t action) |
Setup video stream. | |
int(* | set_subtitle_stream )(void *priv, int stream, bg_stream_action_t action) |
Setup subtitle stream. | |
int(* | start )(void *priv) |
Start decoding. | |
bg_read_audio_func_t | read_audio_samples |
Read audio samples. | |
bg_read_video_func_t | read_video_frame |
Read a video frame. | |
int(* | has_subtitle )(void *priv, int stream) |
Query if a new subtitle is available. | |
int(* | read_subtitle_overlay )(void *priv, gavl_overlay_t *ovl, int stream) |
Read one pixmap subtitle. | |
int(* | read_subtitle_text )(void *priv, char **text, int *text_alloc, int64_t *start_time, int64_t *duration, int stream) |
Read one text subtitle. | |
int(* | bypass )(void *priv) |
Update a plugin in bypass mode. | |
void(* | bypass_set_pause )(void *priv, int pause) |
pause a plugin in bypass mode | |
void(* | bypass_set_volume )(void *priv, float volume) |
Set volume for a plugin in bypass mode. | |
void(* | seek )(void *priv, gavl_time_t *time) |
Seek within a media track. | |
void(* | stop )(void *priv) |
Stop playback. | |
void(* | close )(void *priv) |
Close plugin. |
This is for all kinds of media inputs (files, disks, urls, etc), except recording from hardware devices (see Audio recorder and Video recorder).
Infos and functions common to all plugin types.
Space separated list of protocols this plugin can handle.
void(* bg_input_plugin_t::set_callbacks)(void *priv, bg_input_callbacks_t *callbacks) |
Set callbacks.
priv | The handle returned by the create() method | |
callbacks | Callback structure initialized by the caller before |
int(* bg_input_plugin_t::open)(void *priv, const char *arg) |
Open file/url/device.
priv | The handle returned by the create() method | |
arg | Filename, URL or device name |
int(* bg_input_plugin_t::open_fd)(void *priv, int fd, int64_t total_bytes, const char *mimetype) |
Open plugin from filedescriptor (optional).
priv | The handle returned by the create() method | |
fd | Open filedescriptor | |
total_bytes | Totally available bytes or 0 if unknown | |
mimetype | Mimetype from http header (or NULL) |
const char*(* bg_input_plugin_t::get_disc_name)(void *priv) |
Get the disc name (optional).
priv | The handle returned by the create() method |
int(* bg_input_plugin_t::eject_disc)(const char *device) |
Eject disc (optional).
priv | The handle returned by the create() method |
int(* bg_input_plugin_t::get_num_tracks)(void *priv) |
Get the number of tracks.
priv | The handle returned by the create() method |
bg_track_info_t*(* bg_input_plugin_t::get_track_info)(void *priv, int track) |
Return information about a track.
priv | The handle returned by the create() method | |
track | Track index starting with 0 |
Other data, especially audio and video formats, will become valid after the start() call (see below).
int(* bg_input_plugin_t::set_track)(void *priv, int track) |
Set the track to be played.
priv | The handle returned by the create() method | |
track | Track index starting with 0 |
int(* bg_input_plugin_t::set_audio_stream)(void *priv, int stream, bg_stream_action_t action) |
Setup audio stream.
priv | The handle returned by the create() method | |
stream | Stream index starting with 0 | |
action | What to do with the stream |
int(* bg_input_plugin_t::set_video_stream)(void *priv, int stream, bg_stream_action_t action) |
Setup video stream.
priv | The handle returned by the create() method | |
stream | Stream index starting with 0 | |
action | What to do with the stream |
int(* bg_input_plugin_t::set_subtitle_stream)(void *priv, int stream, bg_stream_action_t action) |
Setup subtitle stream.
priv | The handle returned by the create() method | |
stream | Stream index starting with 0 | |
action | What to do with the stream |
int(* bg_input_plugin_t::start)(void *priv) |
Start decoding.
priv | The handle returned by the create() method |
From the plugins point of view, this is the last chance to return 0 if something fails
Read audio samples.
priv | The handle returned by the create() method | |
frame | The frame, where the samples will be copied | |
stream | Stream index starting with 0 | |
num_samples | Number of samples |
Read a video frame.
priv | The handle returned by the create() method | |
frame | The frame, where the image will be copied | |
stream | Stream index starting with 0 |
int(* bg_input_plugin_t::has_subtitle)(void *priv, int stream) |
Query if a new subtitle is available.
priv | The handle returned by the create() method | |
stream | Stream index starting with 0 |
int(* bg_input_plugin_t::read_subtitle_overlay)(void *priv, gavl_overlay_t *ovl, int stream) |
Read one pixmap subtitle.
priv | The handle returned by the create() method | |
ovl | Where the overlay will be copied | |
stream | Stream index starting with 0 |
int(* bg_input_plugin_t::read_subtitle_text)(void *priv, char **text, int *text_alloc, int64_t *start_time, int64_t *duration, int stream) |
Read one text subtitle.
priv | The handle returned by the create() method | |
text | Where the text will be copied, the buffer will be realloc()ed. | |
text_alloc | Allocated bytes for text. Will be updated by the function. | |
start_time | Returns the start time of the subtitle | |
duration | Returns the duration of the subtitle | |
stream | Stream index starting with 0 |
This function automatically handles the text buffer (and text_alloc). Just set both to zero before the first call and free() the text buffer after the last call (if non-NULL).
int(* bg_input_plugin_t::bypass)(void *priv) |
Update a plugin in bypass mode.
priv | The handle returned by the create() method |
void(* bg_input_plugin_t::bypass_set_pause)(void *priv, int pause) |
pause a plugin in bypass mode
priv | The handle returned by the create() method | |
pause | 1 for pausing, 0 for resuming |
void(* bg_input_plugin_t::bypass_set_volume)(void *priv, float volume) |
Set volume for a plugin in bypass mode.
priv | The handle returned by the create() method | |
volume | Volume in dB (0 is maximum). |
void(* bg_input_plugin_t::seek)(void *priv, gavl_time_t *time) |
Seek within a media track.
priv | The handle returned by the create() method | |
time | Time to seek to |
void(* bg_input_plugin_t::stop)(void *priv) |
Stop playback.
priv | The handle returned by the create() method |
void(* bg_input_plugin_t::close)(void *priv) |
Close plugin.
priv | The handle returned by the create() method |