Commit graph

220 commits

Author SHA1 Message Date
Wim Taymans
a59bc0ab02 basetransform: remove obsolete code
Remove some obsolete code.
Don't try to reconfigure when we don't have sink caps.
2011-05-11 18:09:03 +02:00
Sebastian Dröge
ef673656b7 basetransform: Implement support for pad reconfiguration again 2011-05-11 15:26:02 +02:00
Wim Taymans
cf4fbc005c query: allow _make_writable on query handlers
Pass a GstQuery ** to the query handlers so that they can make the query
writable before using a setter on it.
Port code to new API.
2011-05-10 18:36:33 +02:00
Wim Taymans
7f24a48387 event: _qos_full -> _qos 2011-05-09 18:48:55 +02:00
Wim Taymans
c07b57fc05 segment: remove _full version
Rename the _full versions of the functions to the normal function names.
2011-05-09 17:51:07 +02:00
Wim Taymans
4eed658be1 basetransform: Use CAPs event
Use the caps event to configure basetransform.
Remove force_alloc hack, we don't need this in 0.11 with new upstream
negotiation.
Avoid getting some pad caps.
2011-05-09 15:08:51 +02:00
Wim Taymans
ba6b915651 base: avoid using buffer caps
Comment all code using buffer caps.
Rework capsfilter code a little.
Fix some unit tests
2011-05-08 12:46:17 +02:00
Wim Taymans
02e5feb2bf pad: avoid using the old GST_PAD_CAPS
Don't use GST_PAD_CAPS but instead use the new gst_pad_get_current_caps()
method.
Avoid setting caps on buffers.
2011-05-06 19:04:54 +02:00
Sebastian Dröge
0069dc08ec basetransform: Don't get the parent twice in the setcaps function 2011-05-05 18:21:21 +02:00
Sebastian Dröge
aebe4a3c13 basetransform: In getcaps() prefer the caps order and caps of downstream if possible 2011-05-05 15:22:08 +02:00
Sebastian Dröge
a6c1cbe69a basetransform: Prefer caps order given by the subclass of the template caps order 2011-05-05 15:20:10 +02:00
Sebastian Dröge
1cc95da945 basetransform: Use new reconfigure flag on the pads instead of the reconfigure event 2011-05-05 15:19:56 +02:00
Sebastian Dröge
24cef7aa2f basetransform: Also call gst_base_transform_reconfigure() on renegotiate events 2011-05-05 15:02:56 +02:00
Thiago Santos
3baed25383 basetransform: Handle the new renegotiate event
Let basetransform push a renegotiate event upstream
when it gets a new suggestion
2011-05-05 15:02:46 +02:00
Wim Taymans
c4751ec8c1 Revert "context: use context on buffers instead of caps"
This reverts commit 9ef1346b1f.

Way to much for one commit and I'm not sure we want to get rid of the pad caps
just like that. It's nice to have the buffer and its type in onw nice bundle
without having to drag the complete context with it.
2011-05-05 13:17:08 +02:00
Sebastian Dröge
de5ce36dd1 basetransform: Remove nowadays unused and uninitialized setcaps variable 2011-05-05 12:28:02 +02:00
Wim Taymans
9ef1346b1f context: use context on buffers instead of caps
Put the srcpad context on buffers instead of caps. This allows us to associate
all the relevant info contained in events with a buffer.
2011-05-04 18:59:47 +02:00
Wim Taymans
baebf253ad transform: do pad_alloc fallback correctly 2011-04-29 13:42:57 +02:00
Wim Taymans
6ab7e6c15d Remove pad_alloc, this can now be done better
Remove pad_alloc and all references. This can now be done more efficiently and
more flexible with the ALLOCATION query and the bufferpool objects. There is no
reverse negotiation yet but that will be done with an event later.
2011-04-29 13:26:19 +02:00
Wim Taymans
070cdaab7c Merge branch 'master' into 0.11 2011-04-25 10:30:41 +02:00
Thiago Santos
0253c85b0d basetransform: fix negotiation regression
Fixup patch for 83597767b1

Use a separate variable for knowing if a pad alloc has been made
instead of checking for the flow return that might not be the
result of the pad alloc

https://bugzilla.gnome.org/show_bug.cgi?id=648220
2011-04-21 14:04:49 +01:00
Wim Taymans
24bb414035 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
2011-04-19 16:21:15 +02:00
Havard Graff
38dcd41b97 basetransform: don't unref trans until the function is done using it
trans->priv->force_alloc = FALSE would crash if the ref held is the last

