Light Media Scanner Documentation

0.1

Copyright (C) 2008 by ProFUSION embedded systems Copyright (C) 2007 by INdT

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author:
Gustavo Sverzut Barbieri <barbieri@profusion.mobi>

Gustavo Sverzut Barbieri <gustavo.barbieri@openbossa.org>

The architecture is based on 2 processes that cooperate, the first is the driver, that controls the behavior of the worker/slave process, that does the hard work. This slave process is meant to make the software more robust since some parser libraries and even user-provided media is not reliable, so if for some reason the worker process freezes, it's killed and then restarted with the next item.

User API is quite simple, with means to add new charsets to be tried and new parsers to handle media. The most important functions are (see lightmediascanner.h):

Note:
The whole library follows libC standard of "0 (zero) means success", unless explicitly stated (usually boolean queries where no error is possible/interesting).
The first will walk all the files and children directories of top_path, check if files are handled by some parser and if they're, they'll be parsed and registered in the data base.

The second will get all already registered media in data base that is located at top_path and see if they're still up to date, deleted or changed. If they were deleted, a flag is set on data base with current time, so it can be expired at some point. If they were marked as deleted, but are not present again, check if the state is still valid (mtime, size), so we can avoid re-parse of removable media. If the file was present and is still present, just check if its properties (mtime, size) are still the same, if not trigger re-parse.

Parsers are handled as shared object plugins, they can be added without modification to the core, see the plugins API later in this document. Since the core have no control over plugins, they can register data as they want, but since some utilities are provided, we expect that the given data base tables are used:


Generated on Wed Apr 22 23:56:01 2009 for Light Media Scanner by  doxygen 1.5.8