platform/upstream/lightmediascanner.git
10 years agoMove main binary and daemon to main package (TIVI-2209) 63/18463/1 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_generic accepted/tizen_ivi_panda tizen_3.0.2014.q3_common tizen_3.0.m14.2_ivi tizen_3.0.m14.3_ivi accepted/tizen/generic/20140324.191247 accepted/tizen/ivi/20140324.193648 accepted/tizen/ivi/panda/20140324.190107 submit/tizen/20140324.184507 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.2_ivi_release tizen_3.0.m14.3_ivi_release
Geoffroy Van Cutsem [Mon, 24 Mar 2014 10:43:07 +0000 (11:43 +0100)]
Move main binary and daemon to main package (TIVI-2209)

Change-Id: If11d2ba74dfe0155f0430e985bc6fd9f79885b2b
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
10 years agoupstream rebase accepted/tizen/generic accepted/tizen/ivi/stable accepted/tizen_ivi_release tizen_ivi_release accepted/tizen/generic/20140213.214239 accepted/tizen/generic/20140312.103444 accepted/tizen/ivi/20140213.201406 accepted/tizen/ivi/panda/20140312.120550 accepted/tizen/ivi/release/20140312.124405 accepted/tizen/mobile/20140227.070913 submit/tizen/20140213.182539 submit/tizen/20140312.070846 submit/tizen_ivi_release/20140312.071318
Leandro Dorileo [Thu, 13 Feb 2014 18:24:55 +0000 (16:24 -0200)]
upstream rebase

Change-Id: I4e36c23f54b4025e7871a28c01c9ae175a609a20

10 years agoupstream rebase
Leandro Dorileo [Tue, 11 Feb 2014 17:59:30 +0000 (15:59 -0200)]
upstream rebase

Change-Id: Ib9a32d53d77d7302f23b7aab4e049b42a047c697

10 years agopackaging: added theora dep
Leandro Dorileo [Tue, 21 Jan 2014 16:54:36 +0000 (14:54 -0200)]
packaging: added theora dep

So we can build the ogg plugin.

Change-Id: Idd59d26c5a7293d9c8334cda36e189fcc8839589

10 years agoupdate packaging
Leandro Dorileo [Tue, 7 Jan 2014 20:08:49 +0000 (18:08 -0200)]
update packaging

Change-Id: I62c9ea11b23080ef1cd89f3095c30ed323807ea8

10 years agopackaging: update spec and upstream rebased
Leandro Dorileo [Fri, 20 Dec 2013 20:17:18 +0000 (18:17 -0200)]
packaging: update spec and upstream rebased

Dependencies added:
 - glib-2.0
 - libavcodec (enables generic parser)
 - libavformat (enables generic parser)

Install service files and update the upstream URL.

Change-Id: Ic1a38ae113d6e95003669f470f8684cbb2a57ea0

10 years agoUpdate .changes
Mikko Ylinen [Fri, 16 Aug 2013 09:36:58 +0000 (12:36 +0300)]
Update .changes

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
10 years agoInstall test binaries. Fixes TIVI-1428
Mikko Ylinen [Thu, 15 Aug 2013 08:00:26 +0000 (11:00 +0300)]
Install test binaries. Fixes TIVI-1428

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
10 years agoFix rpmlint errors
Mikko Ylinen [Thu, 15 Aug 2013 06:40:35 +0000 (09:40 +0300)]
Fix rpmlint errors

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
10 years agoUpdate .changes
Mikko Ylinen [Tue, 9 Jul 2013 17:29:13 +0000 (20:29 +0300)]
Update .changes

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
10 years agoRemove .spec from .gitignore
Mikko Ylinen [Tue, 9 Jul 2013 17:22:09 +0000 (20:22 +0300)]
Remove .spec from .gitignore

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
10 years agoAdd Tizen packaging
Mikko Ylinen [Tue, 9 Jul 2013 17:21:35 +0000 (20:21 +0300)]
Add Tizen packaging

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
10 years agodaemon: warning and behave properly if no xdg-user-dirs setup.
Gustavo Sverzut Barbieri [Thu, 13 Feb 2014 16:02:22 +0000 (14:02 -0200)]
daemon: warning and behave properly if no xdg-user-dirs setup.

