Commit graph

381 commits

Author SHA1 Message Date
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
9b98ef4fed pad: improve some flag macros 2011-11-15 16:13:28 +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
d1a8695470 fix docs 2011-11-14 10:27:01 +01:00
Wim Taymans
4a7c3b929a .h: fix header files
Ensure correct indentation and :retab.
Make sure all structures have padding
Fix up some old ABI additions.
2011-11-11 17:30:03 +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
b7966c0c7d pad: make an ACCEPT_CAPS query
Replace the acceptcaps function with a query.
2011-11-09 17:36:00 +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
4660beaba8 pad: remove lock/unlock_full versions of stream-lock 2011-11-08 15:51:48 +01:00
Wim Taymans
1013c6c79b pad: add defines for query probes 2011-11-08 15:48:34 +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
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
Wim Taymans
ea012d3dd7 pad: GST_FLOW_UNEXPECTED -> GST_FLOW_EOS 2011-10-10 11:33:51 +02:00
Wim Taymans
8a1f401dfd docs: fix docs 2011-09-26 20:47:35 +02:00
Sebastian Dröge
43538e2e75 Merge branch 'master' into 0.11
Conflicts:
	docs/design/draft-buffer2.txt
	docs/design/part-TODO.txt
	docs/design/part-block.txt
	docs/design/part-bufferlist.txt
	docs/design/part-caps.txt
	docs/design/part-element-transform.txt
	docs/design/part-events.txt
	docs/design/part-negotiation.txt
	gst/gstcaps.c
	gst/gstevent.h
	gst/gstghostpad.c
	gst/gstinterface.c
	gst/gstpad.c
	gst/gstpad.h
	gst/gstutils.c
	libs/gst/base/gstbasesink.c
	libs/gst/base/gstbasesrc.c
	libs/gst/base/gstbasetransform.c
	libs/gst/base/gsttypefindhelper.c
	plugins/elements/gstcapsfilter.c
	plugins/elements/gsttee.c
	tests/check/generic/sinks.c
	tools/gst-launch.1.in
2011-09-08 14:28:23 +02:00
Piotr Fusik
14f5518f3d docs, gst: typo fixes
https://bugzilla.gnome.org/show_bug.cgi?id=658449
2011-09-07 18:03:17 +01:00
Wim Taymans
5cf8e68944 Merge branch 'master' into 0.11
Conflicts:
	gst/gstmessage.c
	gst/gstquery.c
	gst/gstregistrychunks.c
	gst/gstsegment.c
	libs/gst/base/gstbasetransform.c
	libs/gst/base/gstbasetransform.h
	libs/gst/base/gsttypefindhelper.c
	plugins/elements/gsttypefindelement.c
2011-08-26 14:37:54 +02:00
Josep Torra
746813344d pad: explicitly cast to the enum type
Fixes warning #188: enumerated type mixed with another type reported by ICC.
2011-08-26 14:11:13 +02:00
Wim Taymans
cbccf7d5bf pad: fix some macros
Remove a rather usless macro to check if a pad mode is active and
add GST_PAD_IS_ACTIVE().
2011-08-15 13:24:11 +02:00
Wim Taymans
1c16ff94fc pad: remove gst_pad_get_negotiated_caps()
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.
2011-08-15 12:16:30 +02:00
Wim Taymans
99d4880f31 pad: add method to mark reconfigure 2011-08-04 17:12:21 +02:00
Wim Taymans
2d6a59aa83 pad: add _check_reconfigure() method
Add a method to check and clear the RECONFIGURE flag on a pad.
2011-06-10 17:32:20 +02:00
Wim Taymans
2d28891528 Merge branch 'master' into 0.11
Conflicts:
	gst/gstelementfactory.c
	gst/gstelementfactory.h
	gst/gstpad.h
	gst/gstpluginfeature.c
	gst/gstpluginfeature.h
2011-06-10 12:09:49 +02:00
Javier Jardón
5d25e4a204 Use "const" instead G_CONST_RETURN
G_CONST_RETURN will be deprecated soon.

