Commit graph

769 commits

Author SHA1 Message Date
Wim Taymans
d8212d941c pad: forward events by default
Always forward all events in the default handler. Previously it used to not
forward caps events by default. It makes more sense to forward the caps events,
if the element is interested in the caps, it will implement an event handler to
retrieve the caps and then it can decide to forward or not. If the element has
no event handler, it probably just doesn't care about caps and it probably is
also not going to modify the data in a way that needs a caps change.
2011-06-09 11:49:20 +02:00
Wim Taymans
14a0e31e69 pad: remove setcaps function
Remove the setcaps function, elements should use the caps event to be informed
of the format.
2011-06-08 12:58:29 +02:00
Wim Taymans
b5351dadcd pad: Improve pad event forward code
Return TRUE when the pad has no parent or when there are no internally linked
pads.
2011-06-07 10:49:34 +02:00
Wim Taymans
9058499eeb pad: Rename and rework the dispatcher function
Rename gst_pad_dispatcher() to gst_pad_forward() and make it more useful by
iterating the internal links of a pad and handling resync properly.
Add a method gst_pad_event_forward() that unconditionally forwards an event to
all internally linked pads.
Update some pad code to use the new forward function.
2011-06-07 10:02:06 +02:00
Wim Taymans
f851685f92 pad: check flushing in pullrange too 2011-06-03 16:46:26 +02:00
Wim Taymans
8dda6b462d pad: cleanups
Use defines instead of hardcoded values for masks.
2011-06-03 13:56:04 +02:00
Wim Taymans
b5d35162ae pad: inline the recursive stream lock 2011-06-02 13:46:26 +02:00
Wim Taymans
fde7d867bd pad: remove unused fields and methods and signals 2011-06-02 13:35:52 +02:00
Wim Taymans
d863976e59 pad: use new gst_value_fixate instead
Use the new gst_value_fixate() function instead of our own version.
2011-06-02 13:23:53 +02:00
Wim Taymans
2b9c34cd70 pad: optimize linking
Optimize linking by only releasing the pad locks when there are link functions
installed on the pads.
Add some G_LIKELY here and there.
Move error paths out of the main code flow.
2011-06-02 12:40:05 +02:00
Wim Taymans
50a8e0431c pad: remove deprecated have-data signal 2011-06-02 12:39:34 +02:00
Wim Taymans
541258f0e9 pad: add idle probe for pull method too 2011-06-02 11:21:09 +02:00
Wim Taymans
e2eae110a9 pad: more cleanups
Use miniobject unref when we can
Reuse existing data type identifier instead of an extra boolean.
2011-06-02 11:01:31 +02:00
Wim Taymans
3f51563319 pad: further improve probes and pad blocking
Keep track of installed number of probes to shortcut emission.
Allow NULL callbacks, this is useful for blocking probes.
Improve probe selection based on the mask, an empty mask for the data or the
scheduling flags equals that all probes match.
Add some more debug info.
Don't check the flushing flag in the probe callback handler, this needs to be
done before calling the handler.
Fix blocking probes.
Fix unit tests
2011-06-01 19:39:20 +02:00
Wim Taymans
8abc457a3b pad: implement pad block with probes 2011-06-01 19:39:16 +02:00
Wim Taymans
fce85f75ff pad: Rework pad blocking, another attempt
Make the PadBlock callback take a GstBlockType parameter to handle the different
kind of stages in the pad block. This provides for more backwards compatibility
in the pad block API.
Separate blocking and unblocking into different methods, only blocking can do a
callback, unblock is always immediately. Also removed synchronous blocking, it
can always be implemented with a callback.
2011-05-30 18:29:06 +02:00
Wim Taymans
565f492af2 Revert "pad: rework pad blocking, first part"
This reverts commit 415da89f3c.

Conflicts:

	gst/gstpad.c
