platform/upstream/lightmediascanner.git
16 years agoFunction to forcefully convert to some charset.
barbieri [Tue, 29 Jan 2008 22:07:39 +0000 (22:07 +0000)]
Function to forcefully convert to some charset.

One can use this function to avoid check for UTF-8 before converting,
this will avoid problems when you know the encoding and it was
accepted as UTF-8 (ie: UTF-16).

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@40 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoSet len to 0 if string is empty.
barbieri [Tue, 22 Jan 2008 21:25:39 +0000 (21:25 +0000)]
Set len to 0 if string is empty.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@35 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoFix problem with SubIFD in Exif.
barbieri [Tue, 22 Jan 2008 20:53:33 +0000 (20:53 +0000)]
Fix problem with SubIFD in Exif.

Patch-By: Leonardo Sobral Cunha <leonardo.cunha@openbossa.org>
git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@34 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoCheck for zero-padded strings.
barbieri [Tue, 22 Jan 2008 20:53:13 +0000 (20:53 +0000)]
Check for zero-padded strings.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@33 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoGet both lead artist and band, use in order: band, artist
barbieri [Tue, 22 Jan 2008 18:45:37 +0000 (18:45 +0000)]
Get both lead artist and band, use in order: band, artist

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@32 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoCosmetic simplification.
barbieri [Tue, 22 Jan 2008 18:45:11 +0000 (18:45 +0000)]
Cosmetic simplification.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@31 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoJust get "lead artist" (TPE1), don't try others.
barbieri [Thu, 17 Jan 2008 21:46:14 +0000 (21:46 +0000)]
Just get "lead artist" (TPE1), don't try others.

id3lib helpers used to get all of those, using an *ordered* search for
the fields.

However these multiple searches were slow and I'm now doing one walk
and registering the found fields, in the order they're listed on the
file. This lead to "composer" showing before "lead artist" and thus
being used, producing undesired results for "cover albums" where you
want the artist to be the playing one, not the original.

We have 2 solutions, I used the first:
 * just get "lead artist", most of tag editors just edit them or at
   least enable users to change that. Most software just use this.
 * get all the fields, consider them as a group for "todo" analysis
   and at the end of the search use in the specific order. This is
   more complex and would require lots of allocation/copy/free to a
   case that is often uncommon.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@30 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoAdd PNG image support (just size)
barbieri [Mon, 24 Dec 2007 15:28:58 +0000 (15:28 +0000)]
Add PNG image support (just size)

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@25 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoAdd audio-dummy to build.
barbieri [Mon, 24 Dec 2007 15:28:27 +0000 (15:28 +0000)]
Add audio-dummy to build.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@24 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoAdd audio-dummy with missing audio formats.
barbieri [Fri, 21 Dec 2007 14:44:41 +0000 (14:44 +0000)]
Add audio-dummy with missing audio formats.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@23 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoAdd .wmv to video-dummy.
barbieri [Fri, 21 Dec 2007 14:44:11 +0000 (14:44 +0000)]
Add .wmv to video-dummy.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@22 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoAdd copyright to all source files.
barbieri [Mon, 17 Dec 2007 21:30:14 +0000 (21:30 +0000)]
Add copyright to all source files.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@19 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoConsider DQT frame as JFIF (ignore and get just the size).
barbieri [Mon, 17 Dec 2007 21:16:38 +0000 (21:16 +0000)]
Consider DQT frame as JFIF (ignore and get just the size).

If DQT frame is found, then no extra information is available,
consider like JFIF and go straight to image dimension.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@18 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoAlso get size from other SOF (progressive, extended sequential...)
barbieri [Mon, 17 Dec 2007 20:52:18 +0000 (20:52 +0000)]
Also get size from other SOF (progressive, extended sequential...)

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@17 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoProvide means to stop check/process.
barbieri [Thu, 13 Dec 2007 22:07:45 +0000 (22:07 +0000)]
Provide means to stop check/process.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@16 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoAdd Doxyfiles to EXTRA_DIST
barbieri [Thu, 13 Dec 2007 15:15:17 +0000 (15:15 +0000)]
Add Doxyfiles to EXTRA_DIST

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@10 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoDoxyGen support.
barbieri [Thu, 13 Dec 2007 05:03:53 +0000 (05:03 +0000)]
DoxyGen support.

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@5 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoMerge branch 'master' of /home/gustavo/Development/git/lightmediascanner
barbieri [Mon, 10 Dec 2007 21:05:52 +0000 (21:05 +0000)]
Merge branch 'master' of /home/gustavo/Development/git/lightmediascanner

