Metadata support. More...
Data Structures | |
struct | gavl_metadata_tag_t |
Single metadata tag. More... | |
struct | gavl_metadata_t |
Single metadata structure. More... | |
Modules | |
Defined metadata keys | |
Defines | |
#define | GAVL_METADATA_DATE_STRING_LEN 11 |
#define | GAVL_METADATA_DATE_TIME_STRING_LEN 20 |
Functions | |
GAVL_PUBLIC void | gavl_metadata_free (gavl_metadata_t *m) |
Free all metadata tags. | |
GAVL_PUBLIC void | gavl_metadata_init (gavl_metadata_t *m) |
Initialize structre. | |
GAVL_PUBLIC void | gavl_metadata_set (gavl_metadata_t *m, const char *key, const char *val) |
Set a tag. | |
GAVL_PUBLIC void | gavl_metadata_set_nocpy (gavl_metadata_t *m, const char *key, char *val) |
Set a tag. | |
GAVL_PUBLIC const char * | gavl_metadata_get (const gavl_metadata_t *m, const char *key) |
Get the value of a tag. | |
GAVL_PUBLIC void | gavl_metadata_set_int (gavl_metadata_t *m, const char *key, int val) |
Set an integer tag. | |
GAVL_PUBLIC int | gavl_metadata_get_int (const gavl_metadata_t *m, const char *key, int *ret) |
Get an integer tag. | |
GAVL_PUBLIC void | gavl_metadata_set_date (gavl_metadata_t *m, const char *key, int year, int month, int day) |
Set a date tag. | |
GAVL_PUBLIC int | gavl_metadata_get_date (gavl_metadata_t *m, const char *key, int *year, int *month, int *day) |
Get a date tag. | |
GAVL_PUBLIC void | gavl_metadata_set_date_time (gavl_metadata_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_metadata_get_date_time (gavl_metadata_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. | |
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. | |
GAVL_PUBLIC void | gavl_metadata_merge (gavl_metadata_t *dst, const gavl_metadata_t *src1, const gavl_metadata_t *src2) |
Merge two metadata structures. | |
GAVL_PUBLIC void | gavl_metadata_merge2 (gavl_metadata_t *dst, const gavl_metadata_t *src) |
Merge two metadata structures. | |
GAVL_PUBLIC void | gavl_metadata_copy (gavl_metadata_t *dst, const gavl_metadata_t *src) |
Copy metadata structure. | |
GAVL_PUBLIC void | gavl_metadata_dump (const gavl_metadata_t *m, int indent) |
Dump metadata structure to stderr. | |
GAVL_PUBLIC int | gavl_metadata_equal (const gavl_metadata_t *m1, const gavl_metadata_t *m2) |
Check if 2 metadata structures are equal. |
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_free | ( | gavl_metadata_t * | m | ) |
Free all metadata tags.
GAVL_PUBLIC void gavl_metadata_init | ( | gavl_metadata_t * | m | ) |
Initialize structre.
Use this if you define a gavl_metadata_t structure in unintialized memory (e.g. on the stack) before using it.
GAVL_PUBLIC void gavl_metadata_set | ( | gavl_metadata_t * | m, | |
const char * | key, | |||
const char * | val | |||
) |
Set a tag.
Set a metadata tag. The value is copied.
GAVL_PUBLIC void gavl_metadata_set_nocpy | ( | gavl_metadata_t * | m, | |
const char * | key, | |||
char * | val | |||
) |
Set a tag.
Like gavl_metadata_set except that the value is not copied.
GAVL_PUBLIC const char* gavl_metadata_get | ( | const gavl_metadata_t * | m, | |
const char * | key | |||
) |
Get the value of a tag.
GAVL_PUBLIC void gavl_metadata_set_int | ( | gavl_metadata_t * | m, | |
const char * | key, | |||
int | val | |||
) |
Set an integer tag.
GAVL_PUBLIC int gavl_metadata_get_int | ( | const gavl_metadata_t * | m, | |
const char * | key, | |||
int * | ret | |||
) |
Get an integer tag.
GAVL_PUBLIC void gavl_metadata_set_date | ( | gavl_metadata_t * | m, | |
const char * | key, | |||
int | year, | |||
int | month, | |||
int | day | |||
) |
Set a date tag.
GAVL_PUBLIC int gavl_metadata_get_date | ( | gavl_metadata_t * | m, | |
const char * | key, | |||
int * | year, | |||
int * | month, | |||
int * | day | |||
) |
Get a date tag.
GAVL_PUBLIC void gavl_metadata_set_date_time | ( | gavl_metadata_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_metadata_get_date_time | ( | gavl_metadata_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 void gavl_metadata_merge | ( | gavl_metadata_t * | dst, | |
const gavl_metadata_t * | src1, | |||
const gavl_metadata_t * | src2 | |||
) |
Merge two metadata structures.
Copy all tags from src1 and src2 to dst. If a tag is available in src1 and src2, the one from src1 is taken.
GAVL_PUBLIC void gavl_metadata_merge2 | ( | gavl_metadata_t * | dst, | |
const gavl_metadata_t * | src | |||
) |
Merge two metadata structures.
Copy tags from src to dst, which are not already contained in dst.
GAVL_PUBLIC void gavl_metadata_copy | ( | gavl_metadata_t * | dst, | |
const gavl_metadata_t * | src | |||
) |
Copy metadata structure.
Copy all tags from src to dst
GAVL_PUBLIC void gavl_metadata_dump | ( | const gavl_metadata_t * | m, | |
int | indent | |||
) |
Dump metadata structure to stderr.
GAVL_PUBLIC int gavl_metadata_equal | ( | const gavl_metadata_t * | m1, | |
const gavl_metadata_t * | m2 | |||
) |
Check if 2 metadata structures are equal.