Commit graph

122 commits

Author SHA1 Message Date
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
Sebastian Dröge e37bb460bd videoencoder: 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
Sebastian Dröge 7bdcb12b41 gst: Set alignment at the correct place of GstAllocationParams 2012-08-08 17:41:19 +02:00
Andoni Morales Alastruey d8326a8eda videoencoder: add proper format for gsize 2012-08-08 17:41:19 +02:00
Sebastian Dröge 98983e08ae videoencoder: Always propose a video buffer pool when the subclass didn't provide one
And also request 16-byte aligned buffers if the subclass didn't
set anything else.
2012-08-08 17:41:19 +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
Mark Nauwelaerts e1137b8c66 videoencoder: minor doc fix 2012-07-25 15:58:19 +02:00
Vivia Nikolaidou d2e1b64e0c videoencoder: Expose _negotiate function
This is to be called by encoders 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-24 20:42:49 +02:00
Sebastian Dröge fcf5e389ce videoencoder: Hold the stream lock when reconfiguring the element 2012-07-23 12:06:16 +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
Sebastian Dröge 97ba363092 videoencoder: Minor cleanup 2012-07-23 10:04:48 +02:00
Sebastian Dröge cce1078fe9 videoencoder: Add decide_allocation vfunc and functions to allocate buffers with the information from the allocation query 2012-07-23 09:39:47 +02:00
Edward Hervey 2817bdadc9 libs: Remove "Since" markers and minor doc fixups 2012-07-13 12:11:06 +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
Wim Taymans 136a3fd37f videoencoder: make PTS and DTS handling more explicit 2012-06-27 16:56:22 +02:00
Sebastian Dröge cb6b835d11 videoencoder: Ensure buffers don't disappear early
The frames are the owners of the buffers
2012-06-19 09:34:49 +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 86b36c3463 videoencoder: Don't unref frame twice if not in the list 2012-06-04 10:46:13 +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
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
Edward Hervey 4d7cd2e638 videoencoder: _get_oldest_frame: return a reference 2012-05-01 16:59:06 +02:00
Edward Hervey 67a4c0c7b2 videoencoder: 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:59:00 +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
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 47e169b0b5 videoencoder: Proxy the interlaced buffer flags to the GstVideoCodecFrame 2012-04-25 13:44:30 +02:00
Sebastian Dröge 76f47979c1 videoencoder: Don't propose video-meta by default 2012-04-25 13:19:11 +02:00
Sebastian Dröge 3de8d58c4e videoencoder: Add support for subclasses to propose allocation parameters 2012-04-24 22:42:59 +02:00
Sebastian Dröge a8c40a658c video: Some porting bugfixes 2012-04-24 21:32:08 +02:00
Sebastian Dröge 13b88908ce videoencoder: Require to chain up to the parent's sink event functions 2012-04-24 19:47:22 +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 f6cfd763e4 video: Base classes for video decoders and encoders 2012-04-24 17:03:40 +02:00