10 years agolibav: compatibility issues between libav and ffmpeg
Leandro Dorileo [Thu, 13 Feb 2014 13:24:44 +0000 (11:24 -0200)]
libav: compatibility issues between libav and ffmpeg

For compatibility issues we must try to get channels using the
codec->channels field if it's 0 we try using the function
av_get_channel_layout_cb_channels().

10 years agodlna: fix audio sentinel check
Leandro Dorileo [Thu, 13 Feb 2014 15:17:47 +0000 (13:17 -0200)]
dlna: fix audio sentinel check

10 years agoRecord if the file was already parsed, ignore them in the generic.
Gustavo Sverzut Barbieri [Wed, 12 Feb 2014 14:40:08 +0000 (12:40 -0200)]
Record if the file was already parsed, ignore them in the generic.

Generic parser is more like a fallback, then if the file was already
parsed by some other parser it should ignore that entry.

10 years agogeneric: minimal libav adjustments
Leandro Dorileo [Tue, 11 Feb 2014 17:26:51 +0000 (15:26 -0200)]
generic: minimal libav adjustments

Since libav doesn't implement the avcodec_get_name() util function we
need to implement the AVCodecDescriptor handling in our side.

Libav will also need the AV_OPT_SEARCH_FAKE_OBJ flag to retrieve the
ts_packetsize.

10 years agogeneric: remove the dlna stuff and add codec container handlers
Leandro Dorileo [Fri, 17 Jan 2014 12:45:28 +0000 (10:45 -0200)]
generic: remove the dlna stuff and add codec container handlers

This patch removes the dlna stuffs from generic plugin and for backward
compatibility we have introduce some container and codec handlers so we
can result in the same identifiers as the other plugins, if a handler
is not found we go with what we can extract from the file using the
libavformat api.

The mp4 codec implementation lacks on some profiles/levels parsing by
no a smaller subset - not a minimal, but a smaller subset.

10 years agowave: remove the dlna stuffs from plugin
Leandro Dorileo [Fri, 17 Jan 2014 12:43:47 +0000 (10:43 -0200)]
wave: remove the dlna stuffs from plugin

10 years agopng: remove all the dlna stuff
Leandro Dorileo [Fri, 17 Jan 2014 12:41:41 +0000 (10:41 -0200)]
png: remove all the dlna stuff

Remove all the dlna sutff and likewise the jpeg plugin we set the
container field so we can know - in the dlna layer - the rules to
apply.

10 years agomp4: remove all the dlna stuff from plugin
Leandro Dorileo [Fri, 17 Jan 2014 12:41:10 +0000 (10:41 -0200)]
mp4: remove all the dlna stuff from plugin

10 years agojpeg: remove all the dlna stuff
Leandro Dorileo [Fri, 17 Jan 2014 12:40:06 +0000 (10:40 -0200)]
jpeg: remove all the dlna stuff

Remove all the dlna stuff and make use of the container field so
we can know the rules to apply.

10 years agoid3: remove all the dlna stuff from plugin
Leandro Dorileo [Fri, 17 Jan 2014 12:38:04 +0000 (10:38 -0200)]
id3: remove all the dlna stuff from plugin

10 years agoasf: remove all the dlna stuff from plugin
Leandro Dorileo [Fri, 17 Jan 2014 12:37:19 +0000 (10:37 -0200)]
asf: remove all the dlna stuff from plugin

10 years agodb layer: call the lms_dlna_* functions
Leandro Dorileo [Fri, 17 Jan 2014 12:48:53 +0000 (10:48 -0200)]
db layer: call the lms_dlna_* functions

Call the lms_dlna_* functions to properly set the dlna_profile and dlna_mime
fields. The plugins can still set/define their own dlna_mime and dlna_profile,
if so, we're not going to overwrite it and the plugin's will have priority.