* 'master' of /home/gustavo/Development/git/lightmediascanner: (60 commits)
  Modules are optional, don't fail when they fail.
  Adding support to ogg
  Implement lms_check()
  Refactor lightmediascanner_process.c
  Add missing new lines to messages
  Avoid breaking strict-aliasing rules.
  Use correct pointer types for iconv, avoid warnings.
  Move process stuff into own file, will add lms_check() and use part of it.
  Charset conversion support.
  Change plugin API to take a "context" instead of "db".
  Remove unused API macros.
  Cache lms_db_* per DB instance instead of globally.
  Provide data caching based on DB instance.
  Fix copy&paste legacy: s/ldi/ldv/g in lightmediascanner_db_video.c
  id3lib now uses playcnt.
  Add playcnt to audios table.
  PLS Parser.
  Also index audios by trackno.
  M3U parser.
  Fix memory leak and possible buffer overrun.
  ...

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@2 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoInitial Repository Layout
barbieri [Mon, 10 Dec 2007 19:28:59 +0000 (19:28 +0000)]
Initial Repository Layout

git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@1 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

16 years agoModules are optional, don't fail when they fail.
Gustavo Sverzut Barbieri [Sun, 9 Dec 2007 19:57:09 +0000 (16:57 -0300)]
Modules are optional, don't fail when they fail.

16 years agoAdding support to ogg
Renato Chencarek [Fri, 7 Dec 2007 22:06:12 +0000 (19:06 -0300)]
Adding support to ogg

16 years agoImplement lms_check()
Gustavo Sverzut Barbieri [Sun, 9 Dec 2007 02:19:26 +0000 (23:19 -0300)]
Implement lms_check()

This function is used to check files previously processed by
lms_process(), it will walk the registered files and stat(2) to see
current status, if required it will reparse files that changed.

16 years agoRefactor lightmediascanner_process.c
Gustavo Sverzut Barbieri [Sun, 9 Dec 2007 02:16:54 +0000 (23:16 -0300)]
Refactor lightmediascanner_process.c

This refactor moves DB-related work to lightmediascanner_db_common.c,
so we can use them later in upcoming lightmediascanner_check.c and
possible others. These DB operations now get the compiled statement,
so each user can create its own "struct db".

16 years agoAdd missing new lines to messages
Gustavo Sverzut Barbieri [Sun, 9 Dec 2007 02:09:34 +0000 (23:09 -0300)]
Add missing new lines to messages

16 years agoAvoid breaking strict-aliasing rules.
Gustavo Sverzut Barbieri [Sat, 8 Dec 2007 04:06:10 +0000 (01:06 -0300)]
Avoid breaking strict-aliasing rules.

16 years agoUse correct pointer types for iconv, avoid warnings.
Gustavo Sverzut Barbieri [Sat, 8 Dec 2007 04:01:00 +0000 (01:01 -0300)]
Use correct pointer types for iconv, avoid warnings.

16 years agoMove process stuff into own file, will add lms_check() and use part of it.
Gustavo Sverzut Barbieri [Sat, 8 Dec 2007 01:19:19 +0000 (01:19 +0000)]
Move process stuff into own file, will add lms_check() and use part of it.

16 years agoCharset conversion support.
Gustavo Sverzut Barbieri [Fri, 7 Dec 2007 16:06:35 +0000 (16:06 +0000)]
Charset conversion support.

Now one can register various charsets to try to convert from and then
call lms_charset_conv() to get it converted to UTF-8.

All plugins were fixed to use this function. No non-UTF-8 data should
be stored on DB anymore.

16 years agoChange plugin API to take a "context" instead of "db".
Gustavo Sverzut Barbieri [Fri, 7 Dec 2007 16:21:06 +0000 (16:21 +0000)]
Change plugin API to take a "context" instead of "db".

This makes room to passing more data to plugins without changing the
API every time, will need for upcoming charset support.

16 years agoRemove unused API macros.
Gustavo Sverzut Barbieri [Fri, 7 Dec 2007 16:02:07 +0000 (16:02 +0000)]
Remove unused API macros.

