Metadata-extraction sessions

To extract metadata with libmd, a client must establish a communication session with the library before it can issue commands to read metadata from media files stored on an attached device.

To establish a communication session (or metadata-extraction session) with libmd, the client must name a mediastore (device) to extract the metadata from. If desired, the client can then set session parameters to influence the behavior of MDPs. These parameters can be set only once, so the client should set them just after opening a session but before extracting any metadata.

The client can use any open session to send requests for extracting metadata from individual items (media files). In each request, the client must supply the item's path or some device-specific information identifying the item (e.g., a UID on Apple devices) and must list the desired metadata fields. The client can also request a maximum number of “matches” (i.e., responses returned by different plugins) for metadata fields. Retrieving multiple values for metadata fields lets a client pick the set of values that provides the user with the most complete and accurate media information possible.

Concurrent sessions

Clients can open and extract metadata from as many concurrent libmd sessions as they like. This design lets applications display media information for multiple devices to users. We recommend a limit of one session per mediastore to avoid redundant reads of metadata from the same files.