10 years agodlna: introduce a dlna lower layer
Leandro Dorileo [Fri, 17 Jan 2014 12:21:19 +0000 (10:21 -0200)]
dlna: introduce a dlna lower layer

A small change on how the dlna profile and mime are defined, now LMS
knows about the rules and aplies it wherever possible.

In the next patches we make use of it.

10 years agoimage/video db: new fields added
Leandro Dorileo [Fri, 17 Jan 2014 12:28:31 +0000 (10:28 -0200)]
image/video db: new fields added

New fields were introduced, they should go through the lower layers
to be used on dlna source code, they are:

    + image:
        container: a string carrying the container information, used
 to determine which dlna set of rules should be applied.
    + video:
        packet_size: without the packet_size we can not apply the
meg1/2 rules.

10 years agoconfigure: use pkg check instead of headers
Leandro Dorileo [Wed, 8 Jan 2014 17:03:10 +0000 (15:03 -0200)]
configure: use pkg check instead of headers

Use pkg check for vorbis/tremor instead of headers and libs.

10 years agodaemon monitors mounts and triggers scans.
Gustavo Sverzut Barbieri [Tue, 7 Jan 2014 01:01:14 +0000 (23:01 -0200)]
daemon monitors mounts and triggers scans.

10 years agoprepare for next release, for now bumped version to 0.4.5.99
Gustavo Sverzut Barbieri [Fri, 27 Dec 2013 14:01:47 +0000 (12:01 -0200)]
prepare for next release, for now bumped version to 0.4.5.99

Still need to define if it will be a 1.0 or 0.5 release.

10 years agochange project url to github.
Gustavo Sverzut Barbieri [Wed, 11 Dec 2013 16:29:05 +0000 (14:29 -0200)]
change project url to github.

Garage.maemo is no more for a while, now we'll have everything in github.

10 years agogeneric: implemente a generic parser plugin
Leandro Dorileo [Thu, 19 Dec 2013 16:55:38 +0000 (14:55 -0200)]
generic: implemente a generic parser plugin

A generic parser plugin based on libavcoded, initially supporting
mpeg1, mpeg2 and mp3.

10 years agoplugin: implement parser sorting
Leandro Dorileo [Thu, 19 Dec 2013 16:52:39 +0000 (14:52 -0200)]
plugin: implement parser sorting

Sort the parsers based on its defined order field. The smaller "ordered"
plugin will atempt to parse first.

10 years agomp4: implement dlna profile and mime computation
Leandro Dorileo [Tue, 3 Dec 2013 16:10:47 +0000 (14:10 -0200)]
mp4: implement dlna profile and mime computation

10 years agobuild: Disable static library by default
Lucas De Marchi [Mon, 9 Dec 2013 17:51:42 +0000 (15:51 -0200)]
build: Disable static library by default

Static library isn't enabled by default anymore. It can be enabled back
by passing --enable-static.

10 years agodocument daemon in the readme.
Gustavo Sverzut Barbieri [Fri, 6 Dec 2013 21:17:19 +0000 (19:17 -0200)]
document daemon in the readme.

10 years agolightmediascannerctl: start daemon if not running.
Gustavo Sverzut Barbieri [Fri, 6 Dec 2013 21:03:17 +0000 (19:03 -0200)]
lightmediascannerctl: start daemon if not running.

While the service would be activated if we did call some method we are
checking for the current nameowner to do some operations (status, etc)
and it would exit if there was no server at that time.

Now we launch the service and make sure it's there.

10 years agoFix warnings on 64 bits
Lucas De Marchi [Wed, 4 Dec 2013 19:58:15 +0000 (17:58 -0200)]
Fix warnings on 64 bits

Use the glib-provided macros to print 64 bit values.

lightmediascannerd.c:212:9: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘gint64’ [-Wformat=]
         g_warning("Couldn't bind delete old dtime '%lld'from %s: %s",

lightmediascannerctl.c:280:16: warning: format ‘%llu’ expects argument
of type ‘long long unsigned int’, but argument 4 has type ‘guint64’
[-Wformat=]
                category, path, uptodate, processed, deleted, skipped,
errors);