https://bugzilla.gnome.org/show_bug.cgi?id=652211
2011-06-09 17:54:27 +01:00
Wim Taymans
9d2953288c pad: fix header 2011-06-09 13:34:19 +02:00
Wim Taymans
98fdfa1815 pad: fix spurious include 2011-06-09 12:31:47 +02:00
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
44b4312d96 fix some circular includes
typedef some structs before including other files to avoid circular dependencies
in the header files.
2011-06-07 13:25:26 +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
Tim-Philipp Müller
4b920eb5d2 docs: update for API changes
Also remove GST_PAD_CHECKGETRANGEFUNC macro
2011-06-05 18:57:56 +01:00
Edward Hervey
20d1ee87cb gstpad: Small doc fixup 2011-06-03 18:10:24 +02:00
Wim Taymans
07aca4a698 pad: clean up probe flags 2011-06-03 17:24:45 +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
50a8e0431c pad: remove deprecated have-data signal 2011-06-02 12:39:34 +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
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
Stefan Kost
1718abcbbb docs: hide this from the docs 2011-05-23 23:40:20 +03:00
Stefan Kost
01d8d7d718 deprecation-guards: fixup for commit 9ff4ec3104
Remove the deprecation guards for GST_PLUGIN_DEFINE_STATIC again (even though it
is deprecated) as we use it in the tests. Remove "_" for intlinkfunc.
2011-05-20 15:50:30 +03: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
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
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
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
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
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
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
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
b5456cc6f4 caps: remove caps from buffers and pads
Remove the GstCaps from buffers and pads. We now use CAPS events to negotiate
formats between element.
2011-05-09 16:21:28 +02:00
Wim Taymans
62b1a5a7be pad: add 2 new caps methods
Add method to get the currently configured caps on the pad.
Add a method to check if caps are configured on a pad.
2011-05-06 19:03:33 +02:00
Wim Taymans
b35a700d3e pad: implement fixed caps with an object flag
Implement fixed caps with an object flag instead of a custom getcaps function.
2011-05-06 17:59:33 +02:00
Wim Taymans
0637aa95c5 pad: clean up the .h file a bit 2011-05-06 12:09:00 +02:00
Wim Taymans
4372869e80 pad: implement more sticky events
Remove the context again, adding an extra layer of refcounting and object
creation to manage an array is too complicated and inefficient. Use a simple
array again.
Also implement event updates when calling gst_pad_chain() and
gst_event_send_event() directly.
2011-05-06 11:14:02 +02:00
Wim Taymans
dfef1d027d pad: improve passing around the context
Improve passing around the context, only send the context to the peer element
when the CONTEXT_PENDING flag is set.
2011-05-05 16:34:29 +02:00
Sebastian Dröge
5a7ec99214 pad: Keep track of reconfigure events and the pad-needs-reconfiguring status 2011-05-05 15:11:51 +02:00
Wim Taymans
f16180a761 pad: update the context lazyly 2011-05-05 13:17:08 +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
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
9136abf623 pad: use the context to store sticky events
Store the sticky events in the context of a source pad.
2011-05-04 15:53:21 +02:00
Wim Taymans
bc9cffda90 pad: more sticky events work
Copy the sticky events from the srcpad to the sinkpad when linking pads. Set the
STICKY_PENDING flag to make sure that the sticky events are dispatched before
pushing the next buffer to the element.
2011-05-03 18:58:18 +02:00
Wim Taymans
2243adffa1 event: add sticky flags to events
Add the sticky flag to events and a sticky index.
Keep sticky events in an array on each pad.
Remove GST_EVENT_SRC(), it is causing refcycles with sticky events, was not used
and is not very interesting anyway.
2011-05-02 18:34:18 +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
Sebastian Dröge
6e41a3cf2f pad: Make the size parameter of gst_pad_alloc_buffer() unsigned
Internally guints were used everywhere already.
2011-04-18 10:47:26 +02:00
Wim Taymans
f505f778cc pad: more preroll lock to basesink
Move the preroll lock to basesink where it belongs.
2011-03-04 17:25:02 +01: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
Wim Taymans
f558409fdc pad: Clean up .h file 2010-12-07 16:52:47 +01:00
Wim Taymans
993eda5004 remove deprecated symbols and methods 2010-12-06 19:18:31 +01:00
Sebastian Dröge
d7f59ca0c4 pad: Deprecate GST_FLOW_IS_FATAL() and GST_FLOW_IS_SUCCESS()
The problem with both macros is, that they suggest something that isn't true.
If GST_FLOW_IS_FATAL is true, there could still be a problem for many elements
and they should stop what they're currently doing and return that value
upstream (e.g. not-linked in a parser). If GST_FLOW_IS_SUCCESS is false, it
could still be that this is "ok" for the element (e.g. not-linked for a demuxer
on a few of its pads but not all).

