22 #include <QtCore/QDebug>
23 #include <gst/gstpad.h>
24 #include <gst/gstutils.h>
29 PadPtr Pad::create(PadDirection direction,
const char *name)
31 GstPad *pad = gst_pad_new(name, static_cast<GstPadDirection>(direction));
33 gst_object_ref_sink(pad);
38 PadDirection Pad::direction()
const
40 return static_cast<PadDirection
>(gst_pad_get_direction(object<GstPad>()));
45 return ElementPtr::wrap(gst_pad_get_parent_element(object<GstPad>()),
false);
50 return PadPtr::wrap(gst_pad_get_peer(object<GstPad>()),
false);
53 bool Pad::isLinked()
const
55 return gst_pad_is_linked(object<GstPad>());
58 bool Pad::canLink(
const PadPtr & sink)
const
60 return gst_pad_can_link(object<GstPad>(), sink);
63 PadLinkReturn Pad::link(
const PadPtr & sink)
65 return static_cast<PadLinkReturn
>(gst_pad_link(object<GstPad>(), sink));
68 bool Pad::unlink(
const PadPtr & sink)
70 return gst_pad_unlink(object<GstPad>(), sink);
75 return CapsPtr::wrap(gst_pad_get_caps_reffed(object<GstPad>()),
false);
78 CapsPtr Pad::allowedCaps()
const
80 return CapsPtr::wrap(gst_pad_get_allowed_caps(object<GstPad>()),
false);
83 CapsPtr Pad::negotiatedCaps()
const
85 return CapsPtr::wrap(gst_pad_get_negotiated_caps(object<GstPad>()),
false);
88 bool Pad::setCaps(
const CapsPtr & caps)
90 return gst_pad_set_caps(object<GstPad>(), caps);
93 bool Pad::isActive()
const
95 return gst_pad_is_active(object<GstPad>());
98 bool Pad::setActive(
bool active)
100 return gst_pad_set_active(object<GstPad>(), active);
103 bool Pad::isBlocked()
const
105 return gst_pad_is_blocked(object<GstPad>());
108 bool Pad::isBlocking()
const
110 return gst_pad_is_blocking(object<GstPad>());
113 bool Pad::setBlocked(
bool blocked)
115 return gst_pad_set_blocked(object<GstPad>(), blocked);
118 bool Pad::query(
const QueryPtr & query)
120 return gst_pad_query(object<GstPad>(), query);
123 bool Pad::sendEvent(
const EventPtr &event)
125 return gst_pad_send_event(object<GstPad>(), event);