10 years agodaemon/ctl: introduce ScanProgress signal.
Gustavo Sverzut Barbieri [Wed, 4 Dec 2013 19:19:31 +0000 (17:19 -0200)]
daemon/ctl: introduce ScanProgress signal.

The ScanProgress signal will notify what the daemon is doing so
clients can provide better status to the user and look responsive,
giving a clue of what is happening and not just a spinning wheel that
may look like something is stuck if media/system is slow enough.

10 years agoctl: fix g_variant leak.
Gustavo Sverzut Barbieri [Wed, 4 Dec 2013 19:16:12 +0000 (17:16 -0200)]
ctl: fix g_variant leak.

10 years agoprocess: properly report status for dual-process mode.
Gustavo Sverzut Barbieri [Wed, 4 Dec 2013 18:59:13 +0000 (16:59 -0200)]
process: properly report status for dual-process mode.

we should report the status we got in "reply", such as processed,
uptodate, skipped... not the return of _master_recv_reply() that is 1
during timeout or 0 on success (everything was being reported as 0
(LMS_PROGRESS_STATUS_UP_TO_DATE).

10 years agoprocess: do not change update_id on skipped files.
Gustavo Sverzut Barbieri [Wed, 4 Dec 2013 18:58:22 +0000 (16:58 -0200)]
process: do not change update_id on skipped files.

if we skipped a file it doesn't go to DB and thus we shouldn't mess
with counter and thus update_id. It is the same case as the file was
up to date.

10 years agodaemon: remove from db files with dtime older than a given date.
Gustavo Sverzut Barbieri [Wed, 4 Dec 2013 17:25:26 +0000 (15:25 -0200)]
daemon: remove from db files with dtime older than a given date.

LightMediaScanner will not delete the database entries for files that
are gone, instead it will mark the 'dtime' column with current
timestamp. This allows fast restore of files from a removable media,
but can grow the database too much if these are never purged from time
to time.

This commit introduces --delete-older-than=DAYS (-d=DAYS) that will
always purge entries older than the given number of days, or negative
value to disable this behavior.

10 years agodaemon: export read-only property DataBasePath.
Gustavo Sverzut Barbieri [Wed, 4 Dec 2013 13:58:02 +0000 (11:58 -0200)]
daemon: export read-only property DataBasePath.

This is useful for users to know where is the database instead of
negotiating this in another way (like configuration files of both
lightmediascannerd and clients).

10 years agominor: remove left over "#undef STR_FIELD_FROM_TAG"
Gustavo Sverzut Barbieri [Wed, 11 Sep 2013 17:28:22 +0000 (14:28 -0300)]
minor: remove left over "#undef STR_FIELD_FROM_TAG"

10 years agoflac: fix wrong prefix length
Lucas De Marchi [Tue, 10 Sep 2013 23:52:00 +0000 (20:52 -0300)]
flac: fix wrong prefix length

Fix copy and paste from other items.

10 years agoutils refactor.
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 23:04:20 +0000 (20:04 -0300)]
utils refactor.

move parser specific stuff from src/lib/shared/util.h to
src/plugin/shared/util.h, still not to be installed and without "lms_"
prefix.

the aspect_ratio calculation was moved into lightmediascanner_util.h
and lightmediascanner_db.h to be simpler to use.

extract name from path is also too common, now in
lightmediascanner_util.h as lms_name_from_path().

10 years agointroduce and use helpers lms_string_size_strndup() and lms_string_size_dup()
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 22:11:01 +0000 (19:11 -0300)]
introduce and use helpers lms_string_size_strndup() and lms_string_size_dup()

10 years agoasf: register new fields (container, sampling_rate)
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 21:25:43 +0000 (18:25 -0300)]
asf: register new fields (container, sampling_rate)

