gmerlin
Data Fields
bg_input_callbacks_s Struct Reference

Callbacks for input plugins. More...

#include <plugin.h>

Data Fields

void(* duration_changed )(void *data, gavl_time_t duration)
 Duration changed. More...
 
void(* name_changed )(void *data, const char *name)
 Name changed. More...
 
void(* metadata_changed )(void *data, const gavl_metadata_t *m)
 Metadata changed. More...
 
void(* buffer_notify )(void *data, float percentage)
 Buffer callback. More...
 
int(* user_pass )(void *data, const char *resource, char **username, char **password)
 Authentication callback. More...
 
void(* aspect_changed )(void *data, int stream, int pixel_width, int pixel_height)
 Aspect ratio change callback. More...
 
void * data
 Application specific data passed as the first argument to all callbacks. More...
 

Detailed Description

Callbacks for input plugins.

Passing the callback structure to the plugin is optional. Futhermore, any of the callback functions is optional (i.e. can be NULL). The plugin might use the callbacks for propagating events.

Field Documentation

void(* bg_input_callbacks_s::duration_changed)(void *data, gavl_time_t duration)

Duration changed.

Parameters
dataThe data member of this bg_input_callbacks_s struct
timeThe new duration
void(* bg_input_callbacks_s::name_changed)(void *data, const char *name)

Name changed.

Parameters
dataThe data member of this bg_input_callbacks_s struct
timeThe new name

This is for web-radio stations, which send song-names.

void(* bg_input_callbacks_s::metadata_changed)(void *data, const gavl_metadata_t *m)

Metadata changed.

Parameters
dataThe data member of this bg_input_callbacks_s struct
mThe new metadata

This is for web-radio stations, which send metadata for each song.

void(* bg_input_callbacks_s::buffer_notify)(void *data, float percentage)

Buffer callback.

Parameters
dataThe data member of this bg_input_callbacks_s struct
percentageThe buffer fullness (0.0..1.0)

For network connections, plugins might buffer data. This takes some time, so they notify the API about the progress with this callback.

int(* bg_input_callbacks_s::user_pass)(void *data, const char *resource, char **username, char **password)

Authentication callback.

Parameters
dataThe data member of this bg_input_callbacks_s struct
resourceName of the resource (e.g. server name)
usernameReturns the username
passwordReturns the password
Returns
1 if username and password are available, 0 else.

For sources, which require authentication (like FTP servers), this function is called by the plugin to get username and password. Username and password must be returned in newly allocated strings, which will be freed by the plugin.

void(* bg_input_callbacks_s::aspect_changed)(void *data, int stream, int pixel_width, int pixel_height)

Aspect ratio change callback.

Parameters
dataThe data member of this bg_input_callbacks_s struct
streamVideo stream index (starts with 0)
pixel_widthNew pixel width
pixel_heightNew pixel height

Some streams (e.g. DVB) change the pixel aspect ratio on the fly. If the input plugin detects such a change, it should call this callback.

void* bg_input_callbacks_s::data

Application specific data passed as the first argument to all callbacks.


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