16 years agoCache lms_db_* per DB instance instead of globally.
Gustavo Sverzut Barbieri [Fri, 7 Dec 2007 14:35:37 +0000 (14:35 +0000)]
Cache lms_db_* per DB instance instead of globally.

This change enable us to have various lms instances running on
multiple database connections at the same time.

16 years agoProvide data caching based on DB instance.
Gustavo Sverzut Barbieri [Fri, 7 Dec 2007 14:34:14 +0000 (14:34 +0000)]
Provide data caching based on DB instance.

Today we're caching lms_db_* instances as a global, this just enable
us to use one db instance. With this new infrastructure we'll be able
to cache those based on DB and thus have multiple sqlite3 connections.

16 years agoFix copy&paste legacy: s/ldi/ldv/g in lightmediascanner_db_video.c
Gustavo Sverzut Barbieri [Fri, 7 Dec 2007 14:30:43 +0000 (14:30 +0000)]
Fix copy&paste legacy: s/ldi/ldv/g in lightmediascanner_db_video.c

16 years agoid3lib now uses playcnt.
Gustavo Sverzut Barbieri [Thu, 6 Dec 2007 16:03:59 +0000 (18:03 +0200)]
id3lib now uses playcnt.

16 years agoAdd playcnt to audios table.
Gustavo Sverzut Barbieri [Thu, 6 Dec 2007 16:00:03 +0000 (18:00 +0200)]
Add playcnt to audios table.

16 years agoPLS Parser.
Gustavo Sverzut Barbieri [Tue, 4 Dec 2007 23:42:54 +0000 (01:42 +0200)]
PLS Parser.

16 years agoAlso index audios by trackno.
Gustavo Sverzut Barbieri [Tue, 4 Dec 2007 20:09:21 +0000 (22:09 +0200)]
Also index audios by trackno.

16 years agoM3U parser.
Gustavo Sverzut Barbieri [Mon, 3 Dec 2007 23:02:00 +0000 (01:02 +0200)]
M3U parser.

16 years agoFix memory leak and possible buffer overrun.
Gustavo Sverzut Barbieri [Mon, 3 Dec 2007 23:24:30 +0000 (01:24 +0200)]
Fix memory leak and possible buffer overrun.

16 years agoAdd playlist indexes
Gustavo Sverzut Barbieri [Mon, 3 Dec 2007 23:13:13 +0000 (01:13 +0200)]
Add playlist indexes

16 years agoAdd video indexes
Gustavo Sverzut Barbieri [Mon, 3 Dec 2007 23:10:02 +0000 (01:10 +0200)]
Add video indexes

16 years agoFix header parameters to make naming consistent.
Gustavo Sverzut Barbieri [Mon, 3 Dec 2007 23:05:02 +0000 (01:05 +0200)]
Fix header parameters to make naming consistent.

16 years agoPlaylist database support.
Gustavo Sverzut Barbieri [Mon, 3 Dec 2007 21:55:37 +0000 (23:55 +0200)]
Playlist database support.

This database helper will be used by upcoming playlist parsers.

16 years agoRemove thumb size from "images" table.
Gustavo Sverzut Barbieri [Mon, 3 Dec 2007 20:40:39 +0000 (22:40 +0200)]
Remove thumb size from "images" table.

Leave this to applications, since hardcoding some size and size policy
will not help everybody.

16 years agoStore file size.
Gustavo Sverzut Barbieri [Mon, 3 Dec 2007 20:05:06 +0000 (22:05 +0200)]
Store file size.

16 years agoSupport DB upgrades.
Gustavo Sverzut Barbieri [Fri, 30 Nov 2007 23:40:57 +0000 (20:40 -0300)]
Support DB upgrades.

Tables now have versions and can be upgrade by means of update functions.

16 years agoMake path a BLOB.
Gustavo Sverzut Barbieri [Fri, 30 Nov 2007 01:33:17 +0000 (22:33 -0300)]
Make path a BLOB.

Paths are not supposed to be encoded, but kept as-is, doing
translations may result in files not found if it's not in UTF-8 as
SQLite expect.

16 years agoRemove unused function.
Gustavo Sverzut Barbieri [Fri, 30 Nov 2007 01:16:26 +0000 (22:16 -0300)]
Remove unused function.

