A media source from the perspective of a client.


#include <mmplayer/types.h>

typedef struct mmp_ms {
    int id;
    char *uid;
    char *name;
    char *view_name;
    ms_type_e type;
    ms_status_e status;
    uint64_t capabilities;
} mmp_ms_t;


int id
Unique ID of the media source
char *uid
Unique ID of the hardware device
char *name
Media source name
char *view_name
Name of the view configured for the device type of the media source
ms_type_e type
Hardware type
ms_status_e status
Media source status (i.e., ready or not ready)
uint64_t capabilities
A flag field indicating the supported browsing and playback operations




The mmp_ms_t structure stores media source information useful to a client. This information allows clients to distinguish one media source from the others and to know its current status and which operations it supports. The mm_player_get_media_sources() function returns an array of these structures, with each array element storing the information about a single media source.

Clients must pass in the media source ID (which can be read from the id field) to a identify a particular media source when calling the API functions for browsing or searching media, getting metadata, or creating tracksessions.

The view_name field indicates the view configured for the plugin used to access content on the media source. You can see this plugin setting in the configuration file. The default configuration file uses two views: synced and live. These views determine which extended metadata fields can be retrieved with mm_player_get_extended_metadata(). You can define additional views to suit your HMI's needs. For instance, you can define multiple views to represent the metadata on a device in different ways and then combine the device's hardware UID with specific view_name values to distinguish the views.

The flag field in capabilities indicates which browsing and playback operations are supported by the media source. To test if a particular operation is supported, you must examine the bit that corresponds to the operation's enumeration code in either ms_browse_capability_e or ms_playback_capability_e. For example, to test if the media source supports jumping to another track during playback, you must examine the bit in capabilities that corresponds to the MS_PLAY_CAPABILITY_JUMP code.