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.
Gustavo Sverzut Barbieri [Tue, 7 Jan 2014 01:01:14 +0000 (23:01 -0200)]
daemon monitors mounts and triggers scans.
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.
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.
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.
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.
Leandro Dorileo [Tue, 3 Dec 2013 16:10:47 +0000 (14:10 -0200)]
mp4: implement dlna profile and mime computation
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.
Gustavo Sverzut Barbieri [Fri, 6 Dec 2013 21:17:19 +0000 (19:17 -0200)]
document daemon in the readme.
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.
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);
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.
Gustavo Sverzut Barbieri [Wed, 4 Dec 2013 19:16:12 +0000 (17:16 -0200)]
ctl: fix g_variant leak.
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).
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.
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.
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).
Gustavo Sverzut Barbieri [Wed, 11 Sep 2013 17:28:22 +0000 (14:28 -0300)]
minor: remove left over "#undef STR_FIELD_FROM_TAG"
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.
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().
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()
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 21:25:43 +0000 (18:25 -0300)]
asf: register new fields (container, sampling_rate)
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.
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.
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 17:50:49 +0000 (14:50 -0300)]
id3: fix extra linking with mp4v2.
copy & paste bug :-(
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 14:42:11 +0000 (11:42 -0300)]
ogg: register new fields (container, sampling_rate)
Gustavo Sverzut Barbieri [Tue, 10 Sep 2013 14:38:47 +0000 (11:38 -0300)]
ogg: add ".oga" extension.
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.
Lucas De Marchi [Tue, 3 Sep 2013 19:05:45 +0000 (16:05 -0300)]
plugins/mp4: Add audio codec
Lucas De Marchi [Tue, 3 Sep 2013 19:22:35 +0000 (16:22 -0300)]
plugins/mp4: Add tracks information
Lucas De Marchi [Tue, 3 Sep 2013 19:05:45 +0000 (16:05 -0300)]
plugins/mp4: convert to mp4v2 2.0 API
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 16:25:48 +0000 (13:25 -0300)]
id3: fix bitrate to be multiple of 1000.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 16:24:11 +0000 (13:24 -0300)]
wave: provide dlna information.
Gustavo Sverzut Barbieri [Fri, 30 Aug 2013 15:36:31 +0000 (12:36 -0300)]
asf: : provide dlna information for wma.
Gustavo Sverzut Barbieri [Wed, 28 Aug 2013 00:15:45 +0000 (21:15 -0300)]
id3: provide dlna information.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 21:51:06 +0000 (18:51 -0300)]
png: provide dlna information.
Gustavo Sverzut Barbieri [Tue, 27 Aug 2013 21:50:45 +0000 (18:50 -0300)]
jpeg: provide dlna information.
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.
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.
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.
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.
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.
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.
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.
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.
Lucas De Marchi [Wed, 28 Aug 2013 14:05:51 +0000 (11:05 -0300)]
plugins/id3: Add bitrate and length for CBR files
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.
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)
Lucas De Marchi [Wed, 28 Aug 2013 04:20:34 +0000 (01:20 -0300)]
plugins/id3: Add references and fix typo
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.
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
Lucas De Marchi [Fri, 23 Aug 2013 17:45:48 +0000 (14:45 -0300)]
TODO: Update with pread/preadv/readv
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.
Lucas De Marchi [Thu, 22 Aug 2013 20:27:02 +0000 (17:27 -0300)]
util: Add functions to do 64 bits endiannes conversion
Lucas De Marchi [Wed, 21 Aug 2013 23:59:24 +0000 (20:59 -0300)]
plugins/asf: Fix header_extension_guid
Lucas De Marchi [Wed, 21 Aug 2013 23:01:09 +0000 (20:01 -0300)]
plugins/asf: Add length for videos
Lucas De Marchi [Wed, 21 Aug 2013 22:51:38 +0000 (19:51 -0300)]
shared: Add constants for time conversions
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
Lucas De Marchi [Wed, 21 Aug 2013 22:01:15 +0000 (19:01 -0300)]
plugins/asf: Add TODO
Lucas De Marchi [Wed, 21 Aug 2013 21:06:39 +0000 (18:06 -0300)]
plugins/asf: add 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.
Lucas De Marchi [Wed, 21 Aug 2013 20:23:47 +0000 (17:23 -0300)]
plugins/asf: add codec, width and height
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.
Lucas De Marchi [Wed, 21 Aug 2013 15:38:29 +0000 (12:38 -0300)]
plugins/asf: add audio prefix to symbols
Lucas De Marchi [Wed, 21 Aug 2013 03:24:56 +0000 (00:24 -0300)]
plugins/rm: 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
Lucas De Marchi [Wed, 21 Aug 2013 03:19:29 +0000 (00:19 -0300)]
plugins/asf: use common types for streams
Lucas De Marchi [Tue, 20 Aug 2013 22:12:27 +0000 (19:12 -0300)]
plugins/asf: Add reference link
Lucas De Marchi [Tue, 20 Aug 2013 22:09:12 +0000 (19:09 -0300)]
Add video substreams if available
Lucas De Marchi [Mon, 19 Aug 2013 13:59:01 +0000 (10:59 -0300)]
db: Create tables for each video substream
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)
Lucas De Marchi [Mon, 19 Aug 2013 17:19:25 +0000 (14:19 -0300)]
build: Enable warning flags for bin/
Lucas De Marchi [Fri, 16 Aug 2013 18:31:50 +0000 (15:31 -0300)]
plugins/rm: Add reference link
Lucas De Marchi [Thu, 15 Aug 2013 17:36:05 +0000 (14:36 -0300)]
Get rid of [BL]E_[24]BYTE macros
Use either libc functions from endian.h (when we have the value instead
of a position in buffer) or common provided functions in util.h
Lucas De Marchi [Wed, 14 Aug 2013 23:55:59 +0000 (20:55 -0300)]
plugins: Use shared function to add fallback name
Lucas De Marchi [Wed, 14 Aug 2013 23:06:46 +0000 (20:06 -0300)]
shared: Add function to extract fallback name from path
Lucas De Marchi [Wed, 14 Aug 2013 16:31:47 +0000 (13:31 -0300)]
plugins/wave: Add metadata fields
Parse title, artist, album and genre from INFO chunk.
Lucas De Marchi [Wed, 14 Aug 2013 14:40:38 +0000 (11:40 -0300)]
plugins/wave: Add channels, bitrate, sampling rate, container
Lucas De Marchi [Tue, 13 Aug 2013 23:17:19 +0000 (20:17 -0300)]
Add util header
For now, endiannes conversions and getter for unaligned memory.
Lucas De Marchi [Tue, 13 Aug 2013 21:17:48 +0000 (18:17 -0300)]
build: define extension macros in config.h
Instead of defining _GNU_SOURCE and friends in each source file (and
potentially forgetting in some), tell the build system we use
extensions and let it define them in config.h.
Lucas De Marchi [Tue, 13 Aug 2013 21:14:43 +0000 (18:14 -0300)]
build: Get rid of #ifdef HAVE_CONFIG_H
Lucas De Marchi [Tue, 13 Aug 2013 20:37:03 +0000 (17:37 -0300)]
plugins: Add empty wave plugin
This is just like the audio-dummy, which will serve as a skeleton for
the implementation of the wave plugin
Lucas De Marchi [Tue, 13 Aug 2013 04:59:36 +0000 (01:59 -0300)]
plugins/rm: Use mime type to decide if it's audio
Lucas De Marchi [Tue, 13 Aug 2013 04:50:27 +0000 (01:50 -0300)]
plugins/rm: Parse MDPR header and its subheaders
Interesting fields: sampling rate, codec, channels
Lucas De Marchi [Tue, 13 Aug 2013 04:47:40 +0000 (01:47 -0300)]
utils: Add cast to string size initializer
Lucas De Marchi [Mon, 12 Aug 2013 23:32:33 +0000 (20:32 -0300)]
plugins/rm: Parse PROP header
This header contains the following interesting fields: duration and
avg_bit_rate.
Lucas De Marchi [Mon, 12 Aug 2013 18:29:12 +0000 (15:29 -0300)]
plugins/rm: Simplify loop, searching for CONT header
Call _read_header_type_and_size() in only one place and make
_parse_cont_header() return the number of bytes read, so we can seek to
the right place later.
Lucas De Marchi [Mon, 12 Aug 2013 18:20:08 +0000 (15:20 -0300)]
TODO: Add entry about buffered, unbuffered, mmap for plugins
Lucas De Marchi [Mon, 12 Aug 2013 17:10:28 +0000 (14:10 -0300)]
plugins/ogg: Add support to new fields
New fields are supported for ogg vorbis:
* container: Always the same: ogg
* codec: Although ogg may contain streams encoded by other
codecs we never supported them. They will fail to parse when
we try to create the vorbis structs. Therefore for now this is
statically set to "vorbis"
* bitrate, sampling rate, channels: As extracted from the
vorbis header
Lucas De Marchi [Mon, 12 Aug 2013 14:53:05 +0000 (11:53 -0300)]
plugins/ogg: Fix leaking comment on error path
We need to call vorbis_comment_clear() on error path.
Lucas De Marchi [Mon, 12 Aug 2013 14:00:15 +0000 (11:00 -0300)]
Do not use {0} struct initializers
Change code all over the tree with the following command, and fix up the
one false positive:
git ls-files | while read f; do sed -i 's/ = { *0.*}/ = { }/g' $f; done
Lucas De Marchi [Fri, 9 Aug 2013 21:07:14 +0000 (18:07 -0300)]
Get rid of "if (bla) free(bla);"
Patch generated with the following coccinelle semantic patch:
@r@
expression E;
@@
- if (E)
- free(E);
+ free(E);
Lucas De Marchi [Fri, 9 Aug 2013 18:51:50 +0000 (15:51 -0300)]
plugins/asf: Add codec support
ASF as other containers may contain streams encoded in several other
codecs. Maybe we should have a global list/hash-table with all the
possible { ID: name }? Meanwhile, put the more important codecs there
for this specific format.
Lucas De Marchi [Fri, 9 Aug 2013 17:49:23 +0000 (14:49 -0300)]
plugins/asf: Add channels, bitrate, sampling_rate
Lucas De Marchi [Fri, 9 Aug 2013 14:46:51 +0000 (11:46 -0300)]
plugins/asf: Fix overriding type - parse multiple streams
ASF files may contain more than one stream, with more than one type.
Previously if there was a video stream after an audio stream, we would
overwrite the type.
Prepare to support multiple streams and parse all of them. If there's
any video stream, register it. Otherwise, take the first stream.
Lucas De Marchi [Fri, 9 Aug 2013 14:44:13 +0000 (11:44 -0300)]
plugins/asf: Add container
And change a littler bit the coding style:
* else on the same line as the previous "}"
* no need to to "if (bla) free bla;"
Lucas De Marchi [Thu, 8 Aug 2013 21:34:27 +0000 (18:34 -0300)]
plugins/asf: No need to overly complicate skipping attributes
We have no interest in the extension header. Skip it entirely instead of
parsing field by field and skipping them individually.
Lucas De Marchi [Thu, 8 Aug 2013 19:14:13 +0000 (16:14 -0300)]
plugins/asf: Add length field
Lucas De Marchi [Thu, 8 Aug 2013 16:15:24 +0000 (13:15 -0300)]
plugins/flac: Add new fields
New fields: length, bitrate, codec, container, sampling_rate, channels.
Bitrate may be a little bit higher than the actual bitrate since we
calculate it as (filesize * 8)/length. I.e. header/coverart are also
accounted.
We could start using the lower level decoder APIs of libflac, so we
don't have to open the file twice to parse metadata + streaminfo.
However benchmarks show it's not that relevant performance-wise.
Lucas De Marchi [Wed, 7 Aug 2013 19:35:05 +0000 (16:35 -0300)]
plugins/id3: we parse adts files as well
.adts files are the same as .aac, but usually without ID3.