/* make sure we are negotiated */ static GstFlowReturn ensure_negotiated (GstGoom * goom) { gboolean reconfigure; reconfigure = gst_pad_check_reconfigure (goom->srcpad); /* we don't know an output format yet, pick one */ if (reconfigure || !gst_pad_has_current_caps (goom->srcpad)) { if (!gst_goom_src_negotiate (goom)) return GST_FLOW_NOT_NEGOTIATED; } return GST_FLOW_OK; }
static GstFlowReturn get_buffer (GstGoom * goom, GstBuffer ** outbuf) { GstFlowReturn ret; if (GST_PAD_CAPS (goom->srcpad) == NULL) { if (!gst_goom_src_negotiate (goom)) return GST_FLOW_NOT_NEGOTIATED; } GST_DEBUG_OBJECT (goom, "allocating output buffer with caps %" GST_PTR_FORMAT, GST_PAD_CAPS (goom->srcpad)); ret = gst_pad_alloc_buffer_and_set_caps (goom->srcpad, GST_BUFFER_OFFSET_NONE, goom->outsize, GST_PAD_CAPS (goom->srcpad), outbuf); if (ret != GST_FLOW_OK) return ret; return GST_FLOW_OK; }