Commit graph

292 commits

Author SHA1 Message Date
Arun Raghavan 0cf81938a1 pbutils: add AAC profile detection to codec utils
This moves AAC profile detection to pbutils, and uses this in
typefindfunctions. This will also be used in qtdemux.

https://bugzilla.gnome.org/show_bug.cgi?id=617314

API: gst_codec_utils_aac_get_profile()
API: codec_utils_aac_caps_set_level_and_profile()
2010-09-30 13:09:29 +01:00
Arun Raghavan c77f88cac6 pbutils: add codec-specific utility functions for AAC
This allows us to add generic codec-specific functionality, like
extracting profile/level data from headers, without having to duplicate
code across demuxers and typefindfunctions.

As a starting point, this moves over AAC level extraction code from
typefindfunctions, so it can be reused in qtdemux, etc.

https://bugzilla.gnome.org/show_bug.cgi?id=617314

API: gst_codec_utils_aac_get_sample_rate_from_index()
API: gst_codec_utils_aac_get_level()
2010-09-30 13:09:28 +01:00
Sebastian Dröge ff45b44e19 typefindfunctions: Add mp3 to the apetag extensions 2010-09-20 11:14:55 +02:00
Thiago Santos d123ab7bb1 typefind: Detect avc1 ftyp as video/quicktime
Detects avc1 ftyp as video/quicktime (iso variant)
2010-08-01 06:53:28 -03:00
Arun Raghavan ae03de8ff8 typefindfunctions: export 3gp profile in caps
This reads the 3gp profile from the major/compatible brands and puts
this as a 'profile' field in caps. This can be used by demuxers to
decide whether they can handle this stream or not. Also needed for
DLNA.

https://bugzilla.gnome.org/show_bug.cgi?id=620291
2010-07-24 10:50:45 +01:00
Parthasarathi Susarla aad661ec77 typefinding: detect enhanced AC-3
https://bugzilla.gnome.org/show_bug.cgi?id=623846
2010-07-24 09:48:41 +01:00
Tim-Philipp Müller bd0adb11fd typefinding: make mpeg-ts typefinder scan more data
We only look for packets with payload, but it appears there may be packets without,
which makes it harder to find the N packets with payload in a row that we need in
order to typefind this successfully, so scan some more data than necessary in the
optimistic scenario. Alternatively we could change IS_MPEGTS_HEADER().

Fixes #623663.
2010-07-18 11:37:11 +01:00
Philip Jägenstedt 72ca12e4c1 typefind: only associate .webm with WebM
.weba (audio) and .webv (video) were speculation on my part before
the public launch. As of yet no decision has been made on the
file extension for audio-only WebM, and I'm pretty sure there will
never be one for video-only.

Fixes bug #623837.
2010-07-16 17:40:45 +02:00
Arun Raghavan 026e5d3e67 typefinding: Mark ISO 14496-14 files as video/quicktime
These are currently being marked as audio/x-m4a which is incorrect.