https://bugzilla.gnome.org/show_bug.cgi?id=648215
2011-04-19 15:09:14 +01:00
Sebastian Dröge
f51a23a83c Merge branch 'master' into 0.11 2011-04-16 08:59:58 +02:00
Ole André Vadla Ravnås
e7bf5484c7 base: Fix pad callbacks so they handle when parent goes away
1) We need to lock and get a strong ref to the parent, if still there.
2) If it has gone away, we need to handle that gracefully.

This is necessary in order to safely modify a running pipeline. Has been
observed when a streaming thread is doing a buffer_alloc() while an
application thread sends an event on a pad further downstream, and from
within a pad probe (holding STREAM_LOCK) carries out the pipeline plumbing
while the streaming thread has its buffer_alloc() in progress.
2011-04-13 17:39:05 +02:00
Wim Taymans
6be4dbdb5a Merge branch 'master' into 0.11
Conflicts:
	android/base.mk
	android/controller.mk
	android/dataprotocol.mk
	android/elements.mk
	android/gst-inspect.mk
	android/gst-launch.mk
	android/gst-plugin-scanner.mk
	android/gst.mk
	android/indexers.mk
	android/net.mk
	win32/common/libgstbase.def
2011-04-11 10:26:54 +02:00
Sebastian Dröge
237e54d4fe base: Unref events if the parent element disappeared
And also unref events if the basetransform subclass has no
event handler and the event is not forwarded at all.
2011-04-08 14:57:05 +02:00
Havard Graff
0daedb7409 base: Make upstream events MT-safe 2011-04-08 14:57:00 +02:00
Wim Taymans
ebb14d95b2 buffer: more API tweaks
_trim -> _resize
_create_sub -> copy_region
2011-03-30 16:47:55 +02:00
Wim Taymans
a12ede3fb1 Merge branch 'master' into 0.11-fdo
Conflicts:
	gst/gst.c
	libs/gst/base/gstcollectpads.c
2011-03-28 20:11:20 +02:00
Wim Taymans
121b82ce27 buffer: fix subbuffers 2011-03-28 20:08:47 +02:00
Wim Taymans
38ffe30745 memory: more work on implementing buffer memory 2011-03-28 20:08:46 +02:00
Wim Taymans
d82c8bd2af memory: port code to new buffer data API 2011-03-28 20:08:45 +02:00
Edward Hervey
0f0a62f316 basetransform: Retain caps order when getting caps
If the element gave us caps in a specific order, let's retain that
by intersecting against the template but retaining the order given
by the element.

https://bugzilla.gnome.org/show_bug.cgi?id=617045
2011-03-24 11:47:32 -03:00
Wim Taymans
0894ed2053 Merge branch 'master' into 0.11 2011-02-22 15:08:51 +01:00
Wim Taymans
238b9a57cc Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	gst/gstelement.c
	gst/gstelement.h
	gst/gstpad.c
	gst/gstutils.c
	libs/gst/base/Makefile.am
	libs/gst/check/Makefile.am
	libs/gst/controller/Makefile.am
	libs/gst/dataprotocol/Makefile.am
	libs/gst/net/Makefile.am
	win32/common/libgstreamer.def
2011-02-22 14:11:59 +01:00
Thiago Santos
83597767b1 basetransform: Be smarter with pad allocs
Avoid doing unnecessary pad-allocs when on passthrough mode.
If multiple basetransform elements are on a pipeline, they
would do a pad-alloc for each received buffer, each element
would do this, so we would have lots of pad allocs on the
pipeline for a single buffer being pushed through it.

This patch attempts to reduce this amount by avoiding
doing pad-allocs if the element has already done it
after the last pushed buffer. So it will only be allowed
to do a new pad-alloc after it has pushed a buffer, so we get
1x1 pad-alloc and buffer ratio

https://bugzilla.gnome.org/show_bug.cgi?id=642373
2011-02-21 10:31:22 -03:00
Thiago Santos
3aaef921c5 basetransform: Check for pad alloc caps when suggestion is not fixed
If after computing the suggestion with downstream caps we still have
a non-fixed suggestion caps try to intersect with the input caps
of the pad alloc to avoid useless renegotiations.

