gavl
|
Metadata support. More...
Modules | |
Defined metadata keys | |
Macros | |
#define | GAVL_METADATA_DATE_STRING_LEN 11 |
#define | GAVL_METADATA_DATE_TIME_STRING_LEN 20 |
Functions | |
GAVL_PUBLIC void | gavl_metadata_append (gavl_dictionary_t *m, const char *key, const char *val) |
Free all metadata tags. More... | |
GAVL_PUBLIC void | gavl_metadata_append_nocpy (gavl_dictionary_t *m, const char *key, char *val) |
Append values of a tag without copying. More... | |
GAVL_PUBLIC const char * | gavl_dictionary_get_arr (const gavl_dictionary_t *m, const char *key, int i) |
Get the array value of a tag. More... | |
GAVL_PUBLIC const char * | gavl_dictionary_get_arr_i (const gavl_dictionary_t *m, const char *key, int i) |
Get the array value of a tag. More... | |
GAVL_PUBLIC char * | gavl_metadata_join_arr (const gavl_dictionary_t *m, const char *key, const char *glue) |
Get the array value of a tag. More... | |
GAVL_PUBLIC int | gavl_dictionary_get_arr_len (const gavl_dictionary_t *m, const char *key) |
Get the length of an array value of a tag. More... | |
GAVL_PUBLIC void | gavl_dictionary_set_date (gavl_dictionary_t *m, const char *key, int year, int month, int day) |
Get the value of a tag ignrong case. More... | |
GAVL_PUBLIC int | gavl_dictionary_get_year (const gavl_dictionary_t *m, const char *key) |
Get the year from a tag. More... | |
GAVL_PUBLIC int | gavl_dictionary_get_date (const gavl_dictionary_t *m, const char *key, int *year, int *month, int *day) |
Get a date tag. More... | |
GAVL_PUBLIC void | gavl_dictionary_set_date_time (gavl_dictionary_t *m, const char *key, int year, int month, int day, int hour, int minute, int second) |
Set a date/time tag. More... | |
GAVL_PUBLIC int | gavl_dictionary_get_date_time (const gavl_dictionary_t *m, const char *key, int *year, int *month, int *day, int *hour, int *minute, int *second) |
Get a date/time tag. More... | |
GAVL_PUBLIC void | gavl_metadata_date_to_string (int year, int month, int day, char *ret) |
Format a date string. More... | |
GAVL_PUBLIC void | gavl_metadata_date_time_to_string (int year, int month, int day, int hour, int minute, int second, char *ret) |
Format a date string. More... | |
GAVL_PUBLIC int | gavl_metadata_equal (const gavl_dictionary_t *m1, const gavl_dictionary_t *m2) |
Check if 2 metadata structures are equal. More... | |
GAVL_PUBLIC void | gavl_metadata_delete_compression_fields (gavl_dictionary_t *m) |
Clear fields, which are related to the compression. More... | |
GAVL_PUBLIC void | gavl_metadata_delete_implicit_fields (gavl_dictionary_t *m) |
Clear fields, which are obtained implicitly. More... | |
GAVL_PUBLIC void | gavl_dictionary_set_string_endian (gavl_dictionary_t *m) |
Set the enddian tag. More... | |
GAVL_PUBLIC int | gavl_metadata_do_swap_endian (const gavl_dictionary_t *m) |
Check if endianess needs to be swapped. More... | |
GAVL_PUBLIC gavl_dictionary_t * | gavl_metadata_add_image_uri (gavl_dictionary_t *m, const char *key, int w, int h, const char *mimetype, const char *uri) |
GAVL_PUBLIC const char * | gavl_dictionary_get_string_image_uri (const gavl_dictionary_t *m, const char *key, int i, int *wp, int *hp, const char **mimetype) |
GAVL_PUBLIC const char * | gavl_dictionary_get_string_image_max (const gavl_dictionary_t *m, const char *key, int w, int h, const char *mimetype) |
GAVL_PUBLIC void | gavl_metadata_add_image_embedded (gavl_dictionary_t *m, const char *key, int w, int h, const char *mimetype, int64_t offset, int64_t size) |
GAVL_PUBLIC const gavl_dictionary_t * | gavl_dictionary_get_image_max (const gavl_dictionary_t *m, const char *key, int w, int h, const char *mimetype) |
GAVL_PUBLIC const gavl_dictionary_t * | gavl_dictionary_get_image_max_proto (const gavl_dictionary_t *m, const char *key, int w, int h, const char *mimetype, const char *protocol) |
GAVL_PUBLIC gavl_dictionary_t * | gavl_metadata_add_src (gavl_dictionary_t *m, const char *key, const char *mimetype, const char *location) |
GAVL_PUBLIC const gavl_dictionary_t * | gavl_dictionary_get_src (const gavl_dictionary_t *m, const char *key, int idx, const char **mimetype, const char **location) |
GAVL_PUBLIC gavl_dictionary_t * | gavl_dictionary_get_src_nc (gavl_dictionary_t *m, const char *key, int idx) |
GAVL_PUBLIC int | gavl_metadata_has_src (const gavl_dictionary_t *m, const char *key, const char *location) |
Metadata support.
This is a simple dictionary structure, which is used my gmerlin applications and libraries to associate metadata with a media file or a single media stream.
Metadata are defined as all data, which are not directly related to the decoding process, but might be of interest for the user.
The tag types are completely generic so applications can define their own tags. For compatibility it is, however recommended to use the tags defined in metatags.h
Since 1.4.0
#define GAVL_METADATA_DATE_STRING_LEN 11 |
Length of a date string of the format YYYY-MM-DD
#define GAVL_METADATA_DATE_TIME_STRING_LEN 20 |
Length of a date/time string of the format YYYY-MM-DD HH:MM:SS
GAVL_PUBLIC void gavl_metadata_append | ( | gavl_dictionary_t * | m, |
const char * | key, | ||
const char * | val | ||
) |
Free all metadata tags.
Initialize structre
Use this if you define a gavl_dictionary_t structure in unintialized memory (e.g. on the stack) before using it.
Set a tag
Set a metadata tag. The value is copied.
Set a tag
Like gavl_dictionary_set_string except that the value is not copied.
Append values of a tag
Appends a value to a tag, making it implicitly an array type. The tag is created if not already existent. The value is copied.
GAVL_PUBLIC void gavl_metadata_append_nocpy | ( | gavl_dictionary_t * | m, |
const char * | key, | ||
char * | val | ||
) |
Append values of a tag without copying.
Like gavl_metadata_append except that the value is not copied.
GAVL_PUBLIC const char* gavl_dictionary_get_arr | ( | const gavl_dictionary_t * | m, |
const char * | key, | ||
int | i | ||
) |
Get the array value of a tag.
GAVL_PUBLIC const char* gavl_dictionary_get_arr_i | ( | const gavl_dictionary_t * | m, |
const char * | key, | ||
int | i | ||
) |
Get the array value of a tag.
GAVL_PUBLIC char* gavl_metadata_join_arr | ( | const gavl_dictionary_t * | m, |
const char * | key, | ||
const char * | glue | ||
) |
Get the array value of a tag.
GAVL_PUBLIC int gavl_dictionary_get_arr_len | ( | const gavl_dictionary_t * | m, |
const char * | key | ||
) |
Get the length of an array value of a tag.
GAVL_PUBLIC void gavl_dictionary_set_date | ( | gavl_dictionary_t * | m, |
const char * | key, | ||
int | year, | ||
int | month, | ||
int | day | ||
) |
Get the value of a tag ignrong case.
GAVL_PUBLIC int gavl_dictionary_get_year | ( | const gavl_dictionary_t * | m, |
const char * | key | ||
) |
Get the year from a tag.
GAVL_PUBLIC int gavl_dictionary_get_date | ( | const gavl_dictionary_t * | m, |
const char * | key, | ||
int * | year, | ||
int * | month, | ||
int * | day | ||
) |
Get a date tag.
GAVL_PUBLIC void gavl_dictionary_set_date_time | ( | gavl_dictionary_t * | m, |
const char * | key, | ||
int | year, | ||
int | month, | ||
int | day, | ||
int | hour, | ||
int | minute, | ||
int | second | ||
) |
Set a date/time tag.
GAVL_PUBLIC int gavl_dictionary_get_date_time | ( | const gavl_dictionary_t * | m, |
const char * | key, | ||
int * | year, | ||
int * | month, | ||
int * | day, | ||
int * | hour, | ||
int * | minute, | ||
int * | second | ||
) |
Get a date/time tag.
GAVL_PUBLIC void gavl_metadata_date_to_string | ( | int | year, |
int | month, | ||
int | day, | ||
char * | ret | ||
) |
Format a date string.
The string needs to be at least GAVL_METADATA_DATE_STRING_LEN bytes long.
GAVL_PUBLIC void gavl_metadata_date_time_to_string | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | minute, | ||
int | second, | ||
char * | ret | ||
) |
Format a date string.
The string needs to be at least GAVL_METADATA_DATE_TIME_STRING_LEN bytes long.
GAVL_PUBLIC int gavl_metadata_equal | ( | const gavl_dictionary_t * | m1, |
const gavl_dictionary_t * | m2 | ||
) |
Check if 2 metadata structures are equal.
GAVL_PUBLIC void gavl_metadata_delete_compression_fields | ( | gavl_dictionary_t * | m | ) |
Clear fields, which are related to the compression.
This deletes fields, which are related to the compression of the stream (e.g. bitrate, codec etc.). Use this before transcoding the stream in another format to suppress bogus values in the output stream
GAVL_PUBLIC void gavl_metadata_delete_implicit_fields | ( | gavl_dictionary_t * | m | ) |
Clear fields, which are obtained implicitly.
This deletes fields, which can implicitly obtainecd from the file
GAVL_PUBLIC void gavl_dictionary_set_string_endian | ( | gavl_dictionary_t * | m | ) |
Set the enddian tag.
This sets the "Endian" field to 1 on big endian architectures 0 else
GAVL_PUBLIC int gavl_metadata_do_swap_endian | ( | const gavl_dictionary_t * | m | ) |
Check if endianess needs to be swapped.