Commit graph

39 commits

Author SHA1 Message Date
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
Jan Schmidt c977aa2c01 videodecoder: Rename queued list to output_queued for clarity.
Use g_list_free_full instead of g_list_foreach + g_list_free
2012-06-20 01:32:05 +10:00
Jan Schmidt 487e5348e0 videodecoder: Small cleanups
Remove extra deref using a local var, and add/change some doc comments
and debug statements
2012-06-20 01:32:05 +10:00
Jan Schmidt 2d770ac406 videodecoder: Rename gst_video_decoder_have_frame_2 function
Rename gst_video_decoder_have_frame_2 to
gst_video_decoder_decode_frame and pass the frame to process
directly, rather than using the current_frame pointer as a holding
pen.

Move the negative rate handling out of the function to where it
is needed, and remove the process flag.
2012-06-20 01:32:05 +10:00
Jan Schmidt ca09aaabc7 videodecoder: Extend docs and add comments
Update the documentation block for the base class, and add a comment
block about the reverse-playback logic and implementation.
2012-06-20 01:32:03 +10:00
Edward Hervey 4b946e8cee videodecoder: Ensure buffers don't disappear early
The frames are the owners of the buffers. In cases where a decoder
would keep around reference frames, we need to ensure they don't
disappear early.
To handle this, we pass downstream a complete sub-buffer of the output
buffer, ensuring that the buffer will only be released when downstream
is done with it *AND* the frame is no longer used.

Conflicts:

	gst-libs/gst/video/gstvideodecoder.c
2012-06-19 09:33:03 +01:00
Sebastian Dröge 4119246081 videoencoder,videodecoder: Return new references from _get_frame() 2012-06-19 09:26:36 +01:00
Sebastian Dröge 1e635f682f videodecoder: Add GstVideoDecoder::propose_allocation() vfunc 2012-06-15 16:38:16 +02:00
Jan Schmidt f865729e95 videodecoder: Fix initial timestamp in ogg, and a warning.
Don't replace the initial frame's timestamp with a bogus
one calculated from the (incorrect for Ogg) frame number just
because the 'sync time' hasn't changed.

Also, don't output a bogus warning about the output_frame being
NULL when it's being dropped/skipped due to QoS.
2012-06-13 01:58:05 +10:00
Vincent Penquerc'h 8b10be67e4 videodecoder: use GST_CLOCK_TIME_IS_VALID where appropriate 2012-06-08 13:59:53 +01:00
Vincent Penquerc'h d7ee6a9c57 videodecoder: do not do timestamp arithmetic from an invalid timestamp
This fixes untimestampped buffers from being rejected by the segment clipper.

https://bugzilla.gnome.org/show_bug.cgi?id=676022
2012-06-07 16:59:09 +01:00
Wim Taymans d923f9fe70 videodecoder: only copy known colorimetry values
Avoid overriding the default colorimetry values.
2012-06-04 18:17:42 +02:00
Matej Knopp e316ff5435 videodecoder: Do not unref frame if not in the list 2012-06-04 10:43:56 +02:00
Raimo Järvi d42a197c04 video: Fix printf format warnings on mingw-w64
https://bugzilla.gnome.org/show_bug.cgi?id=676442
2012-05-24 10:57:21 +02:00
Sreerenj Balachandran 38a2fe673e videodecoder: improve doc 2012-05-23 10:16:25 +02:00
Tim-Philipp Müller c1bc70300d docs: fix up video decoder/encoder docs a bit
Makes gtk-doc happy.
2012-05-16 12:40:07 +01:00
Sebastian Dröge ecd061e48c videodecoder: Also change gst_video_decoder_get_oldest_frame() to return a new reference 2012-05-01 16:59:10 +02:00
Edward Hervey 8217575af1 videodecoder: Add a reference to frame passed to subclass
We have one reference owned by the internal frame list and one reference
passed to the subclass.
2012-05-01 16:58:55 +02:00
Wim Taymans 34bfcb2af9 videodecoder: don't leak events
When need to push out all the previously received events, concatenate all the
events from the previous frames (instead of leaking the old ones)
Improve debugging a little

Conflicts:

	gst-libs/gst/video/gstvideodecoder.c
2012-05-01 16:58:48 +02:00
Wim Taymans 8fde7850c0 videodecoder: don't leak frames
Frames receive a refcount when added to the frames list so release that refcount
in gst_video_decoder_do_finish_frame(). Also release the ref on the frame
because gst_video_decoder_do_finish_frame() takes ownership of the passed frame.
2012-05-01 15:03:40 +02:00
Wim Taymans e8c7f57a0a videodecoder: avoid double unlock 2012-05-01 15:03:21 +02:00
Sebastian Dröge cb04d8e003 videodecoder: Do bufferpool configuration inside the default decide_allocation() implementation
This allows subclasses to override it, as is necessary for e.g. the
video-crop meta. It is now necessary that after decide_allocation()
there is always a allocator and a configured buffer pool inside the
query.
2012-05-01 13:33:20 +02:00
Sebastian Dröge f9facc6a4a video: Remove interlaced handling from the video base classes
This must be handled by the subclasses in 0.11 because interlacing
is much more complex now and can't be handled in a generic way.
2012-04-25 18:21:03 +02:00
Wim Taymans 777d044357 videodec: remove some FIXMEs 2012-04-25 14:57:40 +02:00
Sebastian Dröge bcef106f73 video: Fix latency query handling if the element's own max_latency is GST_CLOCK_TIME_NONE 2012-04-25 13:53:29 +02:00
Sebastian Dröge 7c165187af videodecoder: Change configure_buffer_pool() vfunc to decide_allocation() with same semantics as in basetransform 2012-04-25 13:19:11 +02:00
Sebastian Dröge 1483997207 videodecoder: Add support for subclasses to configure the buffer pool 2012-04-24 22:35:29 +02:00
Sebastian Dröge a8c40a658c video: Some porting bugfixes 2012-04-24 21:32:08 +02:00
Sebastian Dröge b945c01549 videodecoder: Add minimal support for buffer pools 2012-04-24 20:04:48 +02:00
Sebastian Dröge 63563e3d5e videodecoder: Require to chain up to the parent classes event functions 2012-04-24 19:51:30 +02:00
Sebastian Dröge f7bc9cc5ba video: Initial port of video base classes and related things to 0.11 2012-04-24 19:35:24 +02:00
Edward Hervey a744c98985 videodecoder: Detect buffers inputted with DTS
Some container formats (like AVI) set DTS on the buffers instead of
PTS.
We detect this by:
* detecting if input timestamps are non-increasing
* detecting if the order the frames come out is the same as the order
  they were inputted (meaning the implementation is reordering frames).

If the decoder reorders frames, but input buffer timestamps were not
reordered, that means the buffers has DTS and not PTS as their timestamp.
If this is the case, we use set the PTS of the outgoing frames in the
same order as they were given to the decoder.

This fixes the issue for any decoder using this base class (yay).
2012-04-24 17:03:40 +02:00
Edward Hervey f6cfd763e4 video: Base classes for video decoders and encoders 2012-04-24 17:03:40 +02:00