Commit graph

82 commits

Author SHA1 Message Date
Thiago Santos f24075887f videodecoder: implement caps query
Refactor the encoder's caps query proxying function to a common place
and use it in the videodecoder to proxy downstream restrictions.

The new function is private to the gstvideo lib.

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Matej Knopp 9d349d8831 videoencoder: don't complain about PTS != DTS on keyframes
It is valid for streams with b-frames

https://bugzilla.gnome.org/show_bug.cgi?id=740556
2014-11-22 16:12:16 -05:00
Sebastian Dröge 7b428a8bcb videoencoder: Stop storing if we received EOS
This was never reset when going from PAUSED->READY and resulted
in encoders being not reusable after EOS. They just rejected any
buffer because they received EOS in their previous life.

The flag wasn't used anywhere except for rejecting buffers after
EOS, and this is now handled by GstPad directly.
2014-10-04 23:09:19 +03:00
Aurélien Zanelli 9297fe9ba0 videoencoder: release frame in finish_frame when no output state is configured
Otherwise, frame is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=737706
2014-10-01 12:53:45 +03:00
Stefan Sauer cabe5746fb videoencoder: log the timestamps if we are unhappy about them
When complaining about the DTS!=PTS on keyframes log the actualy timestamps.
2014-09-22 20:16:31 +02:00
Ognyan Tonchev d8260cdb89 videoencoder: do not leak events when flushing them
https://bugzilla.gnome.org/show_bug.cgi?id=736796
2014-09-18 12:40:08 +03:00
Nicolas Dufresne ce50fc221e videoencoder: Don't delay set_format
This prevent implementing allocation query, as the format need to be
known in order to determin the size and number of buffers needed.

Note: This may lead to few regressions that will need fixing

https://bugzilla.gnome.org/show_bug.cgi?id=732288
2014-07-25 14:12:02 -04:00
Thibault Saunier 2843f358d9 videoencoder: Keep still meaningfull pending events on FLUSH_STOP
Only EOS and segment should be deleted in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=709868
2014-06-03 13:03:19 +02:00
Thiago Santos da54836a33 videoencoder: push tags and events before eos
if any tags or events are pending, push them before pushing eos
2014-01-29 12:33:59 -03:00
Sebastian Dröge 3e61449c86 videoencoder: Release the allocator on hard resets 2013-12-17 17:10:19 +01:00
Sebastian Dröge 729e3c8a10 videoencoder: Add sink_query() src_query() virtual functions
Based on the videodecoder change by Nicolas Dufresne and applied
here for consistency.

https://bugzilla.gnome.org/show_bug.cgi?id=720103
2013-12-09 16:34:19 +01:00
Julien Isorce 79ef75888c videodec/enc: clear reconfigure flag if negotiate succeeds
So that it avoids to send an allocation query twice.
One from an early call to gst_video_encoder_negotiate from a
subclass, then one from gst_video_encoder_allocate_output_frame.
Which means that previously gst_video_encoder_negotiate was not
clearing the GST_PAD_FLAG_NEED_RECONFIGURE even on success.

Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=719684
2013-12-05 15:19:16 +00:00
Sebastian Dröge 820d7d7798 videoencoder: Return not-negotiated if we don't have caps when the first buffer arrives
Otherwise things like filesrc ! jpegenc ! fakesink just crash with
a segmentation fault because subclasses expect caps to be there.
2013-12-05 11:26:55 +01:00
Sebastian Dröge 35ee4b056b videodecoder/videoencoder: Mark pads as requiring reconfiguration again if negotiation fails
Otherwise we might end up in non-optimal configuration, especially
when a flush happened during reconfiguration.
2013-09-12 09:35:00 +02:00
Matej Knopp d03feedf4c videoencoder: Check for invalid stop position before calculating a duration from it
https://bugzilla.gnome.org/show_bug.cgi?id=707332
2013-09-03 09:50:56 +02:00
Andoni Morales Alastruey 688505de88 videoencoder: fix forwarding of GstForceKeyUnit events
Use the frame id to match the output forced keyframe with
the event that forced it.

https://bugzilla.gnome.org/show_bug.cgi?id=706885
2013-08-27 15:11:33 +02:00
Sebastian Dröge b0e4b5f69a videoencoder: Make sure to return TRUE if the same caps are set again 2013-08-25 10:26:30 +02:00
Sebastian Dröge f678411c6e videoencoder: Only set the caps when they actually changed 2013-08-23 19:20:03 +02:00
Sebastian Dröge 146bb1a153 video{en,de}coder: Add new flush vfunc as a replacement for reset 2013-08-15 13:26:39 +02:00
Sebastian Dröge 9df036c216 video{en,de}coder: Revert to old ::reset() behaviour and deprecate it 2013-08-15 13:26:38 +02:00
Sebastian Dröge 047abdc944 videodecoder/encoder: Call reset() always between start() and stop() and never outside 2013-07-26 10:22:32 +02:00
Sebastian Dröge 9259ee6729 videoencoder/decoder: Call reset() before start() too 2013-07-25 14:25:31 +02:00
Sebastian Dröge c24995c31c videoencoder: There's no point in resetting the encoder when the caps change
The subclass will be called with set_format() and there it can drain
if necessary and reset whatever is necessary. This is the same behaviour
as for the video decoder.
2013-07-25 10:53:14 +02:00
Sebastian Dröge 291b05b40a videoencoder: Reset internal state and segments on FLUSH_STOP
https://bugzilla.gnome.org/show_bug.cgi?id=656007
2013-07-25 10:46:04 +02:00
Sebastian Dröge 7074fff7b4 videoencoder: Refactor GstVideoEncoder::reset() handling a bit
Let gst_video_encoder_reset() call it as would be intuitive and
only call it indirectly from gst_video_encoder_drain(). Now it
actually makes sense.
2013-07-25 10:43:08 +02:00
Mathieu Duponchelle 798ee17675 videoencoder: Send all pending events with type < CAPS before sending caps.
https://bugzilla.gnome.org/show_bug.cgi?id=703196
2013-07-01 11:15:21 +02:00
Sebastian Dröge 85eac2c31c video(enc|dec)oder: Don't return not-negotiated if flushing
If the pad is flushing after a failed negotiation, return
GST_FLOW_FLUSHING instead from finish_frame().

