gmerlin
|
Data Structures | |
struct | bg_audio_info_t |
Description of an audio stream. More... | |
struct | bg_video_info_t |
Description of a video stream. More... | |
struct | bg_subtitle_info_t |
Description of a subtitle stream. More... | |
struct | bg_chapter_list_t |
Check if 2 metadata structures are equal. More... | |
struct | bg_track_info_t |
Track info. More... | |
Macros | |
#define | BG_TRACK_SEEKABLE (1<<0) |
Track is seekable. More... | |
#define | BG_TRACK_PAUSABLE (1<<1) |
Track is pausable. More... | |
Functions | |
char * | bg_create_track_name (const gavl_metadata_t *m, const char *format) |
Create trackname from metadata. More... | |
char * | bg_metadata_to_string (const gavl_metadata_t *m, int use_tabs) |
Convert metadata to a humanized string. More... | |
int | bg_metadata_get_year (const gavl_metadata_t *m) |
Try to get the year from the metadata. More... | |
void | bg_xml_2_metadata (xmlDocPtr xml_doc, xmlNodePtr xml_metadata, gavl_metadata_t *ret) |
Convert a libxml2 node into a metadata struct. More... | |
void | bg_metadata_2_xml (xmlNodePtr xml_metadata, gavl_metadata_t *ret) |
Convert a metadata struct into a libxml2 node. More... | |
bg_parameter_info_t * | bg_metadata_get_parameters (gavl_metadata_t *m) |
Get parameters for editing metadata. More... | |
bg_parameter_info_t * | bg_metadata_get_parameters_common (gavl_metadata_t *m) |
Get parameters for editing metadata. More... | |
void | bg_metadata_set_parameter (void *data, const char *name, const bg_parameter_value_t *v) |
Change metadata by setting parameters. More... | |
bg_chapter_list_t * | bg_chapter_list_create (int num_chapters) |
Create chapter list. More... | |
bg_chapter_list_t * | bg_chapter_list_copy (const bg_chapter_list_t *list) |
Copy chapter list. More... | |
void | bg_chapter_list_destroy (bg_chapter_list_t *list) |
Destroy chapter list. More... | |
void | bg_chapter_list_insert (bg_chapter_list_t *list, int index, int64_t time, const char *name) |
Insert a chapter into a chapter list. More... | |
void | bg_chapter_list_delete (bg_chapter_list_t *list, int index) |
Delete a chapter from a chapter list. More... | |
void | bg_chapter_list_set_default_names (bg_chapter_list_t *list) |
Set default chapter names. More... | |
int | bg_chapter_list_get_current (bg_chapter_list_t *list, gavl_time_t time) |
Get current chapter. More... | |
int | bg_chapter_list_changed (bg_chapter_list_t *list, gavl_time_t time, int *current_chapter) |
Get current chapter. More... | |
void | bg_chapter_list_2_xml (bg_chapter_list_t *list, xmlNodePtr xml_list) |
Convert a chapter list into a libxml2 node. More... | |
bg_chapter_list_t * | bg_xml_2_chapter_list (xmlDocPtr xml_doc, xmlNodePtr xml_list) |
Convert libxml2 node into a chapter list. More... | |
void | bg_chapter_list_save (bg_chapter_list_t *list, const char *filename) |
Save a chapter list to a file. More... | |
bg_chapter_list_t * | bg_chapter_list_load (const char *filename) |
Load a chapter list from a file. More... | |
void | bg_track_info_free (bg_track_info_t *info) |
Free all allocated memory in a track info. More... | |
void | bg_set_track_name_default (bg_track_info_t *info, const char *location) |
Set the track name from the filename/URL. More... | |
char * | bg_get_track_name_default (const char *location, int track, int num_tracks) |
Get a track name from the filename/URL. More... | |
These structures describe media tracks with their streams. They are returned by the input plugin.
#define BG_TRACK_SEEKABLE (1<<0) |
Track is seekable.
#define BG_TRACK_PAUSABLE (1<<1) |
Track is pausable.
char* bg_create_track_name | ( | const gavl_metadata_t * | m, |
const char * | format | ||
) |
Create trackname from metadata.
m | Metadata |
format | Format string |
The format string can contain arbitrary characters and the following placeholders
If the string corresponding to a placeholder is NULL, the whole function is aborted and NULL is returned.
char* bg_metadata_to_string | ( | const gavl_metadata_t * | m, |
int | use_tabs | ||
) |
Convert metadata to a humanized string.
m | Metadata |
use_tabs | Indicate, that tabs (\t) should be used in the output |
int bg_metadata_get_year | ( | const gavl_metadata_t * | m | ) |
Try to get the year from the metadata.
m | Metadata |
The date string can be in multiple formats. This function tries to extract the year and return it as int.
void bg_xml_2_metadata | ( | xmlDocPtr | xml_doc, |
xmlNodePtr | xml_metadata, | ||
gavl_metadata_t * | ret | ||
) |
Convert a libxml2 node into a metadata struct.
xml_doc | Pointer to the xml document |
xml_metadata | Pointer to the xml node containing the metadata |
ret | Metadata container, where the info will be stored |
See the libxml2 documentation for more infos
void bg_metadata_2_xml | ( | xmlNodePtr | xml_metadata, |
gavl_metadata_t * | ret | ||
) |
Convert a metadata struct into a libxml2 node.
ret | Metadata |
xml_metadata | Pointer to the xml node for the metadata |
See the libxml2 documentation for more infos
bg_parameter_info_t* bg_metadata_get_parameters | ( | gavl_metadata_t * | m | ) |
Get parameters for editing metadata.
m | Metadata |
Using this function and bg_metadata_set_parameter lets you set metadata with the usual configuration methods. The default values of the returned descriptions are set from the Metadata.
Call bg_parameter_info_destroy_array to free the returned array
bg_parameter_info_t* bg_metadata_get_parameters_common | ( | gavl_metadata_t * | m | ) |
Get parameters for editing metadata.
m | Metadata |
This function works exactly like bg_metadata_get_parameters but it returns only the parameters suitable for mass tagging. Using this function and bg_metadata_set_parameter lets you set metadata with the usual configuration methods. The default values of the returned descriptions are set from the Metadata.
Call bg_parameter_info_destroy_array to free the returned array
void bg_metadata_set_parameter | ( | void * | data, |
const char * | name, | ||
const bg_parameter_value_t * | v | ||
) |
Change metadata by setting parameters.
data | Metadata casted to void |
name | Name of the parameter |
v | Value |
bg_chapter_list_t* bg_chapter_list_create | ( | int | num_chapters | ) |
Create chapter list.
num_chapters | Initial number of chapters |
bg_chapter_list_t* bg_chapter_list_copy | ( | const bg_chapter_list_t * | list | ) |
Copy chapter list.
list | Chapter list |
void bg_chapter_list_destroy | ( | bg_chapter_list_t * | list | ) |
Destroy chapter list.
list | A chapter list |
void bg_chapter_list_insert | ( | bg_chapter_list_t * | list, |
int | index, | ||
int64_t | time, | ||
const char * | name | ||
) |
Insert a chapter into a chapter list.
list | A chapter list |
index | Position (starting with 0) where the new chapter will be placed |
time | Start time of the chapter |
name | Chapter name (or NULL) |
void bg_chapter_list_delete | ( | bg_chapter_list_t * | list, |
int | index | ||
) |
Delete a chapter from a chapter list.
list | A chapter list |
index | Position (starting with 0) of the chapter to delete |
void bg_chapter_list_set_default_names | ( | bg_chapter_list_t * | list | ) |
Set default chapter names.
list | A chapter list |
If no names for the chapters are avaiable, this function will set them to "Chapter 1", "Chapter 2" etc.
int bg_chapter_list_get_current | ( | bg_chapter_list_t * | list, |
gavl_time_t | time | ||
) |
Get current chapter.
list | A chapter list |
time | Playback time |
Use this function after seeking to signal a chapter change
int bg_chapter_list_changed | ( | bg_chapter_list_t * | list, |
gavl_time_t | time, | ||
int * | current_chapter | ||
) |
Get current chapter.
list | A chapter list |
time | Playback time |
current_chapter | Returns the current chapter |
Use this function during linear playback to signal a chapter change
void bg_chapter_list_2_xml | ( | bg_chapter_list_t * | list, |
xmlNodePtr | xml_list | ||
) |
Convert a chapter list into a libxml2 node.
list | Chapter list |
xml_list | Pointer to the xml node for the chapter list |
See the libxml2 documentation for more infos
bg_chapter_list_t* bg_xml_2_chapter_list | ( | xmlDocPtr | xml_doc, |
xmlNodePtr | xml_list | ||
) |
Convert libxml2 node into a chapter list.
xml_doc | Pointer to the xml document |
xml_list | Pointer to the xml node for chapter list |
See the libxml2 documentation for more infos
void bg_chapter_list_save | ( | bg_chapter_list_t * | list, |
const char * | filename | ||
) |
Save a chapter list to a file.
list | A chapter list |
filename | Where to save the list |
bg_chapter_list_t* bg_chapter_list_load | ( | const char * | filename | ) |
Load a chapter list from a file.
filename | From where to load the list |
void bg_track_info_free | ( | bg_track_info_t * | info | ) |
Free all allocated memory in a track info.
info | Track info |
This one can be called by plugins to free all allocated memory contained in a track info. Note, that you have to free() the structure itself after.
void bg_set_track_name_default | ( | bg_track_info_t * | info, |
const char * | location | ||
) |
Set the track name from the filename/URL.
info | Track info |
location | filename or URL |
This is used for cases, where the input plugin didn't set a track name, and the name cannot (or shouldn't) be set from the metadata. If location is an URL, the whole URL will be copied into the name field. If location is a local filename, the path and extension will be removed.
char* bg_get_track_name_default | ( | const char * | location, |
int | track, | ||
int | num_tracks | ||
) |
Get a track name from the filename/URL.
location | filename or URL |
track | Track index |
num_tracks | Total number of tracks of the location |
If location is an URL, the whole URL will be copied into the name field. If location is a local filename, the path and extension will be removed.