16 years agoUse file name if no title is found.
Gustavo Sverzut Barbieri [Tue, 27 Nov 2007 05:19:14 +0000 (02:19 -0300)]
Use file name if no title is found.

16 years agoExport db_path attribute via lms_get_db_path()
Gustavo Sverzut Barbieri [Tue, 27 Nov 2007 03:36:09 +0000 (00:36 -0300)]
Export db_path attribute via lms_get_db_path()

16 years agoCheck NULL pointers on public-API, log errors.
Gustavo Sverzut Barbieri [Tue, 27 Nov 2007 00:54:10 +0000 (21:54 -0300)]
Check NULL pointers on public-API, log errors.

16 years agopkg-config support.
Gustavo Sverzut Barbieri [Tue, 27 Nov 2007 00:23:23 +0000 (21:23 -0300)]
pkg-config support.

16 years agoDummy parser to register videos by extension only.
Gustavo Sverzut Barbieri [Mon, 26 Nov 2007 22:44:42 +0000 (19:44 -0300)]
Dummy parser to register videos by extension only.

This parser does no parsing at all, it does not even open the files,
just register files that matches the know extensions.

16 years agoVideo database support.
Gustavo Sverzut Barbieri [Mon, 26 Nov 2007 22:20:47 +0000 (19:20 -0300)]
Video database support.

This database helper will be used by upcoming video parser.

16 years agoDon't store song length in DB, it's unreliable.
Gustavo Sverzut Barbieri [Mon, 26 Nov 2007 21:37:15 +0000 (18:37 -0300)]
Don't store song length in DB, it's unreliable.

16 years agoMP3 support using id3lib.
Gustavo Sverzut Barbieri [Mon, 26 Nov 2007 03:23:31 +0000 (04:23 +0100)]
MP3 support using id3lib.

16 years agoClear dtime on files that had it but were found again.
Gustavo Sverzut Barbieri [Sun, 25 Nov 2007 01:54:59 +0000 (02:54 +0100)]
Clear dtime on files that had it but were found again.