https://bugzilla.gnome.org/show_bug.cgi?id=701763
2013-06-30 18:17:47 +02:00
Sebastian Dröge c5e9df4b51 videoencoder: Don't require an output state to be set before allocating output buffers 2013-05-25 16:08:06 +02:00
Sebastian Dröge 0c2c909497 video: Always provide a buffer in gst_video_(enc|dec)oder_allocate_output_buffer()
We have no way of tell the caller of the exact error (e.g. if we're flushing),
so will have to wait until the caller uses API that returns a GstFlowReturn,
for example when pushing this buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=700006
2013-05-24 16:54:46 +02:00
Sebastian Dröge 2cc6a62b31 videoencoder: Make sure to push any pre-caps events before the caps are set 2013-05-09 16:05:59 +02:00
Sebastian Dröge 3e4aec6e7b video: Make sure to push pre-caps events before the caps event
https://bugzilla.gnome.org/show_bug.cgi?id=699894
2013-05-08 15:50:34 +02:00
Sebastian Dröge f7db63f1b8 videoencoder: Try harder to push writable buffers downstream
For this release the corresponding GstVideoCodecFrame before
pushing the buffer. The buffer will now be writable unless
the subclass still holds another reference to the buffer or
the frame.
2013-04-25 16:23:14 +02:00
Sebastian Dröge 9d309a3e06 videoencoder: Simply setcaps function 2013-04-18 09:58:37 +02:00
Sebastian Dröge 0b83d13231 videoencoder: Ignore caps events if the caps did not change 2013-04-15 09:44:37 +02:00
Nicolas Dufresne 7107e97273 videoencoder: Remove done ToDo
https://bugzilla.gnome.org/show_bug.cgi?id=675761
2012-12-31 19:09:01 +00:00
Nicolas Dufresne 8a233a215d videoencoder: Documentation fix
https://bugzilla.gnome.org/show_bug.cgi?id=675761
2012-12-31 19:03:29 +00:00
Sebastian Dröge 3f82e919dd libs: Use foo/foo.h as single-include header consistently everywhere
https://bugzilla.gnome.org/show_bug.cgi?id=688785
2012-12-12 17:13:10 +00: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
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 dbc89e3ab6 videoencoder: use oldest frame PTS to estimate missing outgoing DTS 2012-09-26 16:32:37 +02:00
Mark Nauwelaerts d247301aec videoencoder: incoming buffer DTS is irrelevant
... and bogus anyway if PTS != DTS
2012-09-26 16:32:37 +02:00
Mark Nauwelaerts 6973a66813 videoencoder: clip input buffers to current input segment
... rather than to output segment, which will only be set
to current input segment if some output is produced
(coming from non-clipped input).

Also fixup debug message.
2012-09-25 17:19:15 +02:00
Tim-Philipp Müller 5101adf740 Remove some #define GLIB_DISABLE_DEPRECATION_WARNINGS that are no longer needed 2012-09-10 01:27:18 +01:00
Mark Nauwelaerts d4c1b160ef videoencoder: only set invalid DTS equal to PTS for keyframe
Also add a bit more debug.

See also https://bugzilla.gnome.org/show_bug.cgi?id=679443
2012-09-07 17:41:52 +02:00
Mark Nauwelaerts 20806e4c16 videoencoder: plug some leaks 2012-09-06 13:04:56 +02:00
Wim Taymans a994ebcf1b videoencoder: allow 0 sized output frames
Allow 0 sized frames in gst_video_encoder_allocate_output_frame(). Theora
encodes repeat frames, for example, as 0 sized buffers.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681196
2012-08-24 16:56:00 +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 c02dcda885 videoencoder: getter for allocator
Sometimes the encoder would need to use the allocator for something else than
just allocating output buffers, for example, querying different parameters.

This patch expose a getter accessor for the negotiated memory allocator.
2012-08-14 15:47:23 +02:00
Sebastian Dröge b141bfed60 video: Merge upstream stream tags 2012-08-09 16:24:24 +02:00
Sebastian Dröge 3c915afc39 videoencoder: Add API to conveniently handle tags 2012-08-09 16:02:15 +02:00