Commit graph

862 commits

Author SHA1 Message Date
Wim Taymans 651e433427 pad: don't forward on NULL pads
The iterator can return NULL in some cases, avoid pushing on those
NULL pads.
2011-12-10 11:07:02 +01:00
Wim Taymans 629a8d03ce pad: put new event probe type next to other event types 2011-12-06 18:18:26 +01:00
Matej Knopp 8e6b5f79bd Add GST_PAD_PROBE_TYPE_HANDLE_FLUSH 2011-12-06 18:18:26 +01:00
Wim Taymans c0e3974aa7 pad: remove GST_FLOW_RESEND
It is unused and undefined.
2011-12-06 14:24:15 +01:00
Matej Knopp 0e935321af correct return value in gst_push_sticky 2011-12-05 17:11:07 +01:00
Tim-Philipp Müller a1daf846f3 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst/gstobject.h
	libs/gst/check/gstcheck.h
	libs/gst/controller/gstcontroller.c
	plugins/elements/gstidentity.c
	tools/gst-xmlinspect.c
2011-12-04 15:38:09 +00:00
Tim-Philipp Müller 2666450864 Suppress deprecation warnings in selected files, for g_static_rec_mutex_* mostly
GStaticRecMutex is part of our API/ABI, not much we can do here in 0.10.
2011-12-04 14:38:26 +00:00
Wim Taymans da74724fd5 pad: Handle sticky event errors
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.
2011-11-28 14:07:24 +01:00
Wim Taymans 933e8b230c pad: fix blocking probe emission
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.
2011-11-25 07:11:24 +01:00
Sebastian Dröge 0280a3c29f pad: Remove g_warning() if pad accepted caps that are not a subset of the pad caps
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.
2011-11-24 11:15:29 +01:00
Wim Taymans 407f45dc7f event: add STICKY_MULTY events
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.
2011-11-23 18:05:00 +01:00
Wim Taymans 31b79556b8 pad: take peerpad correctly
Don't take the peerpad too early, it might change because of the
probes.
2011-11-23 08:17:36 +01:00
Wim Taymans dd65aae9a1 pad: rework sticky events
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.
2011-11-22 18:40:49 +01:00
Wim Taymans d890017021 pad: fix locking order error 2011-11-21 17:43:51 +01:00
Wim Taymans 6e0a724394 pad: Add destroy notify to pad functions
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.
2011-11-21 15:47:01 +01:00
Wim Taymans 2f1ed65339 pad: Merge pad mode activation functions
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.
2011-11-21 13:29:05 +01:00
Wim Taymans 39a5e26ea9 pad: add parent to activate functions 2011-11-18 13:54:29 +01:00
Wim Taymans 12d5f03453 pad: fix scheduling mode enums
GstPadActivateMode -> GstPadMode
GST_PAD_ACTIVATE_* -> GST_PAD_MODE_*
2011-11-18 12:39:55 +01:00
Wim Taymans 612b1fbb14 pad: add parent to other functions
Add parent to chain, chain_list, getrange and event functions.
2011-11-17 12:40:45 +01:00
Wim Taymans 361a7ae44d add parent to internal links 2011-11-16 17:49:46 +01:00
Wim Taymans 09a8294d36 pad: add parent to the query function 2011-11-16 17:22:56 +01:00
Wim Taymans 54e1174060 GstPadFlags: rename flags GST_PAD_* -> GST_PAD_FLAG_* 2011-11-16 12:36:51 +01:00
Wim Taymans fe3af1d67b pad: keep the parent alive when requested
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.
2011-11-16 12:08:22 +01:00
Wim Taymans f746174c10 pad: move query convenience functions together
Move the caps convenience functions to the other query functions.
2011-11-15 18:16:24 +01:00
Wim Taymans 2358938dbd _accept_caps() -> _query_accept_caps() 2011-11-15 17:40:19 +01:00
Wim Taymans c55962c2d3 _peer_get_caps() -> peer_query_caps() 2011-11-15 17:11:46 +01:00
Wim Taymans d805f0f034 pad: _get_caps() -> _query_caps() 2011-11-15 16:46:37 +01:00
Wim Taymans 9f00a24b5e pad: fix debug line 2011-11-15 16:13:15 +01:00
Wim Taymans b5c3e254b1 pad: remove getcaps and use caps query
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.
2011-11-15 11:20:48 +01:00
Wim Taymans 37318a8cd2 pad: remove GstPadFixateCapsFunction
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.
2011-11-10 10:58:42 +01:00
Wim Taymans b133bea426 pad: don't store events on flushing pads
check the flushing state of the pad before storing the event.
2011-11-09 17:43:49 +01:00
Wim Taymans b7966c0c7d pad: make an ACCEPT_CAPS query
Replace the acceptcaps function with a query.
2011-11-09 17:36:00 +01:00
Wim Taymans 756f6eb3f2 pad: refuse events in flushing
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.
2011-11-09 17:25:30 +01:00
Wim Taymans 6cc7254166 remove query types
It was not really useful
2011-11-09 11:47:10 +01:00
Wim Taymans 642a4697fe pad: install query probes
Fire query probes according to updated design doc.
2011-11-08 17:32:11 +01:00
Wim Taymans ce09010267 pad: add pull mode probes
Allow probes to inspect the offset and size from a probe in pull mode and allow
the probe to modify the buffer.
Update design doc a little.
2011-11-08 12:47:33 +01:00
Wim Taymans ba3028aeeb pad: Add GstPadProbeInfo
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.
2011-11-08 11:04:19 +01:00
Wim Taymans 24e596a1fb pad: rework pad probes
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.
2011-11-07 17:15:17 +01:00
Wim Taymans b6fbeb8fed pad: make probes work on all pads
fixes #644907
2011-11-04 18:19:14 +01:00
Wim Taymans e91b1ee412 pad: small cleanup 2011-11-03 11:15:11 +01:00
Wim Taymans d9dc9f9d52 task: api cleanup
gst_task_create() -> gst_task_new()
2011-11-02 08:59:44 +01:00
Wim Taymans 88e12228cf bufferlist: clean up API
gst_buffer_list_len() -> gst_buffer_list_length()
gst_buffer_list_sized_new() -> gst_buffer_list_new_sized()
2011-11-02 08:59:43 +01:00
Tim-Philipp Müller 4f004eff38 pad: rename GstActivateMode to GstPadActivateMode
These might be useful:
sed -i -e 's/GstActivateMode/GstPadActivateMode/g' `git grep GstActivateMode | sed -e 's/:.*//' | sort -u`
sed -i -e 's/GST_ACTIVATE_/GST_PAD_ACTIVATE_/g'    `git grep GST_ACTIVATE_   | sed -e 's/:.*//' | sort -u`
2011-11-01 00:25:02 +00:00
Tim-Philipp Müller bffc9207b5 pad: rename GstProbeType and GstProbeReturn to GstPadProbe{Type,Return}
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`
2011-11-01 00:15:17 +00:00
Edward Hervey df6044f7eb Merging origin/master
Conflicts:
	gst/gstbin.c
	gst/gstbus.c
	gst/gstdebugutils.c
	gst/gstpad.c
	libs/gst/base/gstbaseparse.c
	libs/gst/base/gstbasesrc.c
2011-10-21 10:52:46 +02:00
Stefan Sauer ad438461a6 pad: not only describe conditions in the docs, also check them in the code
When blocking pads, check if the pad is in the rigt direction. Log some info
for the developer and return FALSE, instead of just locking up.
2011-10-20 09:51:11 +02:00
René Stadler 5239679c09 pad: fix buffer/event leak when pad is flushing
Apparently this got lost while refactoring probes.
2011-10-17 21:40:46 +02:00
Wim Taymans 65a7c66053 pad: clean up parent_class handling 2011-10-16 14:19:36 +02:00
Edward Hervey 86656b44af gstpad: Specify transfer full for gst_pad_get_caps()
It increments the reference count of the returned caps.
2011-10-10 16:55:19 +02:00
Edward Hervey 42fcb1175b gstpad: Add debug to know what events are transferred between pads 2011-10-10 16:55:19 +02:00