Commit graph

175 commits

Author SHA1 Message Date
Sebastian Dröge
63c1945695 ghostpad: Deprecate gst_ghost_pad_construct()
Instead do everything it did as part of GObject::constructed() and
change the function to always return TRUE.

gst_ghost_pad_construct() was meant to be called by subclasses right
after construction of the object to finish construction as it can fail
in theory. In practice it's impossible for it to fail, even more so if
called directly from GObject::constructed(): The only failure condition
is if the newly created proxy pad already has a parent, which is
impossible at this point as nothing else can have a reference to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/540>
2020-06-22 12:30:48 +03:00
Tim-Philipp Müller
2db8e3705f Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-24 12:49:14 +02:00
Mathieu Duponchelle
609adc0609 ghostpad: ensure we build a ghost pad ..
When we construct from a custom GType
2018-03-01 01:12:07 +01:00
Mathieu Duponchelle
7847e69ef8 pad, ghostpad: use the template gtype if specified
Also make sure the GType passed to the with_gtype versions
of the template constructors is_a GstPad

https://bugzilla.gnome.org/show_bug.cgi?id=793933
2018-03-01 00:39:08 +01:00
Tim-Philipp Müller
b63ed9e066 ghostpad: return TRUE if target pad was already set
The state is as it should be, so no reason to return
FALSE really, everything's good.
2017-11-24 13:39:39 +01:00
Tim-Philipp Müller
3203a10821 ghostpad: access internal pad with lock held 2017-11-24 13:39:39 +01:00
Havard Graff
e515aa06fe ghostpad: fix race-condition while tearing down
An upstream query will take a ref on the internal proxypad, and can
hence end up owning the last reference to that pad, causing a crash.
2017-11-24 13:39:36 +01:00
Sebastian Dröge
30f871d274 gst: Correctly annotate functions taking floating reference parameters and returning floating references
https://bugzilla.gnome.org/show_bug.cgi?id=702960
2017-05-17 10:40:37 +03:00
Sebastian Dröge
2e4c82d850 gst: Handle floating references consistently
If a function takes a floating reference parameter, it should also be
sinked in error cases. Otherwise the function behaves differently
between error and normal cases, which is impossible for bindings to
handle.

https://bugzilla.gnome.org/show_bug.cgi?id=747990
2017-05-17 10:40:37 +03:00
Thibault Saunier
a87b4551a6 Port gtk-doc comments to their equivalent markdown syntax
Modernizing our documentation and preparing a possible move to hotdoc.
This commits also adds missing @title metadatas to all SECTIONs
2017-01-27 16:36:38 -03:00
Tim-Philipp Müller
12a1418f7f Fix some nonsensical g-i annotations 2016-04-30 14:15:08 +01:00
Edward Hervey
899060d579 Revert "ghostpad: Do nothing in _internal_activate_push_default"
That commit would break scheduling reconfiguration with ghostpads

This reverts commit ab55ad7eaa.
2016-02-17 15:26:49 +01:00
Stian Selnes
ab55ad7eaa ghostpad: Do nothing in _internal_activate_push_default
When calling gst_pad_activate_mode() on a ghostpad
gst_ghost_pad_activate_push_default() will be called. This will call
gst_pad_activate_mode() on the proxypad (which is internal of the
ghostpad), calling gst_ghost_pad_internal_activate_push_default(), which
again will call gst_pad_activate_mode() on the original ghostpad.

By simply returning TRUE in
gst_ghost_pad_internal_activate_push_default() the redundant call to
gst_pad_activate_mode() (for the same pad) is avoided.

https://bugzilla.gnome.org/show_bug.cgi?id=761913
2016-02-17 12:26:12 +02:00
Jan Schmidt
a5001312cd ghostpad: Allow deactivation with no peer.
Allow deactivation in pull-mode, since that implies we
had a peer, activated in pull mode, then the peer disa-peer-ed ;)
2015-10-30 23:25:57 +11:00
Sebastian Dröge
154eefecc9 Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.

Also normalize booleans in a few places.
2014-12-01 09:51:37 +01:00
Evan Nemerson
2759882379 introspection: add missing (nullable) annotations to return values
Support for (nullable) was added to G-I at the same time as nullable
return values.  Previous versions of G-I will not mark return values as
nullable, even when an (allow-none) annotation is present, so it is
not necessary to add (allow-none) annotations for compatibility with
older versions of G-I.

https://bugzilla.gnome.org/show_bug.cgi?id=730957
2014-06-26 18:56:38 +02:00
Evan Nemerson
e10266e3f3 docs: convert NULL, TRUE, and FALSE to %NULL, %TRUE, and %FALSE
This should help improve documentation generated for
languages other than C.