10 years agomp4: fix audio codec lookup, add video codec and extra information.
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 20:50:21 +0000 (17:50 -0300)]
mp4: fix audio codec lookup, add video codec and extra information.

 * audio codec needed an spare NULL position before _codec_audio_mpeg4_tssi;
 * audio codec must lookup type if different from MP4_MPEG4_AUDIO_TYPE;
 * register stream language;
 * register audio stream sampling_rate;
 * register video stream framerate if it matches a known value;
 * register video stream bitrate;
 * register video stream codec;
 * register container as "mp4";
 * added authors.

10 years agomp4: remove support for deprecated library.
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 17:51:56 +0000 (14:51 -0300)]
mp4: remove support for deprecated library.

the new 2.0 api is already old enough, remove support for the previous
deprecated.

10 years agoid3: fix extra linking with mp4v2.
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 17:50:49 +0000 (14:50 -0300)]
id3: fix extra linking with mp4v2.

copy & paste bug :-(

10 years agoogg: register new fields (container, sampling_rate)
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 14:42:11 +0000 (11:42 -0300)]
ogg: register new fields (container, sampling_rate)

10 years agoogg: add ".oga" extension.
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 14:38:47 +0000 (11:38 -0300)]
ogg: add ".oga" extension.

10 years agovideo: add missing fields (container, sampling_rate)
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 14:28:53 +0000 (11:28 -0300)]
video: add missing fields (container, sampling_rate)

We must remember the video file container and the audio stream sampling_rate.

10 years agoplugins/mp4: Add audio codec
Lucas De Marchi [Tue, 3 Sep 2013 19:05:45 +0000 (16:05 -0300)]
plugins/mp4: Add audio codec

10 years agoplugins/mp4: Add tracks information
Lucas De Marchi [Tue, 3 Sep 2013 19:22:35 +0000 (16:22 -0300)]
plugins/mp4: Add tracks information

10 years agoplugins/mp4: convert to mp4v2 2.0 API
Lucas De Marchi [Tue, 3 Sep 2013 19:05:45 +0000 (16:05 -0300)]
plugins/mp4: convert to mp4v2 2.0 API

10 years agoid3: fix bitrate to be multiple of 1000.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 16:25:48 +0000 (13:25 -0300)]
id3: fix bitrate to be multiple of 1000.

10 years agowave: provide dlna information.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 16:24:11 +0000 (13:24 -0300)]
wave: provide dlna information.

10 years agoasf: : provide dlna information for wma.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 15:36:31 +0000 (12:36 -0300)]
asf: : provide dlna information for wma.

10 years agoid3: provide dlna information.
Gustavo Sverzut Barbieri [Wed, 28 Aug 2013 00:15:45 +0000 (21:15 -0300)]
id3: provide dlna information.

10 years agopng: provide dlna information.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 21:51:06 +0000 (18:51 -0300)]
png: provide dlna information.

10 years agojpeg: provide dlna information.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 21:50:45 +0000 (18:50 -0300)]
jpeg: provide dlna information.

10 years agoadd dlna fields to video table.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 15:28:58 +0000 (12:28 -0300)]
add dlna fields to video table.

Add new fields dlna_profile and dlna_mime to provide simple
information for applications that use it.

10 years agoasf: better bitrate for variable bit rate.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 15:33:30 +0000 (12:33 -0300)]
asf: better bitrate for variable bit rate.

The spec says the following:

 Alternate Data Bitrate:

    Specifies the leak rate RAlt, in bits per second, of a leaky
    bucket that contains the data portion of the stream without
    overflowing, excluding all ASF Data Packet overhead. The size of
    the leaky bucket is specified by the value of the Alternate Buffer
    Size field. This value is relevant in most scenarios where the bit
    rate is not exactly constant, but it is especially useful for
    streams that have highly variable bit rates. This field can
    optionally be set to the same value as the Data Bitrate field.

 Alternate Buffer Size:

    Specifies the size BAlt, in milliseconds, of the leaky bucket used
    in the Alternate Data Bitrate definition. This value is relevant
    in most scenarios where the bit rate is not exactly constant, but
    it is especially useful for streams that have highly variable bit
    rates. This field can optionally be set to the same value as the
    Buffer Size field.

 Alternate Initial Buffer Fullness:

    Specifies the initial fullness, in milliseconds, of the leaky
    bucket used in the Alternate Data Bitrate definition. This is the
    fullness of the buffer at the instant before the first bit in the
    stream is dumped into the bucket. Typically, this value is set to
    0. This value shall not exceed the value of the Alternate Buffer
    Size field.

