Commit graph

82 commits

Author SHA1 Message Date
Sebastian Dröge d697dd6d39 videodecoder: Reset the error count to 0 after successfully decoding a frame 2012-11-09 16:47:37 +01:00
Tim-Philipp Müller 5f59b4f7ee Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 23:05:09 +00:00
Sreerenj Balachandran f816f94995 videodecoder: fix inappropriate compiler optimization hint macro usage
https://bugzilla.gnome.org/show_bug.cgi?id=679456
2012-10-28 23:09:36 +00:00
Tim-Philipp Müller 6c0c3eb967 videodecoder: don't leak message strings when error is not fatal 2012-10-20 11:37:33 +01:00
Tim-Philipp Müller efff57d497 videodecoder: return NULL from _allocate_output_buffer() if alloc fails
.. instead of garbage pointer. Also log failure in debug log.
Should've returned the flow return like _allocate_output_frame().

https://bugzilla.gnome.org/show_bug.cgi?id=683098
2012-10-17 10:55:01 +01:00
Mark Nauwelaerts 706498cb6e videodecoder: finetune missing timestamp estimating
Monitor for reordered output timestamps, and then avoid oldest DTS
as PTS approach, and try for an oldest PTS as out PTS approach,
if at least all valid PTS available.

Avoids bogus estimating upon sparse available input PTS, and tries
to handle all-keyframe input, or input PTS which are actually DTS.
2012-10-10 15:04:10 +02:00
Sebastian Dröge 9d59b789c7 videodecoder: Fix unused variable compiler warning if debugging is disabled 2012-10-02 09:29:49 +02:00
Olivier Crête 531a5af30c videodecoder: Also use the object lock to protect the output_state
Hold both the stream and the object lock to modify the output_state,
this way it can be safely modified while hold either one or the other.

Also, only hold the object lock in the query

https://bugzilla.gnome.org/show_bug.cgi?id=684832
2012-10-01 14:43:29 -04:00
Mark Nauwelaerts 4adfff03ef video{de,en}coder: fix missing timestamp estimating
... by having some more timestamp tracking in a private frame field.
Not doing so would lead to (a.o.) losing the needed minimum timestamp in
an earlier sent frame.
2012-09-28 13:59:24 +02:00
Mark Nauwelaerts dc2f2c9a40 videodecoder: use oldest frame DTS to estimate missing outgoing PTS 2012-09-27 11:31:34 +02:00
Tim-Philipp Müller 62c111f1e4 videodecoder: don't take STREAM_LOCK on upstream events
Don't try to take STREAM_LOCK on upstream events such as QOS.
Protect qos-related variables with object lock instead. Fixes
possible deadlock when shutting down in certain situations.

https://bugzilla.gnome.org/show_bug.cgi?id=684658
2012-09-24 10:56:35 +01:00
Sebastian Dröge 1e8f5a0b06 videodecoder: Update comments about forwarding/not-forwarding serialized events immediately 2012-09-20 10:04:30 +02:00
Olivier Crête ebae8ffa71 videodecoder: Protect all accesses to priv->output_frame with the stream lock
Fixes segfault as queries/events can happen after a reset
2012-09-19 21:16:01 -04:00
Jan Schmidt 6159817c95 videodecoder: Handle GAP events
Drain out the decoder when encountering a gap. Needed for DVD 'still'
sequences which consist of a single video frame, and a large gap
while audio plays.
2012-09-12 23:07:29 -07:00
Jan Schmidt 52cfce851a Fix still-frame handling.
Still frame events are not OOB downstream. Also, always send
immediately downstream.
2012-09-12 23:07:28 -07:00
Jan Schmidt 041c16b47d On a still-frame begin message, drain out the decoder and send it.
Fixes still frame handling on DVDs
2012-09-02 23:19:09 -07:00
Jan Schmidt acadc94279 Revert "videodecoder: Send serialised events immediately, after we're pre-rolled."
This reverts commit ef5316fbb0.
2012-09-02 22:59:58 -07:00
Jan Schmidt ef5316fbb0 videodecoder: Send serialised events immediately, after we're pre-rolled.
Only hold back events until the first buffer is generated, then just
send them directly. Otherwise, important events like 'still-frame' are
held forever, waiting for a frame that'll never arrive.
2012-08-31 12:40:36 -07:00
Mark Nauwelaerts 9262e00007 videodecoder: parsing loop must ensure for a current frame 2012-08-28 14:31:06 +02:00
Sebastian Dröge bdc056c12d video: Add methods to return a list of all pending GstVideoCodecFrames 2012-08-16 12:13:25 +02:00
Víctor Manuel Jáquez Leal efe9e31b34 videodecoder: getters for pool and allocator
Sometimes the decoder would need to use the pool or the allocator for
something else than just allocating output buffers. For example, the querying
for different parameters, such as asking for a bigger number of buffers to
allocate in the pool.

This patch expose a two getters accessors: one for the buffer pool and the
other for the memory allocator.
2012-08-14 15:47:04 +02:00
Tim-Philipp Müller d1299d1357 videodecoder: fix seeking again
Add missing break in FLUSH_STOP case.
2012-08-09 19:57:49 +01:00
Sebastian Dröge b141bfed60 video: Merge upstream stream tags 2012-08-09 16:24:24 +02:00
Sebastian Dröge 9ffb579b75 videodecoder: Add API to conveniently handle tags 2012-08-09 16:02:42 +02:00
Sebastian Dröge 7cb22ef241 videodecoder: Add negotiate vfunc that is used to negotiate with downstream
The default implementation negotiates a buffer pool and allocator
with downstream.
2012-08-09 14:47:46 +02:00
Wim Taymans 683a38ad65 update for new variable names 2012-07-27 15:24:43 +02:00
Edward Hervey 6423a4027e video: Make all frame_number guint32
Unifies the code and ensures that:
* subclasses needing to use the frame_number on a void* field will
  always work