2011-05-30 13:40:04 +02:00
Wim Taymans
9f2424123f pad: improve debugging 2011-05-30 12:27:52 +02:00
Wim Taymans
415da89f3c pad: rework pad blocking, first part
Make pad block call the callback as soon as the pad is not in use. This makes it
possible to make sure that when the callback is called, no activity is happening
on the pad and that no activity will ever happen until the pad is unblocked
again. This makes pad blocking work when there is no dataflow or after EOS and
greatly helps dynamic pipelines.
Move the probe handling right where we wait on the pad block. The two are
related but not the same and the probe can eventually influence the pad
blocking as we'll se later.
Fix up some broken unit tests or tests that fail with the new behaviour.
2011-05-27 17:37:20 +02:00
Sebastian Dröge
26ca7546a7 pad: Drop sticky events pushed on flushing srcpads instead of activating them immediately 2011-05-27 11:45:16 +02:00
Wim Taymans
86c8b721b2 pad: refactor _push_event
Rework _push_event() a little so that it drops events on blocking pads.
Make sure that events are forwarded when we unblock.
Add counter on the pad to keep track of busy pads.
2011-05-26 19:45:14 +02:00
Wim Taymans
dd9fb5ebfd pad: refactor pre and post chain code 2011-05-26 18:21:09 +02:00
Wim Taymans
af42e44af5 pad: keep counter for active pads
Keep a counter to mark the amount of threads currently pushing data on the pad.
2011-05-26 17:50:15 +02:00
Wim Taymans
40228b4aa5 pad: refactor pre push code
Refactor the code that is executed as the first step of a push operation where
we check the probes and blocking and resolve the peer.
2011-05-26 17:39:17 +02:00
Wim Taymans
118e325a03 pad: remove pad cache
Remove the pad cache as this is going to be reworked for new pad blocking and
probes.
2011-05-26 17:08:03 +02:00
Wim Taymans
aaba029298 pad: simplify handling of buffer lists
Implement a default buffer-list function in case the element doesn't implement
one.
Also pass buffer-lists to the have-data signal, this allows us to remove some
backward compatibility code.
2011-05-26 16:48:14 +02:00
Wim Taymans
f4f4fa5e8f pad: remove old gst_pad_set_blocked methods 2011-05-26 16:17:31 +02:00
Wim Taymans
7e6d579301 scheduling: port to new scheduling query 2011-05-24 17:39:56 +02:00
Sebastian Dröge
0bcb5a421a pad: Add gst_pad_sticky_events_iterate() function 2011-05-24 16:17:53 +02:00
Wim Taymans
8380949994 pad: improve debugging 2011-05-23 18:14:27 +02:00
Wim Taymans
31a314ac5b pad: add pending event for sticky events
Change the sticky event array so that it contains a pending and an active event.
Events on the sinkpad are copied to the pending array and after the eventfunc
returned TRUE, moved to the active event. This allows us to queue new events
like when we do per-pad offsets without removing the currently active event.
Remove the active argument from the gst_pad_get_sticky_event() method, the
pending events are not something we want to expose.
2011-05-20 11:36:25 +02:00
Wim Taymans
e83d5320a2 pad: apply pad offset on sinkpad events too
Apply the pad offset in the send_event() function as well.
2011-05-19 19:01:09 +02:00
Wim Taymans
e8b8c4aaa6 pad: add per-pad offsets
When linking pads and when copying a segment event from the sourc pad to the
sinkpad, apply the src and sinkpad offsets to the segment base. Make sure that
we only modify the event stored on the sinkpad and never the one on the source
pad.
When changing the pad offset, perform the segment copy with the updated offsets.
When pushing a segment event, apply the srcpad offset before sending the event
to the peer pad.
This part is missing the adjustment of the segment event on the sinkpad, which
is for a later patch.
2011-05-19 18:34:43 +02:00
Wim Taymans
c8340e7762 pad: add methods to adjust the offset
Add methods to adjust the offset. This will be used to change the segment events
with an offset so that we can tweak the timing of the stream on a per-pad base.
2011-05-19 18:34:43 +02:00
Wim Taymans
be01ecf530 pad: store sticky events on flushing sinkpads too
First store the sticky event on the sinkpad in the inactive state, then check
for the flushing flag. We want to have the events on sinkpads at all times,
ready to be activated when the pad becomes active.
2011-05-18 19:43:44 +02:00
Wim Taymans
500125ab4f pad: move caps check to central location
Make a function to call the eventfunc and perform a caps check when we are
dispatching a caps event.

