[input] Add interface for getting metadata from input modules

This commit is contained in:
ejurgensen
2017-01-22 23:16:15 +01:00
parent 2696b27972
commit 7b6a7b65b3
2 changed files with 72 additions and 0 deletions

View File

@@ -73,6 +73,21 @@ struct player_source
typedef int (*input_cb)(void);
struct input_metadata
{
uint32_t item_id;
int startup;
uint64_t rtptime;
uint64_t offset;
char *artist;
char *title;
char *album;
char *artwork_url;
};
struct input_definition
{
// Name of the input
@@ -96,6 +111,9 @@ struct input_definition
// Changes the playback position
int (*seek)(struct player_source *ps, int seek_ms);
// Return metadata
int (*metadata_get)(struct input_metadata *metadata, struct player_source *ps);
// Initialization function called during startup
int (*init)(void);
@@ -192,6 +210,18 @@ input_seek(struct player_source *ps, int seek_ms);
void
input_flush(short *flags);
/*
* Gets metadata from the input, returns 0 if metadata is set, otherwise -1
*/
int
input_metadata_get(struct input_metadata *metadata, struct player_source *ps, int startup);
/*
* Free the entire struct
*/
void
input_metadata_free(struct input_metadata *metadata, int content_only);
/*
* Called by player_init (so will run in main thread)
*/