Metadata Provider API

The metadata provider API exposes the constants, data types (including enumerations), and functions that your client applications can use to initialize the libmd library, create metadata extraction sessions, and submit metadata requests.

The first action any client must perform with libmd is initialize the library by calling mmmd_init() while supplying the path of the configuration file, which lists the metadata providers (MDPs) to load.

Before it can extract any metadata, your client must establish a metadata extraction session with libmd by calling mmmd_session_open() while providing the name of the mediastore (device) from which metadata is to be read. This function returns a session handle that you must supply in subsequent API calls.

If desired, the client can influence the behavior of the MDPs by passing in a set of session parameters to mmmd_session_params_set(). Once set, session parameters can't be changed or unset.

The client can then issue requests for specific metadata fields from specific items (media files) by calling mmmd_get(). The client can ask for a maximum number of matches, which are responses from different MDPs. Retrieving multiple matches lets the client pick the set of metadata values that provide the most complete and accurate media information possible. Asking for 0 matches makes libmd collate the metadata extracted by different MDPs into one result set.

When it's finished retrieving metadata from a mediastore, the client can close the corresponding session by calling mmmd_session_close(). When it's finished using libmd altogether (e.g., during shutdown), the client must call mmmd_terminate() to clean up the resources used by the library.