* wraparounds will be automatically taken care of if we have to deal
  with more than 2**32 frames
2012-07-26 18:38:42 +02:00
Mark Nauwelaerts 7b135e8810 video{de,en}coder: delay input caps processing until processing data
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=680614
2012-07-26 14:35:45 +02:00
Sebastian Dröge df08e333d2 video: Correct usage of the base class stream lock
And also renegotiate if the srcpad requires reconfiguration
2012-07-23 11:50:11 +02:00
Sebastian Dröge 1645ea4a90 video: Rename alloc_output_buffer() to allocate_output_buffer() 2012-07-23 10:18:41 +02:00
Edward Hervey 8feaebb6eb videodecoder: Expose _negotiate function
This is to be called by decoders once they have set the output format
in order for (re)negotiation to be triggered as early as possible.

https://bugzilla.gnome.org/show_bug.cgi?id=679878
2012-07-18 18:17:57 +02:00
Edward Hervey 2817bdadc9 libs: Remove "Since" markers and minor doc fixups 2012-07-13 12:11:06 +02:00
Wim Taymans 0dd87d7eb7 fix for allocator API changes 2012-07-09 16:28:25 +02:00
Sebastian Dröge 9002471c93 video: Document buffer ownership of the GstVideoCodecFrame more explicit
And also the implications of calling the finish() functions.
2012-07-05 14:29:42 +02:00
Sebastian Dröge 7803ae97e9 videodecoder: Make sure the buffer is writable before changing fields in finish_frame() too
We can't be sure that we have the one and only reference here either.
2012-07-05 13:38:48 +02:00
Sebastian Dröge 8e15a2c28d videodecoder: Create a complete subbuffer before pushing
Otherwise we can't be sure that we are allowed to change the
buffer fields later for clipping.
2012-07-05 13:37:37 +02:00
Wim Taymans 676375ecfe videodec: add some assert 2012-07-04 09:15:26 +02:00
Wim Taymans c7cfb66467 videodec: clear the right variable 2012-07-04 09:15:26 +02:00
Wim Taymans c68683c15f videodecoder: avoid crash when getting duration
Check that we have a valid output_state before attempting to use it to calculate
the duration of a buffer. It is possible that we don't have a state yet, for
example when we are dropping the first buffers.
2012-06-27 16:56:22 +02:00
Sebastian Dröge 43e94eea98 videodecoder: Use GSlice to allocate the timestamp tracking structures 2012-06-27 16:42:10 +02:00
Wim Taymans 3327d13f1b videodecoder: small cleanups 2012-06-27 14:13:02 +02:00
Wim Taymans 9f591a0bd1 videodecoder: improve PTS and DTS handling
Also keep track of the DTS and use it to set PTS on keyframes.
Set DTS on outgoing buffers.
2012-06-27 13:48:58 +02:00
Jan Schmidt 1718697ae2 videodecoder: Don't leak a ref to frames in reverse playback 2012-06-26 22:26:57 +10:00
Jan Schmidt b7759a4d42 videodecoder: Don't give out bogus frame deadlines
Make sure the frame deadline was set before calculating the
max_decode_time. Fixes problems with ffmpeg skipping frames when
it doesn't need to, when the input doesn't have full timestamping
(divx in avi)
2012-06-20 03:45:14 +10:00
Jan Schmidt 9a79a145b1 videodecoder: Remove gst_video_decoder_get_timestamp function
Interpolating the timestamps from the picture numbers
does more harm than good, getting it wrong in a lot of
cases (especially reverse playback). Removing it in favour
of simply incrementing the timestamps until there's
something better
2012-06-20 03:40:29 +10:00
Jan Schmidt 45cf9f651b videodecoder: EOS handling for reverse mode.
Handle EOS correctly in reverse mode by treating it
as a final discont and flushing out whatever we can.
2012-06-20 01:43:36 +10:00
Jan Schmidt 6718f0cfff videodecoder: misc improvements/changes
Use g_list_free_full instead of walking lists twice when freeing
them.

Remove pointless clause in gst_video_decoder_chain that doesn't
actually have any effect.

Other changes to make the code slightly more like the 0.11
version.
2012-06-20 01:43:31 +10:00
Jan Schmidt ffd0f28460 videodecoder: Improve timestamp handling.
Fix problems with timestamp calculations when the incoming
buffers have sparse timestamps (as for theora) and reverse
playback. Fixes #675773
2012-06-20 01:43:26 +10:00
Jan Schmidt 1935cf0022 videodecoder: Re-work reverse playback handling
Move processing of the gather list into the flush_parse function.

Add a last ditch attempt to apply timestamps to outgoing buffers
when walking backwards through decoded frames. Requires that each
gathered region has at least one timestamp.

Make sure to remove decoded packets from the decode list when
they are sent - otherwise the list just grows on each cycle, with
more and more frames being decoded and then clipped away.

Break out of the processing loop early on a bad flow return to make
seeking more responsive.

Use the gst_video_decoder_clip_and_push_buf function in reverse
mode, instead of pushing all buffers arbitrarily.

A couple of small efficiency gains in the list handling, by moving
list elements directly and not reallocating, and by reversing
and concatenating the gather list instead of moving it one node
at a time.

Rename the gst_video_decoder_do_finish_frame function to
gst_video_decoder_release_frame.
2012-06-20 01:34:44 +10:00
Jan Schmidt 5dc7d4ea3a videodecoder: Split gst_video_decoder_finish_frame
Split the 2nd half of the gst_video_decoder_finish_frame function
out to gst_video_decoder_clip_and_push_buf.
2012-06-20 01:32:05 +10:00