When we have no chain function or when we are operating the pad in the wrong
mode, emit a critical instead of posting an error message. This is certainly a
programming error and we cannot always post a message (like when the pad has no
parent)
We don't use the sticky event index anymore, ordering of the events are how they
were sent initially.
Add some more padding between the event numbers so that we can insert new events
later.
This has to be handled explicitely by elements to
make sure that they support all the metas passed
in the allocation query.
Metas have to supported explicitely, otherwise the
query will fail. All elements in a chain need to
support a specific meta to allow its usage.
Use GstFlowReturn to internally pass events between pads.
When we sticky events cause an error, translate this error into a GstFlowReturn.
Caps events will, for example, generate a NOT_NEGOTIATED return when the event
function returns an error.
This allows us then to refuse sending buffers if one of the sticky events is
refused and generate a correct error return value.
If we are dealing with a blocking probe, only then check if one the
blocking flags of the hook matches.
Add some more debug.
Make the pad unit test less racy.
This check is correct but unfortunately it's impossible to implement
in a threadsafe way because the caps could have changed in the meantime.
Fixes bug #659606.
Add a new event flag for sticky events so that multiple events of that type can
be stored on a pad at the same time. Change the _get_sticky_event() function to
loop over the multiple events of a type.
Change the foreach function to make it possible to removed and modify the sticky
events on a pad.
Use an variable size array now to store the events. This could later be
optimized some more.
Rewrite sticky events, trying to make it a bit more simple.
When sticky events are pushed on a srcpad, store them in the sticky event
array and mark the event with received = FALSE.
When the sticky event is successfully sent to the peer pad, make
received = TRUE.
Keep a PENDING_EVENTS pad flag that is set when one of the events is in
the received = FALSE state for some reason.
when activating a sinkpad, mark all events received = FALSE on the peer
srcpad.
When pushing a buffer, check the PENDING_EVENTS flag and if it is set, push all
events to the peer pad first.
Add _full variants of the pad function setters that take a destroy notify.
Make some macros that make the old method name pass NULL to this new
function.
Add the pad mode to the activate function so that we can reuse the same function
for all activation modes. This makes the core logic smaller and allows for some
elements to make their activation code easier. It would allow us to add more
scheduling modes later without having to add more activate functions.
Add a new pad flag NEED_PARENT that ensures that the parent of a pad is
reffed and not NULL when the event, query and internal links functions
are called.
When a pad is added to an element automatically make sure the NEED_PARENT flag
is enabled.
Remove the getcaps function on the pad and use the CAPS query for
the same effect.
Add PROXY_CAPS to the pad flags. This instructs the default caps event and query
handlers to pass on the CAPS related queries and events. This simplifies a lot
of elements that passtrough caps negotiation.
Make two utility functions to proxy caps queries and aggregate the result. Needs
to use the pad forward function instead later.
Make the _query_peer_ utility functions use the gst_pad_peer_query() function to
make sure the probes are emited properly.
The fixate caps function was not used externally and we have vmethods in the
base classes where it is needed.
Update some docs.
simplify some fixate functions in the base classes. Also pass the untruncated
caps to the vmethod.
when we are flushing, don't store the event on the pad but simply return FALSE.
Don't deactivate the srcpad, we need it to be active in order to push the
caps. Downstream can change the scheduling mode of an active pad.
Make a new GstPadProbeInfo structure and pass this in the probe callback. This
allows us to add more things later and also allow the callback to replace or
modify the passed object.
Make a separate cookie to detect chancges in the list of probes and keeping
track of what hooks have been invoked yet.
Remove the requirement to have probes on srcpads in push mode and sinkpads in
pull mode.
Add some more debug.
Keep track of what callbacks got executed. If no callback is called and we are a
blocking pad, let the item pass. This allows you to block pads on selected
items only.
Explicitly have an UPSTREAM and DOWNSTREAM PadProbeType. This allows you to only
block the pad on upstream or downstream items.
Add convenience macros to only block on downstream/upstream items.
Better now than later in the cycle. These might come in handy:
sed -i -e 's/GstProbeReturn/GstPadProbeReturn/g' `git grep GstProbeReturn | sed -e 's/:.*//' | sort -u`
sed -i -e 's/GST_PROBE_/GST_PAD_PROBE_/g' `git grep GST_PROBE_ | sed -e 's/:.*//' | sort -u`
sed -i -e 's/GstProbeType/GstPadProbeType/g' `git grep GstProbeType | sed -e 's/:.*//' | sort -u`
If pushgin downstream returned a non-ok value (like GST_FLOW_WRONG_STATE),
we don't want to end up returning a different value (GST_FLOW_OK in this
case) if IDLE probes are present.
GstBuffer pointers can now be printed using GST_PTR_FORMAT. This is used
in the very useful GST_SCHEDULING debug logs in gstpad.c and allows for
easier and more information tracking of buffer progress through a
pipeline with just debug logging.
This allows the setcaps handler and notify::caps to link
the pad downstream and doesn't require hacks to always
provide a peer to the pad, like in decodebin2.
This reverts commit 2bfada5581.
Conflicts:
gst/gstpad.c
For 0.11 we want to enforce that only subsets of the pad
caps are allowed. This breaks backward compatibility for
some elements, which is why we only print a warning in
0.10.
Pads should only accept caps that are a subset of the pad caps, e.g.
they should accept only caps that have a non-empty intersection and
at least all fields of the pad caps.
Without this a pad that wants for example
"video/x-h264,stream-format=byte-stream"
will be happy to accept
"video/x-h264".
Make the acceptcaps function behave like all the other functions with a default
implementation. Don't try to chain up to the default implementation when it was
set to NULL explicitly but return FALSE instead.
Fix some docs
Remove gst_pad_get_negotiated_caps(), it does not realy do what it says,
gst_pad_get_current_caps() returns the currently negotiated caps on the pad
correctly.
Refactor calling the GETCAPS function and checks.
Move the filter code in one place.
When using fixed pad caps, get the currently configured caps and then fallback
to the GETCAPS function. We used to simply ignore the GETCAPS function, which
resulted in transform elements returning the template caps instead of doing the
caps transform.