Commit graph

321 commits

Author SHA1 Message Date
Tim-Philipp Müller 8a34abff64 ffmpegdec: disable parser for already-parsed FLAC input
Not needed to make anything work, just seems to make sense.

https://bugzilla.gnome.org/show_bug.cgi?id=589361
2011-09-26 19:55:54 +01:00
Nicolas Dufresne eacf516f7f ffdec: Blacklist non-working subtitle decoders
This include decoder for ASS, SRT, PGS, DVD and DVB. Those are generated
with bad capabilities and are not usable in GStreamer. Other elements exist
to handle those subtitle formats.

https://bugzilla.gnome.org/show_bug.cgi?id=658019
2011-09-03 12:32:55 +01:00
Edward Hervey 2f63830924 ffmpegdec: Set default number of threads to 1
Too many suspicious errors/warnings pop up when more than 1 thread
is used.

Fixes #653649
2011-07-11 10:47:26 +02:00
Edward Hervey 37f5d70332 ffmpegdec: Setting AC3/EAC3/DTS decoders to rank NONE for release
This still causes issues with bad (missing?) downmixing.

They can be handled by existing a52dec/dtsdec

See Bug #608892
2011-06-30 21:38:57 +02:00
Mark Nauwelaerts 856dbe6f21 ffmpegdec: avoid allocating and leaking local avpacket helpers
... by _init'ing them as locals rather than _new'ing them.

Fixes #653648.
2011-06-30 11:49:39 +02:00
Jan Schmidt 3a12092ae6 Enable threading in ffmpeg decoders that support it.
Add a max-threads property, which defaults to '0 = auto'
Add a utility function taken from libschroedinger which sets
the ffmpeg worker thread count to match the computer processor
count by default.
2011-06-21 14:33:29 +10:00
Raimo Järvi 8e2404b8df ffdec: Fix calculating frame duration from last timestamp and frame count.
Fixes bug #651714.
2011-06-06 14:45:56 +02:00
Raimo Järvi 4a66ecdf25 ffdec: Check for AV_NOPTS_VALUE in PTS value.
https://bugzilla.gnome.org/show_bug.cgi?id=651625
2011-06-01 16:11:05 +02:00
Edward Hervey 9db205f9f7 ffmpegdec: Don't discard timestamps if output AND input are in order
Avoids bogus timestamps for AVCHD-lite streams
2011-05-29 20:09:47 +02:00
Sebastian Dröge b8f7aab1ba ffdec: Always use parser for AAC LATM/LOAS 2011-05-26 15:09:18 +02:00
Rafael Diniz df40381a83 ffmpeg: Add codec mapping for AAC LATM/LOAS
Also add the stream-format fields to the CODEC_ID_AAC caps.

Fixes bug #650695.
2011-05-25 10:10:48 +02:00
Thadeu Lima de Souza Cascardo a3c56f60cd ffdec: Do not use invalid input timestamp as next timestamp.
When input buffer timestamps are invalid, next timestamp are used for
audio. Then, the next out timestamp is updated with the used timestamp
and the calculated duration. However, if the used timestamp is invalid,
it should not be used. Otherwise, the next buffer will use a wrong
timestamp that is not in the clipped segment, making the buffer to be
dropped.

This fixes playback with SBTVD MPEG TS streams, using AAC LATM.
2011-05-09 11:02:50 +02:00
Vincent Penquerc'h 920bfb0da2 ffdec: do not try to resync to the next keyframe when late
A keyframe may be quite a while in the future, and the decoder
has no way of knowing this. A poor decision could mean quite some
time with no video output.
This decision should be left to the upstream element: a demuxer
might know about incoming keyframes, or some other element might
be able to request a keyframe.

