Configuration file

The libmd configuration file lists the preferential plugin order, the library files implementing the plugins, and other configuration settings.

The libmd library is shipped with a default configuration file (/etc/mm/mm-md.conf). You can modify this included file or create your own. Before doing anything else with libmd, your client must call mmmd_init() and supply either the full path to your own configuration file or a path of NULL to use the default configuration file. Your client must do this exactly once to initialize the library.

Any section that defines settings for an individual plugin (or MDP) must begin with a line of the form:

[plugin]

The settings are listed on the lines that follow, one per line. The syntax for an MDP setting consists of a field name, followed by the equal sign (=), followed by the field value. For example, the following line enables lazy load filters for MMF:

lazyloadfilters=1

You can also place comments in the configuration file by starting lines with the number sign (#).

A dll setting is required in every plugin section. This setting names the library file implementing the MDP plugin. To support a good user experience, your configuration file should define at least the minimum set of MDPs capable of extracting all the metadata fields needed by your client applications. Most likely, you'll have to define more than one plugin section because most MDPs don't support every metadata field.

The section defining the preferential plugin order begins with a line of the form:

[typeratings]

The lines that follow list the MDP preferences for specific file types. Each line contains a URL prefix that represents a file type, followed by the MDPs to use for metadata extraction, from most to least preferred. Suppose you want to inform libmd of your plugin preferences for POSIX files, whose URLs have either a file prefix or no prefix at all. If you want to use the MMF MDP first and then the Exif MDP if some metadata fields can't be retrieved by the MMF MDP, enter the following line:

file=mmf,exif

Default configuration file

The contents of the default configuration file look like this:

# libmd config file

[plugin]
dll=mm-mdp-mmf.so
lazyloadfilters=1

[plugin]
dll=mm-mdp-exif.so

[plugin]
dll=mm-mdp-cdda.so

#[plugin]
#dll=mm-mdp-ipod.so

#[plugin]
#dll=mm-mdp-extart.so
#ignore_case=true
#max_search=100
#max_cache_entries=0

# All regular expressions following the first
# instance must have a unique suffix appended
# to them (e.g., regex, regex1, regex2).
#regex=album\.jp[e]?g
#regex1=folder\.jp[e]?g

#[plugin]
#dll=mm-mdp-mediafs.so

[typeratings]
file=mmf,exif
http=mmf
cdda=cdda
rtsp=mmf
#ipod=ipod
#mtp=mediafs