If file was deleted (ie: media was unmounted), it's marked with the
time this deletion was detected (dtime). If it's found again (ie:
media was re-mounted), then this should be made 0 (it's not deleted).

16 years agoFix typo
Gustavo Sverzut Barbieri [Sat, 24 Nov 2007 22:53:59 +0000 (23:53 +0100)]
Fix typo

16 years agoPerformance improvement and safety check.
Gustavo Sverzut Barbieri [Thu, 22 Nov 2007 02:49:07 +0000 (23:49 -0300)]
Performance improvement and safety check.

 * Just process lms_db_*_start() once.
 * Check if _references would drop below 0 and log.

16 years agoAudio database support.
Gustavo Sverzut Barbieri [Thu, 22 Nov 2007 02:26:27 +0000 (23:26 -0300)]
Audio database support.

This database helper will be used by upcoming MP3 parser.

16 years agoAdd lms_db_bind_int64_or_null().
Gustavo Sverzut Barbieri [Thu, 22 Nov 2007 02:25:12 +0000 (23:25 -0300)]
Add lms_db_bind_int64_or_null().

This function will be used to handle cases where int64 fiels can be
NULL, like the upcoming lightmediascanner_db_audio.c

16 years agoCosmetic changes (static and remove string spaces).
Gustavo Sverzut Barbieri [Thu, 22 Nov 2007 00:55:37 +0000 (21:55 -0300)]
Cosmetic changes (static and remove string spaces).

16 years agoRemove useless debug message.
Gustavo Sverzut Barbieri [Wed, 21 Nov 2007 18:07:04 +0000 (15:07 -0300)]
Remove useless debug message.

16 years agoSplit plugin start and setup phase.
Gustavo Sverzut Barbieri [Wed, 21 Nov 2007 00:42:33 +0000 (21:42 -0300)]
Split plugin start and setup phase.

Earlier SQLite3 version doesn't provide sqlite3_prepare_v2(), so if
you change the database schema (ie: create another table or trigger,
...) the previously prepared statements are invalidated and need to be
regenerated, sqlite3_prepare_v2() does that for us, but we need not to
rely on that to run on some older platforms (maemo bora).

Plugins now should create tables on setup() and prepare statements on
start().

16 years agoAdd functions missing in older SQLite3 versions (maemo bora uses it).
Gustavo Sverzut Barbieri [Tue, 20 Nov 2007 20:14:37 +0000 (17:14 -0300)]
Add functions missing in older SQLite3 versions (maemo bora uses it).

16 years agoJPEG parser plugin.
Gustavo Sverzut Barbieri [Sat, 17 Nov 2007 00:28:20 +0000 (21:28 -0300)]
JPEG parser plugin.

This plugin is self contained and can parse JPEG images, it's able to
get image size, comments, artist, date and more.

There are just two to-do items:
 * get GPS data.
 * check if worth using mmap() to minimize seeking while reading IFD.

16 years agoMake some errors non-fatal.
Gustavo Sverzut Barbieri [Tue, 20 Nov 2007 14:30:14 +0000 (11:30 -0300)]
Make some errors non-fatal.

If scanner failed or directory doesn't exist, just log and continue.

16 years agoDelete files that failed all parsers.
Gustavo Sverzut Barbieri [Tue, 20 Nov 2007 14:24:33 +0000 (11:24 -0300)]
Delete files that failed all parsers.

16 years agoReplace "is_valid" with "dtime" (deletion time), so we can expire them.
Gustavo Sverzut Barbieri [Tue, 20 Nov 2007 13:35:14 +0000 (10:35 -0300)]
Replace "is_valid" with "dtime" (deletion time), so we can expire them.

16 years agoSplit out db utilities from core and add image db functions.
Gustavo Sverzut Barbieri [Mon, 19 Nov 2007 23:09:20 +0000 (20:09 -0300)]
Split out db utilities from core and add image db functions.

Refactor lightmediascanner.c, move utilities to
lightmediascanner_db_common, add lightmediascanner_db_image with
functions to be used by image parsers.

16 years agoPlugins now have a start/finish call before enter the processing loop.
Gustavo Sverzut Barbieri [Mon, 19 Nov 2007 17:54:53 +0000 (14:54 -0300)]
Plugins now have a start/finish call before enter the processing loop.

16 years agoAdd lightmediascanner_utils.
Gustavo Sverzut Barbieri [Mon, 19 Nov 2007 16:41:16 +0000 (13:41 -0300)]
Add lightmediascanner_utils.

It provides:
 * lms_strstrip(): remove spaces from string begin and end, accounts length.
 * lms_which_extension(): check which of the given extension the name ends,
   returns it index.

16 years agoAdd missing empty definition for GNUC_NON_NULL() for non-GCC compilers.
Gustavo Sverzut Barbieri [Mon, 19 Nov 2007 16:32:48 +0000 (13:32 -0300)]
Add missing empty definition for GNUC_NON_NULL() for non-GCC compilers.

16 years agoBuild system improvements.
Gustavo Sverzut Barbieri [Sat, 17 Nov 2007 00:34:39 +0000 (21:34 -0300)]
Build system improvements.

16 years agoSupport configurable commit_interval.
Gustavo Sverzut Barbieri [Fri, 16 Nov 2007 20:05:35 +0000 (17:05 -0300)]
Support configurable commit_interval.

Commit interval is the number of files to be scanned in each transaction.

16 years agoSQLite3 support.
Gustavo Sverzut Barbieri [Fri, 16 Nov 2007 19:59:43 +0000 (16:59 -0300)]
SQLite3 support.

It still does just one transaction for the whole process, if one
parser fails, then the whole set of changes is lost.

16 years agoSetup things for future SQLite integration: stat, match and friends.
Gustavo Sverzut Barbieri [Fri, 16 Nov 2007 19:57:01 +0000 (16:57 -0300)]
Setup things for future SQLite integration: stat, match and friends.

Parsers now should provide match() callback to say if it will handle
parse() on that file, this enable us to register in DB files that are
in use and avoid parsing if stat() reports newer mtime.

16 years agoAdd configurable slave_timeout support.
Gustavo Sverzut Barbieri [Fri, 16 Nov 2007 19:56:26 +0000 (16:56 -0300)]
Add configurable slave_timeout support.

16 years agoInitial revision of Light Media Scanner.
Gustavo Sverzut Barbieri [Fri, 16 Nov 2007 19:54:20 +0000 (16:54 -0300)]
Initial revision of Light Media Scanner.

Provides barebones for future work, plugin support is already
included, but no SQLite3 handling is done yet.