10 years agodb_audio: add dlna_mime column.
Gustavo Sverzut Barbieri [Wed, 28 Aug 2013 00:14:35 +0000 (21:14 -0300)]
db_audio: add dlna_mime column.

this column pairs with dlna_profile.

10 years agoadd dlna fields to image table.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 21:50:05 +0000 (18:50 -0300)]
add dlna fields to image table.

Add new fields dlna_profile and dlna_mime to provide simple
information for applications that use it.

10 years agoadd lightmediascannerd and lightmediascannerctl
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 03:37:50 +0000 (00:37 -0300)]
add lightmediascannerd and lightmediascannerctl

The daemon and control client are provided as a way to make usage of
lightmediascanner easier in a platform. It will scan directories based
on the startup configuration of categories, their parsers and
directories.

One can request a write lock, avoiding the server to scan and also
report to others that they should not write to DB.

Scanning status, Write Lock and global Update ID are provided as
properties.

The scan method will take a dict of categories and their respective
scan paths. This allows to reduce the scan scope to just few
categories and paths. The categories must exist previously and paths
must be inside the previously known categories directories, this
avoids people doing mistakes. If a category is provided as an empty
list, all directories will be used. If there are no categories
provided, then all categories with all directories will be used.

10 years agoallow scanning a single file instead of a directory.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 18:21:37 +0000 (15:21 -0300)]
allow scanning a single file instead of a directory.

The previous code assumed we always scan a directory, this is
cumbersome if we know just one file changed and want to scan only that
instance and not the whole dir recursively.

It is now allowed to check a non-existent directory or file, this will
mark any existing entry as deleted in the database.

10 years agoplugins/id3: Add loop on frames to estimate bitrate
Lucas De Marchi [Fri, 30 Aug 2013 14:20:29 +0000 (11:20 -0300)]
plugins/id3: Add loop on frames to estimate bitrate

Estimate the bitrate and length when there's no additional header we
can rely on to get these numbers. This is done by parsing the initial
frames of the file.

This has an impact on performance, since now we are parsing much more
than before. There's a define N_FRAMES_BITRATE_ESTIMATE and
N_FRAMES_CBR_ESTIMATE that need to be tuned in order to obtain the best
compromise between performance and accuracy.

10 years agoplugins/id3: parse VBR headers
Lucas De Marchi [Thu, 29 Aug 2013 12:51:07 +0000 (09:51 -0300)]
plugins/id3: parse VBR headers

Parse VBR headers: Xing and VBRI. We use the number of frames and stream
size we find in these headers in order to calculate length and bitrate.

We also parse the "Info" header, which is the same as "Xing", but in
this case we assume the file has constant bitrate.

Now the only case in which bitrate is wrong is when the file is VBR but
it has no headers to indicate so.

10 years agoplugins/id3: Add bitrate and length for CBR files
Lucas De Marchi [Wed, 28 Aug 2013 14:05:51 +0000 (11:05 -0300)]
plugins/id3: Add bitrate and length for CBR files

10 years agoplugins/id3: Fix id3v2 not skipping CRC if present
Lucas De Marchi [Wed, 28 Aug 2013 21:45:55 +0000 (18:45 -0300)]
plugins/id3: Fix id3v2 not skipping CRC if present

If there's a CRC field after the extended header, we need to skip it,
too. The worst thing that could happen here is the CRC containing a sync
byte and having no other frames in the ID3v2. In this case our parser
would not find correct mp3 information.

10 years agoplugins/id3: Fix id3v2 header size calculation
Lucas De Marchi [Wed, 28 Aug 2013 04:24:35 +0000 (01:24 -0300)]
plugins/id3: Fix id3v2 header size calculation

_parse_id3v2() was not getting the size of the frame correctly. Since
the number uses at most 7 bits, we can't use _to_uint() function. For
example, 0x00000201 should be translated as 257, not 513.