https://bugzilla.gnome.org/show_bug.cgi?id=730961
2014-05-30 00:20:27 +01:00
Tim-Philipp Müller
6eb6d9ec38 docs: remove outdated and pointless 'Last reviewed' lines from docs
They are very confusing for people, and more often than not
also just not very accurate. Seeing 'last reviewed: 2005' in
your docs is not very confidence-inspiring. Let's just remove
those comments.
2014-04-26 21:21:51 +01:00
Stefan Sauer
4a38acaa10 pad: add debug helper for GstPadLinkReturn names
Add a helper like gst_flow_get_name() for GstPadLinkReturn. Use this in core.
API: gst_pad_link_get_name()
2014-03-11 21:50:36 +01:00
George Kiagiadakis
5973f8c2ca ghostpad: use gst_pad_get_peer to acquire a reference to the target pad
This ensures that the lock of the internal pad is held while referencing
it's peer (= the target pad), which ensures that the peer is not
going to be unlinked/destroyed in the meantime.

https://bugzilla.gnome.org/show_bug.cgi?id=725809
2014-03-06 20:46:28 +01:00
George Kiagiadakis
4fc671e801 ghostpad: hold a reference to the target pad while unlinking it
https://bugzilla.gnome.org/show_bug.cgi?id=725809
2014-03-06 20:46:28 +01:00
Wim Taymans
fe36be1c03 Revert "ghostpad: copy sticky events to SRC ghostpads"
This reverts commit 8162a583a4.

Automatically copying the sticky events makes it impossible for apps
and elements to filter the events with event probes. This causes
regressions (See #719437). The best option is to let the app/element
copy and filter the events themselves after the ghostpad target is
set.
2013-11-29 17:02:41 +01:00
Wim Taymans
8162a583a4 ghostpad: copy sticky events to SRC ghostpads
Update the sticky events on SRC ghostpads when retargeting. This ensures
that the ghostpad has the exect same sticky events as the target pad. We
don't want to do this for SINK ghostpads, they got the events from
downstream and we don't want to overwrite them with the target pad
events.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=707621
2013-11-21 14:13:16 +01:00
Nicolas Dufresne
4656d18fd5 Add few missing allow-none annotation 2013-07-03 14:25:07 -04:00
Tim-Philipp Müller
666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Wim Taymans
2cf4689503 ghostpad: also ref the internal pad for activate functions
Also take a ref to the internal pad in the activate functions
2012-09-27 11:06:06 +02:00
Olivier Crête
e60ee132ce proxypad: Hold a reference to the internal pad while pushing through it
https://bugzilla.gnome.org/show_bug.cgi?id=684809
2012-09-27 10:53:45 +02:00
Jan Schmidt
8d8608c23b ghostpad: Make some debugging more verbose
Also, remove an unnecessary #include in input-selector
2012-08-31 06:25:37 -07:00
Wim Taymans
961151e569 ghostpad: remove custom function
Remove custom pad functions, the default ones are better.
2012-07-18 17:49:32 +02:00
Edward Hervey
75066960e3 gstghostpad: Forward queries in both direction
Use the peer of the internal pad to forward them, instead of the
target which only exists for the ghostpad (and not the internal
proxy pad).
2012-07-18 12:07:26 +02:00
Edward Hervey
d3ffa82639 Remove 0.10-related documentation and "Since" markers 2012-07-10 12:03:27 +02:00
Wim Taymans
2cab15c9f6 docs: improve API docs 2012-06-15 12:57:24 +02:00
Matej Knopp
5c50c6612a ghostpad: set result on accept caps query when there is no peer 2012-05-01 13:32:41 +02:00
Olivier Crête
fd675fa385 gstpad: Fix typo in docstring 2012-03-27 15:25:58 -04:00
Peteris Krisjanis
02f721f7ea gst: Changed introspection transfer flag to (transfer floating)
for gst_pad_new, gst_ghost_pad_new and gst_bin_new constuctors. Fixes
segfaults due of transfer full and floating ref problem.
2012-01-25 15:05:21 +01:00
Wim Taymans
fda5685a15 ghostpad: fix print format 2011-11-21 17:43:04 +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
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
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
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
ac9e5533b5 pad: add more queries
Add more query functions to prepare for doing more with queries
2011-11-09 11:22:36 +01:00
Wim Taymans
9c0d8ca718 Merge branch 'master' into 0.11
Conflicts:
	gst/gstelement.h
	gst/gstghostpad.c
	gst/gstminiobject.c
2011-11-08 12:54:15 +01:00
Tim-Philipp Müller
16dcd5e958 docs: fix Since: markers for API added after 0.10.35 2011-11-08 00:32:36 +00:00
Wim Taymans
a1d82bec39 Merge branch 'master' into 0.11
Conflicts:
	gst/gstghostpad.c
2011-11-03 11:30:52 +01:00
Nicolas Dufresne
391568efde ghostpad: Don't cache internal proxy pad target
The internal proxy pad target is simply a cache of the internal proxy pad
peer. This patch uses the well implement GstPad peer handling to obtain the
target. This fixes issues with target not being set in both direction when
two ghostpads are linked together (empty bin).

https://bugzilla.gnome.org/show_bug.cgi?id=658517
2011-11-03 09:27:00 +01:00