Fixes bug #649372.
2011-05-06 13:23:45 +02:00
Edward Hervey a30b434b53 ffmpegdec: Set caps on outgoing audio buffers 2011-04-21 20:56:45 +02:00
Edward Hervey fe1a971b31 ffmpegdec: Use new AVPacket-based API
Right now it doesn't use any of the extra fields AVPacket provides.
It might be wise to investigate the pts/dts ones to see if we can finally
get rid of the timing-related cruft we have.
2011-04-21 20:56:45 +02:00
Edward Hervey 436a211aff gstffmpegdec: Use non-deprecated av_parser_parse2 2011-04-21 20:56:45 +02:00
Edward Hervey 7c85e2d743 ffmpegdec: Use skip_frame instead of deprecated hurry_up 2011-04-21 20:56:45 +02:00
Edward Hervey 2f81d0d63b ffmpeg: CodecType => AVMediaType 2011-04-21 20:56:44 +02:00
Marc Plano-Lesay 9c42b7cae9 Fix unused-but-set-variable warnings with gcc 4.6 2011-04-19 16:21:20 +01:00
Wim Taymans 6444bd2557 dec: avoid making the buffer writable
Set the caps right after allocation of the buffer because we know the buffer is
writable then and we are correctly negotiated. Since ffmpeg keeps around
references to frames, making the buffer metadata writable where it was done
before pushing will always end up with a copy and that makes the sink do a slow
memcpy all the time.
2011-04-07 12:34:51 +02:00
Miguel Angel Cabrera Moya f63d36ade8 ffmpegdec: do buffer padding before parsing and before decoding
FFMpeg parsing and decoding calls require to additionally allocate bytes
at the end of the input bitstream and this padding must be initialized
to zero.

https://bugzilla.gnome.org/show_bug.cgi?id=595590
2011-04-05 14:14:38 +02:00
Tim-Philipp Müller 8d40c6357d ffmpegdec: improve error message when set_caps is called but we have no mapping
This may happen e.g. if gst-ffmpeg is compiled against an external
libavcodec and the external lib is upgraded.

See e.g.
https://bugzilla.gnome.org/show_bug.cgi?id=640825
2011-01-31 23:28:33 +00:00
Edward Hervey 2de5aaf22d ffmpegdec: Set the mp3 decoder to a rank of NONE
It's just causing too many headaches. This will force people to use
a working mp3 decoder, like mad.
2011-01-07 18:08:15 +01:00
Edward Hervey 051e2de3d3 ffmpegdec: Fix unitialized variables on macosx 2011-01-05 16:59:55 +01:00
Wim Taymans 22d44c87b1 ffmpgdec: work around parser timestamp bug
Sometimes the parser loses track of timestamps and starts to reuse old
timestamp. Feed it some dummy data and clear some context variables to work
around the problem.
2010-12-21 12:14:22 +01:00
Wim Taymans ec48b24291 dec: scale the estimated duration by number of frames
When estimating the frame duration, the diff between two incomming timestamps
should be scaled by the amount of frames in the interval. Improves duration
estimation and DTS interpolation.
2010-12-12 12:38:55 +01:00
Wim Taymans 957c728b3d dec: use input timestamp diff for duration estimation
Use the diff between input timestamps to estimate the duration when no duration
is set on input buffers. Only do this when there are no reordered input
timestamps. Improves interpolation in DTS mode when no input duration is set.
2010-12-12 11:20:22 +01:00
Wim Taymans d82633c4e3 ffdec: don't destroy the parser state
When we flush the parser cache, we only need to clear the bytes of the cache,
not the complete state of the cache. In the case of H264 this doesn't require
the parser to receive a new SPS/PPS after a DISCONT buffer.
2010-10-22 13:05:16 +02:00
Wim Taymans cc2a6e493b ffdec: be more careful with DTS timestamp interpolation
Don't use -1 and 0 duration buffers to calculate next output timestamp as they
are very likely wrong.

