Configuration file

The libmd configuration file lists the preferential plugin order and provides information on individual plugins by stating the library files implementing the plugins as well as other configuration settings.

The libmd library is shipped with a default configuration file whose path is /etc/system/config/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 either supply a full file path to use your own configuration file or set the path to NULL to use the default configuration file. Your client must do this exactly once to initialize the library before using it.

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 support some but not all metadata fields.

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 lists a URL prefix representing a file type and then the MDPs to use for metadata extraction, from most to least preferred. Suppose you want to tell libmd of your plugin preferences for POSIX files, which have URLs with 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 aren't 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.  i.e.,) regex, regex1, regex2, etc.
#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