We were also relying on _parse_id3v2() letting the fd in the right
position to look for the sync byte. However if this function read too
little and ave up parsing we were left in the middle of some ID3 frame.
Also, if there are other mistakes in the tag, we could end up reading
too much and losing the first sync byte.

Be safe and skip the amount of bytes as written into the ID3 header (or
skip just the ID3 tag if _parse_id3v2() fails badly).

We also skip the extended header if it exists and rename the
syncframe_offset to sync_offset everywhere.

Reference: Section 3.1 of ID3v2 tag specification
(http://id3.org/id3v2.3.0)

10 years agoplugins/id3: Add references and fix typo
Lucas De Marchi [Wed, 28 Aug 2013 04:20:34 +0000 (01:20 -0300)]
plugins/id3: Add references and fix typo

10 years agoplugins/ogg: Add support for theora videos
Lucas De Marchi [Tue, 27 Aug 2013 21:22:47 +0000 (18:22 -0300)]
plugins/ogg: Add support for theora videos

This adds support for theora videos, with all the fields being filled
in, possibly with several streams.

For now we link to libtheoradec to do this. However it seems a little
bit overkill linking to libvorbis and libtheora. There can also be other
codecs inside ogg, which we don't currently support.

It would be good (but a little more difficult) to stop using them and
parse the file by ourselves. In this scenario the use of libogg would
remain so we get page/packet separation while doing the codec part.

10 years agoplugins/ogg: Refactor to conquer
Lucas De Marchi [Tue, 27 Aug 2013 04:56:43 +0000 (01:56 -0300)]
plugins/ogg: Refactor to conquer

  * Add reference links
  * Parse all streams in a file - we only consider the first one
    regarding audio files, but this paves the way to support video
    (which has never been supported in ogg plugin)
  * Split the file parsing into pages/packets/codec-data. This makes it
    easier to support theora (needed for video) and also for removing
    libvorbis if it's desired in the future
  * Be safer regarding packets crossing page boundaries
  * Be safer regarding EOF in the middle of parsing

10 years agoTODO: Update with pread/preadv/readv
Lucas De Marchi [Fri, 23 Aug 2013 17:45:48 +0000 (14:45 -0300)]
TODO: Update with pread/preadv/readv

10 years agoplugins/asf: Parse extended stream properties
Lucas De Marchi [Fri, 23 Aug 2013 00:23:38 +0000 (21:23 -0300)]
plugins/asf: Parse extended stream properties

Parsing the Extended Stream Properties Object we can get the framerate
and bitrate of each stream. Also, since ASF allows the "Stream
Properties Object" to be embedded inside the extension with this code
we make sure we are getting all the streams that are possible in a ASF
file.

10 years agoutil: Add functions to do 64 bits endiannes conversion
Lucas De Marchi [Thu, 22 Aug 2013 20:27:02 +0000 (17:27 -0300)]
util: Add functions to do 64 bits endiannes conversion

10 years agoplugins/asf: Fix header_extension_guid
Lucas De Marchi [Wed, 21 Aug 2013 23:59:24 +0000 (20:59 -0300)]
plugins/asf: Fix header_extension_guid

10 years agoplugins/asf: Add length for videos
Lucas De Marchi [Wed, 21 Aug 2013 23:01:09 +0000 (20:01 -0300)]
plugins/asf: Add length for videos

10 years agoshared: Add constants for time conversions
Lucas De Marchi [Wed, 21 Aug 2013 22:51:38 +0000 (19:51 -0300)]
shared: Add constants for time conversions

10 years agoplugins/asf: Refactor to conquer
Lucas De Marchi [Wed, 21 Aug 2013 22:42:16 +0000 (19:42 -0300)]
plugins/asf: Refactor to conquer

  * Move fields inside asf_info: streams, length, type. They are fields
    important both to audio and video files

  * Pass asf_info around to frame parsers: we only decide if it's audio
    or video later, when all important frames are already parsed

  * Try not to reach 80 cols in some places

  * Move code to free streams to its own function

  * Remove useless #if 0 code

  * Check if we parsed any stream. Would be a violation of the format if
    info.streams was NULL in the end, but at least we don't crash

10 years agoplugins/asf: Add TODO
Lucas De Marchi [Wed, 21 Aug 2013 22:01:15 +0000 (19:01 -0300)]
plugins/asf: Add TODO

10 years agoplugins/asf: add aspect ratio
Lucas De Marchi [Wed, 21 Aug 2013 21:06:39 +0000 (18:06 -0300)]
plugins/asf: add aspect ratio

10 years agoutil: add function to calculate aspect ratio
Lucas De Marchi [Wed, 21 Aug 2013 20:52:44 +0000 (17:52 -0300)]
util: add function to calculate aspect ratio

To calculate the aspect ratio what we need to do is to calculate the gcd
of width and height, dividing by it. We use the simple Euclidean
algorithm. Besides of being simple it's pretty fast.

10 years agoplugins/asf: add codec, width and height
Lucas De Marchi [Wed, 21 Aug 2013 20:23:47 +0000 (17:23 -0300)]
plugins/asf: add codec, width and height

10 years agoplugins/asf: add all streams on video
Lucas De Marchi [Wed, 21 Aug 2013 15:53:03 +0000 (12:53 -0300)]
plugins/asf: add all streams on video

We use the heuristic that a file is of audio type if it contains only
audio streams, otherwise it's considered as video. However now we add
all the audio/video streams to the database. It suffices to just set the
streams pointer since we are already allocating/freeing as we should.

10 years agoplugins/asf: add audio prefix to symbols
Lucas De Marchi [Wed, 21 Aug 2013 15:38:29 +0000 (12:38 -0300)]
plugins/asf: add audio prefix to symbols

10 years agoplugins/rm: use common type for stream
Lucas De Marchi [Wed, 21 Aug 2013 03:24:56 +0000 (00:24 -0300)]
plugins/rm: use common type for stream

10 years agoplugins/mp4: use common type for stream
Lucas De Marchi [Wed, 21 Aug 2013 03:21:59 +0000 (00:21 -0300)]
plugins/mp4: use common type for stream

10 years agoplugins/asf: use common types for streams
Lucas De Marchi [Wed, 21 Aug 2013 03:19:29 +0000 (00:19 -0300)]
plugins/asf: use common types for streams

10 years agoplugins/asf: Add reference link
Lucas De Marchi [Tue, 20 Aug 2013 22:12:27 +0000 (19:12 -0300)]
plugins/asf: Add reference link

10 years agoAdd video substreams if available
Lucas De Marchi [Tue, 20 Aug 2013 22:09:12 +0000 (19:09 -0300)]
Add video substreams if available

10 years agodb: Create tables for each video substream
Lucas De Marchi [Mon, 19 Aug 2013 13:59:01 +0000 (10:59 -0300)]
db: Create tables for each video substream

10 years agotest: Fix leaking stmt
Lucas De Marchi [Wed, 21 Aug 2013 17:31:11 +0000 (14:31 -0300)]
test: Fix leaking stmt

Let's call sqlite3_finalize() on stmt so resources are freed and we
don't leak it:

==11116== 107,752 (856 direct, 106,896 indirect) bytes in 1 blocks are definitely lost in loss record 84 of 84
==11116==    at 0x4C2757B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11116==    by 0x5076816: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x5052889: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x505A6C7: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x505A6EC: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x50D27F0: ??? (in /usr/lib/libsqlite3.so.0.8.6)
==11116==    by 0x401F22: show (test.c:377)
==11116==    by 0x401913: main (test.c:481)

10 years agobuild: Enable warning flags for bin/
Lucas De Marchi [Mon, 19 Aug 2013 17:19:25 +0000 (14:19 -0300)]
build: Enable warning flags for bin/

10 years agoplugins/rm: Add reference link
Lucas De Marchi [Fri, 16 Aug 2013 18:31:50 +0000 (15:31 -0300)]
plugins/rm: Add reference link