bg_input_callbacks_s Struct Reference
[Media input]

Callbacks for input plugins. More...

#include <plugin.h>

Data Fields

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

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

Duration changed.

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

Name changed.

Parameters:
data The data member of this bg_input_callbacks_s struct
time The new name

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

Metadata changed.

Parameters:
data The data member of this bg_input_callbacks_s struct
m The 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:
data The data member of this bg_input_callbacks_s struct
percentage The 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:
data The data member of this bg_input_callbacks_s struct
resource Name of the resource (e.g. server name)
username Returns the username
password Returns 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:
data The data member of this bg_input_callbacks_s struct
stream Video stream index (starts with 0)
pixel_width New pixel width
pixel_height New 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.

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


The documentation for this struct was generated from the following file:
Generated on Sun Feb 28 07:43:45 2010 for gmerlin by  doxygen 1.6.3