mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 23:48:53 +00:00
gdb: add gst_element_pad() function
Another helper to navigate a pipeline. It makes it possible to easily access the pads of an element: (gdb) print $gst_element_pad(basesink, "sink") $1 = 0x7fffe80770f0 [GstPad|sink]
This commit is contained in:
parent
4877afc145
commit
96b88ffe35
1 changed files with 27 additions and 0 deletions
|
@ -1157,8 +1157,35 @@ Find a child element with the given name"""
|
||||||
return child
|
return child
|
||||||
|
|
||||||
|
|
||||||
|
class GstElementPad(gdb.Function):
|
||||||
|
"""\
|
||||||
|
Get the pad with the given name"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super(GstElementPad, self).__init__("gst_element_pad")
|
||||||
|
|
||||||
|
def invoke(self, element, arg):
|
||||||
|
value = gst_object_from_value(element)
|
||||||
|
if not g_inherits_type(value, "GstElement"):
|
||||||
|
raise Exception("'%s' is not a GstElement" %
|
||||||
|
str(value.address))
|
||||||
|
|
||||||
|
try:
|
||||||
|
name = arg.string()
|
||||||
|
except gdb.error:
|
||||||
|
raise Exception("Usage: $gst_element_pad(<gst-object>, \"<pad-name>\")")
|
||||||
|
|
||||||
|
obj = GdbGstElement(value)
|
||||||
|
for pad in obj.pads():
|
||||||
|
if pad.name() == name:
|
||||||
|
return pad.val
|
||||||
|
|
||||||
|
raise Exception("No pad named '%s' found." % name)
|
||||||
|
|
||||||
|
|
||||||
GstPipeline()
|
GstPipeline()
|
||||||
GstBinGet()
|
GstBinGet()
|
||||||
|
GstElementPad()
|
||||||
|
|
||||||
|
|
||||||
def register(obj):
|
def register(obj):
|
||||||
|
|
Loading…
Reference in a new issue