It's better to not have these "convenience" macros but instead let people
*think* about the handling of different flow returns, that makes sense for
their element. And we should document the expected handling of flow returns for
different classes of elements in the plugin writer's guide.

Fixes bug #628014.
2010-08-27 16:59:08 +02:00
Stefan Kost
9d2292acaa pad: remove comma at the end of the last enum value
Fixes the build for c++.
2010-07-15 12:03:04 +03:00
Stefan Kost
8df1fdab57 docs: improve the api docs for new GstPadLinkChecks and its use 2010-07-05 17:53:42 +03:00
Edward Hervey
27b4868157 pad: more documentation regarding the new flags 2010-06-25 18:55:18 +02:00
Wim Taymans
d4e1fdb0c7 pad: make the NOTHING link check flag be 0
Make the pad link check of NOTHING be 0. This way we have a flag for each
feature and 0 when no flags are set.
2010-06-25 18:28:07 +02:00
Sebastian Dröge
5f4a965f67 gstxml: Deprecate GstXml and related functions
Pipeline serialisation to and from XML is horribly broken for all
but the most simple use cases, and will likely never be fixed.
Make sure everyone playing around with these tools is aware of
this, to avoid frustration. See countless bug reports in bugzilla.

Fixes bug #622685.
2010-06-25 18:25:40 +02:00
Edward Hervey
625c4e2d80 GstPad: Add new pad linking method with configurable checks.
To be used for cases where we don't need all checks to be validated.

API: gst_pad_link_full
API: GstPadLinkCheck

https://bugzilla.gnome.org/show_bug.cgi?id=622504
2010-06-23 18:42:35 +02:00
Johan Dahlin
23faba0190 Add gobject-introspection annotations for GstPadIntLinkFunction
Fixes build with latest gobject-introspection from git.

https://bugzilla.gnome.org/show_bug.cgi?id=622025
2010-06-22 15:01:20 +01:00
Edward Hervey
4a11063768 Revert "GstPad: Add GST_PAD_NEGOTIABLE GstPadFlag"
This reverts commit dc38e75d88.

boom
2010-06-15 11:54:19 +02:00
Edward Hervey
dc38e75d88 GstPad: Add GST_PAD_NEGOTIABLE GstPadFlag
A pad is 'negotiable' when its container element is in a state greater
than GST_STATE_READY

API:gst_pad_is_negotiable
API:gst_pad_set_negotiable
API:GST_PAD_NEGOTIABLE

https://bugzilla.gnome.org/show_bug.cgi?id=618644
2010-06-14 17:08:14 +02:00
Wim Taymans
6e4fde7195 docs: clarify the pull_range functions
Clarify the gst_pad_pull_range(), GstBaseSrc::create(), gst_pad_get_range()
and GstPadGetRange functions a little.

Fixes #617733
2010-05-05 12:01:50 +02:00
Tim-Philipp Müller
126d9cfce8 pad: add enums for custom flow return success and error codes
This way people can just #define their own custom flow returns to
one of these without having the compiler (esp. gcc-4.5) complain
about comparing integers to an enum or the enum not being listed

Fixes #615880.

API: GST_FLOW_CUSTOM_SUCCESS_1
API: GST_FLOW_CUSTOM_SUCCESS_2
API: GST_FLOW_CUSTOM_ERROR_1
API: GST_FLOW_CUSTOM_ERROR_2
2010-04-16 14:52:32 +01:00
Wim Taymans
64a4037f63 pad: indentation fix 2009-11-05 12:36:10 +01:00
Stefan Kost
f63ecd04a8 pad: rename new api from _refed to _reffed.
Due to popular demand rename the new api as we still can.
API: gst_pad_get_caps_reffed(), gst_pad_peer_get_caps_reffed()
2009-11-05 12:54:32 +02:00