https://bugzilla.gnome.org/show_bug.cgi?id=642130
2011-02-14 15:59:25 +01:00
Sebastian Dröge
0a74684b41 basetransform: Handle downstream giving a buffer with new caps but invalid size
This can happen for example when downstream proposed new caps, later proposed
the previous caps again which in turn enables passthrough mode in upstream
elements and the wrong-sized buffer appears in an element where the caps
change never happened. Simply allocate a new buffer in this case.

See bug #635461.
2010-12-16 10:58:33 +01:00
Tim-Philipp Müller
686b16756d docs: libgstbase: more gobject introspection annotations
Many of these are superfluous and were added for clarity.
2010-12-07 18:37:04 +00:00
Wim Taymans
b2ab72b916 pad: remove get_caps_reffed variants
Make the _get_caps functions behave like the _get_caps_reffed variants and
remove the _reffed variants. This means that _get_caps doesn't return a writable
caps anymore and an explicit _make_writable() is needed before modifying the
caps.
2010-12-07 18:14:38 +01:00
Jonathan Matthew
754c3038be basetransform: use input position for queries if we have no output position 2010-10-29 15:45:04 +02:00
Wim Taymans
ce919c0573 basetransform: fix reverse negotiation
When the downstream element suggests a new format, pass the suggestion
upstream if we can't convert to it.

Fixes #633147
2010-10-29 12:03:48 +01:00
Sebastian Dröge
14023fff89 basetransform: Report the output position on POSITION queries on the srcpad
There can be a difference between input and output last_stop.

Fixes bug #629410.
2010-10-10 18:18:23 +02:00
Havard Graff
51d20158be basetransform: Make a WARNING into a DEBUG statement
Fixes bug #630437.
2010-09-23 21:55:04 +02:00
Wim Taymans
90d65cb446 basetransform: avoid useless memcpy
Because of the awkward refcounting in prepare_output_buffer, we might end up
with writable buffers that point to the same data. Check for those cases so that
we avoid a useless memcpy and keep valgrind quiet.

Fixes #628176
2010-09-23 18:23:39 +02:00
Wim Taymans
f8abf35000 basetransform: recover from invalid downstream suggestions
When we are handling a buffer and need to allocate an output buffer, handle the
case when downstream suggests us a format that we can't convert the input buffer
to. In that case, check if there is another format available downstream instead
of failing.

Fixes #621332 and see also #614296
2010-08-26 15:18:47 +02:00
Stefan Kost
2237af4b6b debug: logging improvements
Use the event serialisation. Log formats name instead of number.
2010-08-05 10:31:50 +03:00
Rob Clark
29289ee79e basetransform fix for upstream caps-renegotiation
If initially pass-through caps are negotiated between a transform element's
sink and src pads, but then the downstream element returns different caps
on a buffer from pad_alloc(), basetransform gets stuck with proxy_alloc=TRUE
even though the upstream peer doesn't accept the caps, causing
gst_pad_peer_accept_caps() to be called on each buffer in _buffer_alloc():

    if (!gst_caps_is_equal (newcaps, caps)) {
      GST_DEBUG_OBJECT (trans, "caps are new");
      /* we have new caps, see if we can proxy downstream */
>>    if (gst_pad_peer_accept_caps (pad, newcaps)) {
        /* peer accepts the caps, return a buffer in this format */
        GST_DEBUG_OBJECT (trans, "peer accepted new caps");

which is taking ~40ms/frame.

This patch does two things.  (1) if the buffer returned from pad_alloc() has
new caps, trigger the decision whether to proxy the buffer-alloc to be
revisited, and (2) disable proxy if peer does not accept new caps.  (The first
part may not be strictly needed, but seemed like a good idea.)

Note that this issue would not arise except in case of downstream elements
who have on their template-caps, some that would be suitable for pass-through,
but at runtime pick more restrictive caps (for ex, after querying a driver for
what formats it actually supports).
2010-07-27 17:34:49 +02:00
Thiago Santos
574e6ab423 basetransform: Try suggesting caps on bad caps pad_alloc
When basetransform received an unsupported caps on pad_alloc
it just returned not-negotiated. This patch makes it query
the allowed caps between his sinkpad and upstream's srcpad
to find a caps to suggest.

This happens when dinamically switching pipeline elements
and upstream pad_allocs with the previous caps that was
being used.

Fixes #614296
2010-07-26 14:49:14 -03:00