https://bugzilla.gnome.org/show_bug.cgi?id=620720
2010-06-24 14:25:38 +01:00
Edward Hervey 7b2584ed68 typefindfunctions: Fix unitialized variables
yay macosx compilers :(
2010-06-14 14:13:32 +02:00
Tim-Philipp Müller b5a7e96291 typefinding: look for dts frames at non-zero offsets too
Scan a bit into the data when checking for dts frames instead
of expecting the frame sync to be right at the start of the
data. This is needed for some dts-disguised-as-pcm-in-wav files.

See #413942.
2010-06-11 15:59:54 +01:00
Tim-Philipp Müller 9235c91bec typefinding: add typefinder for dts audio 2010-06-11 15:59:53 +01:00
Tim-Philipp Müller 261a1447fa typefinding: fix log function printf format issue 2010-06-06 16:46:55 +01:00
Tim-Philipp Müller d4269515fa typefinding: stop jpeg typefinding once we found a SOF marker 2010-06-05 18:25:51 +01:00
Tim-Philipp Müller 95b4de4ed7 typefinding: improve jpeg typefinder
Make jpeg typefinder check more than just the first two bytes
plus Exif or JFIF marker. This allows us to report MAXIMUM
probability in cases where there's no Exif or JFIF marker,
making typefinding stop early. Also extract width and height,
because we can.
2010-06-05 18:06:42 +01:00
Tim-Philipp Müller 14d14a9143 typefinding: fix AC-3 typefinding so that it actually checks for a second frame
Fix typo that made the AC-3 typefinder not actually check for a
second frame, but rather compare the sync point found to itself,
which resulted in the AC-3 typefinder reporting an overly optimistic
MAXIMUM or VERY_LIKELY probability when it found a possible frame
sync.
2010-06-05 17:24:31 +01:00
Sebastian Dröge 760ae91ec3 typefindfunctions: Add IVF typefinder 2010-05-22 08:55:51 +02:00
Philip Jägenstedt 3762cfd3d7 typefind: Detect WebM as video/webm
Refactor matroska_type_find into ebml_check_header and a new
matroska_type_find and webm_type_find.
2010-05-19 19:24:35 +02:00
Tim-Philipp Müller 555a3a5d14 typefinding: add channels and rate to ADTS caps if we can 2010-04-12 15:04:31 +01:00
Arun Raghavan 43a04483d9 typefinding: add AAC level to ADTS caps
This adds code to calculate the level for a given AAC stream and export
it in the stream caps. For AAC LC streams, the level is calculated
according to the definition under the AAC Profile. For other streams,
the definition under the Main Profile is used.

HE-AAC support is still to be done, and is dependent on detecting the
presence of SBR and PS in the stream.

Level is added as a field of type string because that's the way it's
done in H.264 caps as well. There are only a few possible levels, so
not using a numerical type is not too painful in this case, and
consistency is nice.

Fixes #613589.
2010-04-12 15:04:31 +01:00
Arun Raghavan 34dcb8458e typefinding: add AAC profile to ADTS caps
This looks at the AAC profile for ADTS streams and adds the profile as a
string in the corresponding caps.

Profile is the actual profile, base-profile denotes the minimum codec
requirements to decode this stream. In this case they're always the
same, but they may differ e.g. in case of certain HE-AAC streams that
can be partially decoded by LC decoders (with loss of quality of course)
if no suitable HE-AAC decoder is available.

Fixes #612312.
2010-04-12 15:04:23 +01:00
Benjamin Otte 3bd4aa26ff Add -Wwrite-strings to configure
Fixes for the code included
2010-03-16 17:41:51 +01:00
David Hoyt cfa8de336c typefind: use g_ascii_strncasecmp() instead of strncasecmp()
g_ascii_strncasecmp() is more portable and likely more robust as
well (with random binary data as input).

Fixes #612845.
2010-03-15 18:45:13 +00:00
Kaj-Michael Lang 0230f7ed9e typefind: Handle stm module format
Fixes #609314.
2010-02-15 12:50:45 +00:00
Sebastian Dröge 1ae783dafc typefindfunctions: Add typefinder for ISO MP4 files
Fixes bug #607848.
2010-01-24 20:46:58 +01:00
Tim-Philipp Müller eef885cf86 typefinding: optimise AC-3 typefinder a bit
Make AC-3 typefinder use the DataScanCtx stuff so we don't have to
do gst_type_find_peek() in the inner loop all the time. Also return
when we've suggested AC3 caps, instead of continuing with the loop.
2010-01-23 15:28:02 +00:00
Tim-Philipp Müller ca7ba91e5b Revert "typefind: Reduce number of calls to gst_type_find_peek."
This reverts commit c661bfaa99.

This breaks AC-3 typefinding for all cases where the first frame
is at an offset > 0.
2010-01-23 15:27:49 +00:00
Stefan Kost 8ebb6be803 typefind: include stdio.h for sscanf 2010-01-22 16:15:54 +02:00
Tim-Philipp Müller 2a84cf0941 typefinding: add PNM typefinder
Add PNM typefinder, so we can remove the one that's in the PNM plugin
in -bad (which btw uses different/wrong media types that don't match
the ones used by gdkpixbufdec) and people don't make fun of us for
loading image decoders when typefinding and playing back audio files.
2010-01-22 02:09:58 +00:00
David Schleef e432c8ebc2 typefind: rewrite h.264 detection
Make detection simpler: check for NALs, check that they make
sense, and report how certain we are that it's a raw H.264 stream.
Fixes: #583376.
2010-01-19 13:37:12 -08:00
Wim Taymans 8d30d92740 typefind: mp4 video is not parsed 2010-01-13 17:36:05 +01:00
Thiago Santos 148d951fbc typefind: Add aac stream-format to caps
Also add the aac stream-format field on the caps when
detecting it.
2010-01-13 12:49:20 -03:00
Edward Hervey c661bfaa99 typefind: Reduce number of calls to gst_type_find_peek.
Shaves off a couple percents off typefinding
2009-11-09 19:18:07 +01:00
Tim-Philipp Müller 37f8957181 typefind: fix typo in previous mxf typefinder change 2009-10-21 20:36:23 +01:00
Edward Hervey d48d47e683 typefind: speed up mxf_type_find over 300 times for worst case scenarios
* memcmp is expensive and was being abused, reduce calling it by checking
  the first byte.
* iterating one byte at at time over 64 kbites introduces a certain overhead,
  therefore we now do it in chunks of 1024 bytes

And I do mean over 300 times. The average instruction call per mxf_type_find
was previously 785685 and it's now down to 2458 :)
2009-10-21 21:04:45 +02:00
David Schleef 1871a6025d typefind: detect 'ftypqt ' as video/quicktime 2009-10-06 12:19:12 -07:00
Tim-Philipp Müller f051514f69 typefinding: disable typefinder for headerless flac
Disable headerless flac typefinder as long as it happily typefinds anything
including /dev/urandom as flac and as long as it's not particularly useful
given that such streams don't really exist in the wild.

Also fix up some comments so that gtk-doc doesn't complain about them.
2009-09-07 17:13:12 +01:00
Wim Taymans f1b209f409 typefind: fix midi typefinding
We already have a audio/midi typefinder so don't override it with the midi in
RIFF typefinder or else we fail to detect plain midi files.
2009-09-04 15:48:06 +02:00
Sebastian Dröge a69ffb5886 typefindfunctions: Add typefinder for Midi inside RIFF
This is a standard Midi file format that should be supported by
all Midi decoders and also has the mimetype audio/mid according to
the Midi specification homepage.

Fixes bug #594094.
2009-09-04 07:36:10 +02:00
Tim-Philipp Müller 4cacc441d8 typefinding: move gio-based xdg mime typefinder from -bad to -base
Its purposes is mainly to avoid false positives (e.g. mp3 typefinder
reporting a 20% probability and somesuch). Won't be registered if
the gio plugin has been disabled via ./configure --disable-gio.
2009-09-03 09:01:47 +01:00
Sebastian Dröge 3c8ff21ba2 typefindfunctions: Detect AVF files as RIFF files too
AVF is valid RIFF but has AVF0 as first fourcc instead of RIFF.

Partially fixes bug #593117.
2009-08-26 09:10:19 +02:00
Sebastian Dröge 3b4c35e319 typefindfunctions: Also detect SVG by the <svg> starting tag
Not all SVG images have the DOCTYPE specified.
2009-08-12 12:11:08 +02:00
Sebastian Dröge 141c3f52cd typefindfunctions: Add typefinders for many game sound console formats supported by gme
These are AY, GBS, GYM, KSS, SAP and VGM. SPC and NSF already had typefinders.
2009-08-07 09:33:34 +02:00
Tim-Philipp Müller 85a08d8dc2 typefinding: fix postscript typefinder probability
Two bytes for a rare format hardly warrants MAXIMUM typefinding
probability, POSSIBLE seems more appropriate.
2009-08-06 09:57:25 +01:00
Sebastian Dröge 76571840ef typefindfunctions: Add SVG typefinder 2009-08-06 06:43:35 +02:00
Sebastian Dröge 5c52513aab typefindfunctions: Add postscript typefinder 2009-08-06 06:43:35 +02:00
Sebastian Dröge 37839ee2b3 typefindfunctions: Use static caps again for MPEG4 typefinding 2009-08-06 06:43:35 +02:00
Arnout Vandecappelle ce24ac4ed0 typefindfunctions: Implement better & more flexible MPEG4 typefinding
This detects more MPEG4 streams as MPEG4.

Fixes bug #556537.
2009-08-06 06:43:35 +02:00
Benjamin Gaignard 2f4c65bb06 typefindfunctions: Fix typefinding of SDP files
Fixes bug #589574.
2009-08-06 06:43:33 +02:00
Tim-Philipp Müller e199d7e1cd typefinding: fix detection of fLaC id packet in broken flac-in-ogg
There are flac-in-ogg files without the usual flac packet framing
and these files just have a 4-byte fLaC ID packet as first packet.
We need to recognise the type just from these four bytes if we
want oggdemux to recognise these streams correctly.
2009-08-01 19:01:39 +01:00
Tim-Philipp Müller 2670f23812 typefind: recognise Kate spu subtitles as well
Recognise spu-subtitles, SUB and K-SPU as valid categories for
Kate subtitles as well.
2009-07-24 09:42:05 +01:00
Tim-Philipp Müller d53e754d42 typefinding: use subtitle/x-kate for Kate subtitle streams and application/x-kate for the rest
Differentiate subtitle streams and lyrics/cracktastic/complex streams via
the category string in the headers. This seems like a useful distinction
to make, and also seems more future-proof. See #525743.
2009-07-13 23:00:04 +01:00
Tim-Philipp Müller 8b94cd3934 typefinding: lower the h264 typefinder's probability
A NEARLY_CERTAIN is absolutely not warranted given the kind
of things it checks for. Even a LIKELY is probably not entirely
appropriate.
2009-06-25 12:09:59 +01:00
Edward Hervey 31e7bf098d typefindfunctions: Fix caps for ogg typefinder. 2009-06-02 09:54:23 +02:00
Arnout Vandecappelle 192a34af40 typefindfunctions: made mp3_type_find less aggressive
mp3_type_find could suggest already when only a single valid header
was found, if it ran out of data before the end of the next frame.
Therefore, ignore the last found frame if it was incomplete.
Fixes bug #579692.
2009-05-12 09:03:22 +02:00
Tim-Philipp Müller 04a860c6f7 typefinding: make flac typefinder return lower probability for frame headers
The flac frame header typefinder overstates the likelihood of a match, leading
to false positives with e.g. aac streams and PDF files. Reduce probabilty
returned from LIKELY to POSSIBLE for the frame header matchin code.
Fixes #574939.
2009-03-15 19:57:36 +00:00
Tim-Philipp Müller a622ff74b0 typefinding: improve image/bmp typefinder
Detect more variations and also bail out in more cases where the values
don't make sense. Furthermore, add width/height and bpp to the caps,
because we can.
2009-03-15 19:52:46 +00:00
Tim-Philipp Müller 4cbe4d2c72 typefinding: flac typefinder fixes
Use scan context for initial peek as well. Peek 6 bytes in the initial
peek rather than 5 bytes, to match the length of the memcmp we're doing
on that data later. Return immediately when we found caps from looking
at the beginning of the data - no point in continuing to scan the next
64kB for something matching a frame header.
2009-03-11 13:33:33 +00:00
Jonathan Matthew db7ecda64f typefind: add photoshop typefind functions
Add photoshop typefind functions.
Fixes #574516.
2009-03-09 16:19:40 +01:00
Edward Hervey 9acf7de5a4 typefind: Use the proper data pointer instead of poking random memory. 2009-03-09 09:08:00 +01:00
Stefan Kost 080493ccff typefind: Make the flac check more tight to not mistace some aac files for flac. Fixes #570356.
Add comments about the flac format. Tighten the check to not allow values that
refer to headers.
2009-02-03 15:28:50 +02:00
Michael Smith 81cc88326f Ensure we have sufficient data when using data scan contexts.
Fixes crashes typefinding things that look like they might contain AAC
data (but probably aren't actually AAC).
2009-01-26 18:02:00 -08:00
Sebastian Dröge 5dfcb63252 Rename files and types from speexresample to audioresample
Rename files and types from speexresample to audioresample
to finish the move and to prevent any confusion.
2009-01-23 12:33:41 +01:00
Wim Taymans cc8b9ae5e8 Add typefind function for gsm
Because core now supports typefindfactories without a typefind function we can
register a factory fo GSM that will --if all else fails-- assume the file is a
GSM file based on the registered extension.
Fixes #566661.
2009-01-23 11:40:26 +01:00
Benjamin Gaignard 336e1346e4 Add typefinder for Mobile XMF. Fixes bug #568707. 2009-01-23 10:19:27 +01:00
Guillaume Emont d477a37e7e gst/typefind/gsttypefindfunctions.c: Add typefinders for MS Word files and OS X .DS_Store files to prevent them to be...
Original commit message from CVS:
Patch by: Guillaume Emont <guillaume at fluendo dot com>
* gst/typefind/gsttypefindfunctions.c: (plugin_init):
Add typefinders for MS Word files and OS X .DS_Store files to
prevent them to be recognized as MPEG files. Fixes bug #564098.
2008-12-11 12:32:03 +00:00
Luis Menina a4493595a6 gst/: Include glib.h instead of a specific GLib header. Including single
Original commit message from CVS:
Patch by: Luis Menina <liberforce at freeside dot fr>
* gst-libs/gst/floatcast/floatcast.h:
* gst/typefind/gsttypefindfunctions.c:
Include glib.h instead of a specific GLib header. Including single
GLib headers is deprecated. Fixes bug #563904.
2008-12-10 08:19:13 +00:00
Jan Schmidt ca161e799f gst/audioresample/gstaudioresample.c: Guard against a NULL dereference I somehow encountered - with a FLUSH_STOP arri...
Original commit message from CVS:
* gst/audioresample/gstaudioresample.c:
Guard against a NULL dereference I somehow encountered -
with a FLUSH_STOP arriving either before basetransform _start(),
or after _stop().
* gst/typefind/gsttypefindfunctions.c:
Make sure we never jump backwards when typefinding corrupt mov files.
2008-11-14 21:44:33 +00:00
Mark Nauwelaerts 23f10c5403 gst/typefind/gsttypefindfunctions.c: Improve typefinding of ISO JPEG2000 mime types.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (jp2_type_find),
(plugin_init):
Improve typefinding of ISO JPEG2000 mime types.
2008-11-13 21:11:13 +00:00
Sebastian Dröge e4e86b0bad gst/typefind/gsttypefindfunctions.c: Improve MXF typefinding a bit by searching for a header partition pack instead o...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (mxf_type_find):
Improve MXF typefinding a bit by searching for a header partition
pack instead of just a general partition pack and checking more
bytes for valid values.
2008-10-20 14:08:52 +00:00
Edward Hervey e68dbb884d gst/typefind/gsttypefindfunctions.c: Don't forget to advance the offset of what we're matching against, else we end u...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (flac_type_find):
Don't forget to advance the offset of what we're matching against, else
we end up in a forever loop.
2008-10-15 14:25:50 +00:00
Sebastian Dröge d0d588ff6f gst/typefind/gsttypefindfunctions.c: For looking at the 4th byte we have to get 4 bytes of course and not 3.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (flac_type_find):
For looking at the 4th byte we have to get 4 bytes of course
and not 3.
2008-10-13 08:00:55 +00:00
Sebastian Dröge 862fd1d50f gst/typefind/gsttypefindfunctions.c: Improve FLAC-without-headers typefinding by looking at most of the frame header ...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (flac_type_find):
Improve FLAC-without-headers typefinding by looking at most of the
frame header and checking if invalid values are used. Should prevent
quite some false positives compared to the old version which only
check if the first 14 bits are set.
2008-10-13 07:52:41 +00:00
Sebastian Dröge 44143f1dcc gst/typefind/gsttypefindfunctions.c: Add typefinder for MXF.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (mxf_type_find),
(plugin_init):
Add typefinder for MXF.
2008-10-05 08:11:53 +00:00
Sebastian Dröge d3edbe7745 gst/typefind/gsttypefindfunctions.c: Add typefinder for MXF.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (mxf_type_find),
(plugin_init):
Add typefinder for MXF.
2008-10-05 08:10:09 +00:00
Tim-Philipp Müller 029f05635d gst/: Recognise Kate subtitle streams (#550582).
Original commit message from CVS:
* gst-libs/gst/pbutils/descriptions.c:
* gst/typefind/gsttypefindfunctions.c:
Recognise Kate subtitle streams (#550582).
2008-09-15 15:11:18 +00:00
Mark Nauwelaerts ec6afbd321 gst/typefind/gsttypefindfunctions.c: Typefind video/mj2 and image/jp2 ISO JPEG2000 mime types.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (plugin_init):
Typefind video/mj2 and image/jp2 ISO JPEG2000 mime types.
Fixes #550638.
2008-09-03 12:23:44 +00:00
Jonathan Matthew 686a893a0f gst/typefind/gsttypefindfunctions.c: Add typefinder for PDF documents (which is nice to have, since it's a common for...
Original commit message from CVS:
Patch by: Jonathan Matthew  <notverysmart gmail com>
* gst/typefind/gsttypefindfunctions.c: (plugin_init):
Add typefinder for PDF documents (which is nice to have, since it's a
common format, but also helps prevent false positives). Fixes #549814.
2008-08-30 15:55:06 +00:00
David Schleef 7cce52603e gst/typefind/gsttypefindfunctions.c: DV typefinding. Remove check for a bit that is 0 in IEC 61384, but not SMPTE 314M.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: DV typefinding.  Remove
check for a bit that is 0 in IEC 61384, but not SMPTE 314M.
Fixes #548065.
2008-08-16 20:57:27 +00:00
Sebastian Dröge 63b89f5625 gst/typefind/gsttypefindfunctions.c: Add simple typefinder for the CELT codec (www.celt-codec.org).
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (celt_type_find),
(plugin_init):
Add simple typefinder for the CELT codec (www.celt-codec.org).
2008-07-28 12:47:06 +00:00
Tim-Philipp Müller 93db55c074 gst/typefind/gsttypefindfunctions.c: Bunch of small clean-ups: use gst_type_find_suggest_simple(); don't copy caps fo...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (aac_type_find),
(mp3_type_find), (musepack_type_find), (MULTIPART_MAX_HEADER_SIZE),
(mpeg_sys_type_find), (mpeg_ts_type_find), (mpeg4_video_type_find),
(h264_video_type_find), (mpeg_video_stream_type_find),
(dv_type_find), (mmsh_type_find):
Bunch of small clean-ups: use gst_type_find_suggest_simple(); don't
copy caps for no good reason (this may be desirable to make it easier
to detect leaks, but then it should probably be done for all caps
in the typefinder somewhere).
2008-06-04 17:12:40 +00:00
Julien Moutte 0f80e462d9 gst/tcp/gstmultifdsink.c: Use IPPROTO_IP instead of SOL_IP, works on more platforms.
Original commit message from CVS:
2008-05-21  Julien Moutte  <julien@fluendo.com>

* gst/tcp/gstmultifdsink.c: (setup_dscp_client): Use IPPROTO_IP
instead of SOL_IP, works on more platforms.
* gst/typefind/gsttypefindfunctions.c: (aac_type_find): Fix printf
arguments.
2008-05-21 16:47:58 +00:00
Tim-Philipp Müller 7cb1276dac gst/typefind/gsttypefindfunctions.c: Use data scan helper in aac typefinder and stop scanning for headers when we've ...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (aac_type_find):
Use data scan helper in aac typefinder and stop scanning
for headers when we've found a type. Also fix potential invalid
memory access when calculating the frame length.
2008-05-19 15:59:40 +00:00
Tim-Philipp Müller cfc8f3c0d7 gst/typefind/gsttypefindfunctions.c: Don't modify scan context when we return FALSE in ensure_data, so it's possible ...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (data_scan_ctx_ensure_data),
(mpeg_sys_is_valid_pack):
Don't modify scan context when we return FALSE in ensure_data, so
it's possible to continue scanning, and we don't end up with a NULL
data pointer and a positive size, which might bite us the next time
we're called. Small constification.
2008-05-19 14:09:08 +00:00
Tim-Philipp Müller fed34307db gst/typefind/gsttypefindfunctions.c: Don't do lots of 4-byte peeks, but use the 'new' data scan helper for this inste...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (h264_video_type_find):
Don't do lots of 4-byte peeks, but use the 'new' data scan helper
for this instead; don't check if we've found enough markers after
each and every step, it's enough to do that only if we've actually
found a new marker.
Embed a G_UNLIKELY into the IS_MPEG_HEADER macro.
2008-05-10 20:16:21 +00:00
Tim-Philipp Müller 104fed4d66 gst/typefind/gsttypefindfunctions.c: Move scan helper thingy to the beginning of the file so we can use it in other t...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c:
(DATA_SCAN_CTX_CHUNK_SIZE), (DataScanCtx), (data_scan_ctx_advance),
(data_scan_ctx_ensure_data), (GST_MPEGVID_TYPEFIND_TRY_SYNC),
(mpeg_video_stream_type_find):
Move scan helper thingy to the beginning of the file so we can use
it in other typefind functions. Rename it to something more
generic. Also improve handling of things towards the end of the
typefind data: peek as much as we can if we know the size of the
data, rather than just min_size.
2008-05-10 18:19:17 +00:00
Edward Hervey 9fa3d7a294 gst/typefind/gsttypefindfunctions.c: Abort the h264 typefinding as soon as _peek() doesn't return anything, which hap...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (h264_video_type_find):
Abort the h264 typefinding as soon as _peek() doesn't return anything,
which happens for example with files smaller than 128kb.
2008-05-08 17:35:44 +00:00
Tim-Philipp Müller 6de5983831 gst/typefind/gsttypefindfunctions.c: Further fine-tuning: don't absolutely require sequence or GOP headers but adjust...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (mpeg_video_stream_type_find):
Further fine-tuning: don't absolutely require sequence or GOP headers
(as introduced in the previous commit), but adjust the typefind
probabilities returned accordingly if we don't see them. Also make sure
picture header and first slice are somewhat close to each other (which
is not perfect but still better than requiring a fixed offset or having
no limit at all).
2008-05-03 12:09:16 +00:00
Tim-Philipp Müller f8977b9e9e gst/typefind/gsttypefindfunctions.c: Rework mpeg video stream typefinding a bit more: make sure sequence,
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c:
(mpeg_video_stream_ctx_ensure_data), (mpeg_video_stream_type_find),
(plugin_init):
Rework mpeg video stream typefinding a bit more: make sure sequence,
GOP, picture and slice headers appear in the order they should and
that we've in fact at least had one of each; fix picture header
detection; decouple picture and slice header check - don't assume
they're at a fixed offset, there may be extra data in between. Also,
announce varying degrees of probability depending on what we found
exactly (multiple pictures, at least one picture, just sequence and
GOP headers). Finally, in _ensure_data(), take into account that we
might be typefinding smaller amounts of data, such as the first
buffer of a stream, so fall back to the minimum size needed as long
as that's available, instead of erroring out if there's less than
2kB of data. Fixes #526173. Conveniently also doesn't recognise the
fuzzed file from #399342 as valid.
2008-04-30 20:54:56 +00:00
Tim-Philipp Müller 5f6db60a4d gst/typefind/gsttypefindfunctions.c: Refactor a bit: use context structure to track parsing offset and size of availa...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (MpegVideoStreamCtx),
(mpeg_video_stream_ctx_advance), (mpeg_video_stream_ctx_ensure_data),
(mpeg_video_stream_type_find):
Refactor a bit: use context structure to track parsing offset and size of
available data and make the code a bit clearer. Fixes bad memory access
in #356937.
2008-04-30 14:37:52 +00:00
Sebastian Dröge 0c73cdcbc8 gst/typefind/gsttypefindfunctions.c: Add "mpp" and "mp+" as possible extensions for MusePack files.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (musepack_type_find),
(plugin_init):
Add "mpp" and "mp+" as possible extensions for MusePack files.
Add typefinding for MusePack StreamVersion 8 files and include the
stream version in the caps.
2008-04-19 20:06:59 +00:00
Sebastian Dröge 6f86b8b8a7 gst/typefind/gsttypefindfunctions.c: Add typefinder for IMelody files, using audio/x-imelody.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (plugin_init):
Add typefinder for IMelody files, using audio/x-imelody.
See bug #519516.
2008-03-03 06:22:39 +00:00
Sebastian Dröge ec7afb6f84 Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_get_type):
* ext/alsa/gstalsasink.c: (set_hwparams):
* ext/alsa/gstalsasrc.c: (set_hwparams):
* ext/gio/gstgio.c: (gst_gio_uri_handler_get_uri):
* ext/ogg/gstoggmux.h:
* ext/ogg/gstogmparse.c:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/fft/kiss_fft_f64.c: (kiss_fft_f64_alloc):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_uri_sink_message_new),
(gst_missing_element_message_new),
(gst_missing_decoder_message_new),
(gst_missing_encoder_message_new):
* gst-libs/gst/rtp/gstbasertppayload.c:
* gst-libs/gst/rtp/gstrtcpbuffer.c:
(gst_rtcp_packet_bye_get_reason):
* gst/audioconvert/gstaudioconvert.c:
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/imgconvert.c:
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/typefind/gsttypefindfunctions.c:
* gst/videoscale/vs_4tap.c:
* gst/videoscale/vs_4tap.h:
* sys/v4l/gstv4lelement.c:
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_get_any_caps):
* sys/v4l/v4l_calls.c:
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_capture_init),
(gst_v4lsrc_try_capture):
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new):
* tests/check/elements/audioconvert.c:
* tests/check/elements/audioresample.c:
(fail_unless_perfect_stream):
* tests/check/elements/audiotestsrc.c: (setup_audiotestsrc):
* tests/check/elements/decodebin.c:
* tests/check/elements/gdpdepay.c: (setup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (setup_gdppay), (GST_START_TEST),
(setup_gdppay_streamheader):
* tests/check/elements/gnomevfssink.c: (setup_gnomevfssink):
* tests/check/elements/multifdsink.c: (setup_multifdsink):
* tests/check/elements/textoverlay.c:
* tests/check/elements/videorate.c: (setup_videorate):
* tests/check/elements/videotestsrc.c: (setup_videotestsrc):
* tests/check/elements/volume.c: (setup_volume):
* tests/check/elements/vorbisdec.c: (setup_vorbisdec):
* tests/check/elements/vorbistag.c:
* tests/check/generic/clock-selection.c:
* tests/check/generic/states.c: (setup), (teardown):
* tests/check/libs/cddabasesrc.c:
* tests/check/libs/video.c:
* tests/check/pipelines/gio.c:
* tests/check/pipelines/oggmux.c:
* tests/check/pipelines/simple-launch-lines.c:
(simple_launch_lines_suite):
* tests/check/pipelines/streamheader.c:
* tests/check/pipelines/theoraenc.c:
* tests/check/pipelines/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c:
* tests/examples/seek/scrubby.c:
* tests/examples/seek/seek.c: (query_positions_elems),
(query_positions_pads):
* tests/icles/stress-xoverlay.c: (myclock):
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers and using "foo (void)" instead
of "foo ()" for declarations.
* win32/common/libgstrtp.def:
Add gst_rtp_buffer_set_extension_data to the symbol definition file.
2008-03-03 06:04:31 +00:00
Sebastian Dröge 929afcbaa1 gst/typefind/gsttypefindfunctions.c: Comment smoke typefinder for now. The smokedec plugin needs one frame per buffer...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (plugin_init):
Comment smoke typefinder for now. The smokedec plugin needs one
frame per buffer but we have no parser yet, thus it simply crashes
in most situations.
2008-02-25 07:21:33 +00:00
Sebastian Dröge 9327c2a8ec gst/typefind/gsttypefindfunctions.c: Add typefinder for the smoke video codec. Copied from the jpeg plugin.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (plugin_init):
Add typefinder for the smoke video codec. Copied from the jpeg plugin.
2008-02-25 06:48:14 +00:00
Sebastian Dröge 49e1c708bb gst/typefind/gsttypefindfunctions.c: Add midi typefinder, copied from the timidity plugin.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (mid_type_find),
(plugin_init):
Add midi typefinder, copied from the timidity plugin.
2008-02-25 06:29:09 +00:00
Josep Torra Valles 51528422ca gst/typefind/gsttypefindfunctions.c: Increase the MPEG PS typefind lookup to fix typefinding on HD clips.
Original commit message from CVS:
2008-02-19  Julien Moutte  <julien@fluendo.com>

Patch by: Josep Torra Valles <josep@fluendo.com>

* gst/typefind/gsttypefindfunctions.c: Increase the MPEG PS
typefind lookup to fix typefinding on HD clips.
2008-02-19 16:16:55 +00:00
Josep Torra Valles 58a9fd3622 gst/typefind/gsttypefindfunctions.c: Add typefinding support for h264 elementary streams.
Original commit message from CVS:
Patch by: Josep Torra Valles <josep at fluendo dot com>
* gst/typefind/gsttypefindfunctions.c: (h264_video_type_find),
(plugin_init):
Add typefinding support for h264 elementary streams.
Fixes bug #517420.
2008-02-19 11:45:56 +00:00
Tim-Philipp Müller cfe66ed251 gst/typefind/gsttypefindfunctions.c: Bump rank of jpeg and png typefinders, which will return maximum probability in ...
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c:
Bump rank of jpeg and png typefinders, which will return maximum
probability in the most common cases (thus short-circuiting more
expensive typefinders like the mp3 one for these two quite common
image types).
2008-02-11 13:03:13 +00:00
Wim Taymans 818434b664 gst/typefind/gsttypefindfunctions.c: Add typefind function for application/sdp.
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (utf8_type_find),
(sdp_check_header), (sdp_type_find), (plugin_init):
Add typefind function for application/sdp.
Remove some old dirac typefind code that was ifdeffed out.
2007-10-01 10:22:46 +00:00