static GstCaps * gst_caps_debug_getcaps (GstPad * pad) { GstCaps *caps; GstCapsDebug *capsdebug; gchar *s; GstPad *otherpad; capsdebug = GST_CAPS_DEBUG (gst_pad_get_parent (pad)); otherpad = (pad == capsdebug->srcpad) ? capsdebug->sinkpad : capsdebug->srcpad; GST_INFO ("%s called getcaps", THISPAD); caps = gst_pad_peer_get_caps (otherpad); s = gst_caps_to_string (caps); GST_INFO ("%s returned %s", OTHERPAD, s); g_free (s); if (caps == NULL) caps = gst_caps_new_any (); gst_object_unref (capsdebug); return caps; }
void gst_caps_debug_finalize (GObject * object) { GstCapsDebug *capsdebug; g_return_if_fail (GST_IS_CAPS_DEBUG (object)); capsdebug = GST_CAPS_DEBUG (object); /* clean up object here */ G_OBJECT_CLASS (parent_class)->finalize (object); }
void gst_caps_debug_dispose (GObject * object) { GstCapsDebug *capsdebug; g_return_if_fail (GST_IS_CAPS_DEBUG (object)); capsdebug = GST_CAPS_DEBUG (object); /* clean up as possible. may be called multiple times */ G_OBJECT_CLASS (parent_class)->dispose (object); }
static GstFlowReturn gst_caps_debug_sink_chain (GstPad * pad, GstBuffer * buffer) { GstFlowReturn ret; GstCapsDebug *capsdebug; capsdebug = GST_CAPS_DEBUG (gst_pad_get_parent (pad)); ret = gst_pad_push (capsdebug->srcpad, buffer); gst_object_unref (capsdebug); return ret; }
void gst_caps_debug_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GstCapsDebug *capsdebug; g_return_if_fail (GST_IS_CAPS_DEBUG (object)); capsdebug = GST_CAPS_DEBUG (object); switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } }
static GstFlowReturn gst_caps_debug_bufferalloc (GstPad * pad, guint64 offset, guint size, GstCaps * caps, GstBuffer ** buf) { GstCapsDebug *capsdebug; gchar *s; gchar *t; GstFlowReturn ret; GstPad *otherpad; gboolean newcaps; capsdebug = GST_CAPS_DEBUG (gst_pad_get_parent (pad)); otherpad = (pad == capsdebug->srcpad) ? capsdebug->sinkpad : capsdebug->srcpad; newcaps = (caps != GST_PAD_CAPS (pad)); if (newcaps) { s = gst_caps_to_string (caps); GST_INFO ("%s called bufferalloc with new caps, offset=%" G_GUINT64_FORMAT " size=%d caps=%s", THISPAD, offset, size, s); g_free (s); } ret = gst_pad_alloc_buffer_and_set_caps (otherpad, offset, size, caps, buf); if (newcaps) { GST_INFO ("%s returned %s", OTHERPAD, gst_flow_get_name (ret)); } if (caps != GST_BUFFER_CAPS (*buf)) { s = gst_caps_to_string (caps); t = gst_caps_to_string (GST_BUFFER_CAPS (*buf)); GST_INFO ("%s returned from bufferalloc with different caps, requested=%s returned=%s", OTHERPAD, s, t); g_free (s); g_free (t); } gst_object_unref (capsdebug); return ret; }
static gboolean gst_caps_debug_acceptcaps (GstPad * pad, GstCaps * caps) { GstCapsDebug *capsdebug; gchar *s; gboolean ret; GstPad *otherpad; capsdebug = GST_CAPS_DEBUG (gst_pad_get_parent (pad)); otherpad = (pad == capsdebug->srcpad) ? capsdebug->sinkpad : capsdebug->srcpad; s = gst_caps_to_string (caps); GST_INFO ("%s called acceptcaps with %s", THISPAD, s); g_free (s); ret = gst_pad_peer_accept_caps (otherpad, caps); GST_INFO ("%s returned %s", OTHERPAD, ret ? "TRUE" : "FALSE"); gst_object_unref (capsdebug); return ret; }