This makes sure that all code paths correctly check that the caps are
acceptable before sending the caps to the eventfunction.
2011-05-18 18:53:35 +02:00
Sebastian Dröge
99962c72e4 pad: Don't forget to take the object lock when getting a sticky event 2011-05-18 16:29:10 +02:00
Sebastian Dröge
6b30f0b056 pad: Add function to get sticky events from a pad
API: gst_pad_get_sticky_event()
2011-05-18 16:26:54 +02:00
Wim Taymans
fa6bcde7e3 pad: notify caps property change in callsetcaps
Notify the caps property change in the backwards compatible function to call the
setcaps function.
2011-05-18 15:29:25 +02:00
Wim Taymans
e39182a085 Merge branch 'master' into 0.11
Conflicts:
	gst/gstminiobject.c
	gst/gstpad.c
	gst/gstpad.h
	gst/gstplugin.h
	libs/gst/base/gstbaseparse.c
2011-05-18 13:14:57 +02:00
Wim Taymans
029ac4597e pad: rework sticky events a little
Update the design docs with some clear rules for how sticky events are
handled.
Reimplement the sticky tags, use a small structure to hold the event and its
current state (active or inactive).
Events on sinkpads only become active when the event function returned success
for the event.
When linking, only update events that are different.
Avoid making a copy of the event array, use the object lock to protect the event
array and release it only to call the event function. This will need to check
if something changed, later.
Disable a test in the unit test, it can't work yet.
2011-05-18 11:08:52 +02:00
Stefan Kost
9ff4ec3104 docs: add deprecation guards
Move GstPadIntLinkFunction to private header to avoid a dozen #ifdefs. Use a
gpointer in public header instead.
2011-05-18 09:55:57 +03:00
Wim Taymans
93a80e2d91 pad: don't push sticky events on flush
Only allow serialized and non-flush events forward the sticky events.
2011-05-17 19:03:30 +02:00
Wim Taymans
ba534c6416 pad: add more debug 2011-05-17 18:23:06 +02:00
Sebastian Dröge
c7789694fb gst: Update for caps/pad template related API changes 2011-05-17 13:14:04 +02:00
Sebastian Dröge
b5bc5b459a pad: Let template related functions return new references
gst_pad_template_get_caps(), gst_pad_get_pad_template_caps()
and gst_pad_get_pad_template() return a new reference of the
caps or template now and the return value needs to be
unreffed after usage.
2011-05-17 12:00:18 +02:00
Sebastian Dröge
3d2127f865 Revert "query: allow _make_writable on query handlers"
This reverts commit cf4fbc005c.

This change did not improve the situation for bindings because
queries are usually created, then directly passed to a function
and not stored elsewhere, and the writability problem with
miniobjects usually happens with buffers or caps instead.
2011-05-17 11:21:41 +02:00
Wim Taymans
887838aefe pad: avoid setting NULL caps on pads 2011-05-16 19:04:35 +02:00
Sebastian Dröge
3fa1594aaf gst: Add a filter caps parameter to all get_caps() functions
This is used to pass the possible caps and preferences to
the pad and to allow better negotiation decisions.
2011-05-16 15:33:10 +02:00
Sebastian Dröge
ddf2489be4 pad: Re-implement notify::caps 2011-05-16 10:25:10 +02:00