Fixes #632877
2010-10-22 13:05:16 +02:00
Edward Hervey 51a0e1270f ffmpegdec: Fix debug statements 2010-10-12 16:17:51 +02:00
Wim Taymans 3f213c1b73 ffdec: use a better algorithm to detect DTS timestamps
Add function to reset the timestamp tracking.
Check for reordered timestamps on the input buffers and assume PTS input
timestamps when we see reordered timestamps.
Recover from an occasionally wrong input timestamp by also tracking the output
timestamps. When we detect a reordered output timestamp, assume DTS input
timestamps again.

Fixes #611500
2010-10-07 17:46:22 +02:00
Wim Taymans a0bc6f6e9d ffdec: add debug line 2010-10-06 18:51:24 +02:00
Wim Taymans 48e612afda ffdec: add fixmes 2010-10-06 18:23:57 +02:00
Wim Taymans b41aab3690 ffdec: add some comments 2010-10-06 18:15:03 +02:00
Wim Taymans 76d9685202 ffdec: Add timestamp tracking
Use ffmpeg reordered_opaque to track an id that combines all timing info we have
for a frame. The ids are kept in a 255 item cache.

Fixes #631075
2010-10-06 17:42:30 +02:00
Wim Taymans edb79396f2 ffdec: remove broken TSHandler
Remove the TShandler code, it is broken when QoS is enabled and ffmpeg provides
much easier methods for tracking timestamps.
Simplify pcache joining.
2010-10-06 17:42:30 +02:00
Wim Taymans c330cdcc5d ffdec: rename time variable
Rename the time variable to avoid confusion with the time function.
Add some debug to the QoS update function.
2010-10-06 16:58:40 +02:00
Zaheer Abbas Merali 22a343207c ffmpegdec: fix typo in comment 2010-06-04 18:30:59 +01:00
Edward Hervey 2fccd4640f ffmpegdec/enc: Blacklist more raw formats 2010-05-31 18:44:02 +02:00
Tim-Philipp Müller dc2efe2d24 ffmpegdec: sipro decoder should have higher rank than realaudiodec 2010-05-25 12:55:14 +01:00
Edward Hervey f9c2467241 ffmpegdec: Don't leak the GstDataPassThrough items 2010-05-17 19:43:24 +02:00
Sebastian Dröge 2e079b742a ffmpeg: Use gst_element_set_details_simple() 2010-03-24 11:51:53 +01:00
Raimo Järvi 9637ff5ab1 ffdec: Update caps if the aspect ratio changes
Fixes bug #613231.
2010-03-18 14:08:51 +01:00
Thiago Santos b234d0b308 ffdec: Make metadata writable before setting caps
In case we haven't created the output buffer, we should make
metadata writable before setting caps on it.
Fixes check unit tests.
2010-03-11 10:13:46 -03:00
Thiago Santos c300a0a9f2 ffdec_aac: Do not parse raw format
If the stream is 'raw' format, do not use parsers.
Re-enables the aac decoder by putting it back to default
ffdec rank.

Fixes #566250
2010-03-11 09:55:49 -03:00
Edward Hervey d4e63b2727 gstffmpegdec: Disable direct-rendering for svq1/vp56 decoders.
They use a non-standard stride which we can't support.

Fixes #610613
2010-03-03 19:03:19 +01:00
Edward Hervey bb2acca229 gstffmpegdec: Handle durations in reordered frames
The buffer durations were not being reordered along with the timestamp
and offset of the buffers, resulting in buffers using the duration of the
latest incoming frame instead of their original frame.

Fixes #611398
2010-03-01 12:52:19 +01:00
Mark Nauwelaerts 6cf7cadf9b ffmpegdec: do not store timestamp for buffer that will be skipped
Fixes #610481.
2010-02-19 20:33:06 +01:00
Edward Hervey cc4d502d30 gstffmpegdec: Don't enable xvmc decoders, we can't support the output 2010-02-18 13:29:35 +01:00
Wim Taymans 14e8ce8816 ffmpegdec: only clip to a smaller region
When we have an input width/height that should be used for clipping, only
perform the clipping if the rectangle is smaller than the actual picture size.

Fixes #330681
2010-02-04 13:28:11 +01:00