Set Caps function not getting called

Neil Jones neiljay at gmail.com
Fri Jan 20 08:04:23 PST 2012


Hi,

Sorry im new to g-streamer so appologies if my question is basic, Im
writing a plugin for a multi-standard audio decoder (dsp), im finding
that my set_caps funtion on my sink pad is not being called so i
cannot setup the hardware to the correct data type, my pad is setup as
follows:

static GstStaticPadTemplate pipe0_sink_factory = GST_STATIC_PAD_TEMPLATE(
        "pipe0-sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS(
            "audio/x-ac3; "
            "audio/x-flac; "
            "audio/mpeg, "
                "mpegversion = (int) { 1, 4 }, "
                "layer = (int) { 1, 3 }; "
            "audio/pn-realaudio; "
            "audio/x-vorbis; "
            "audio/x-wma; "
        ));

and I register my set_caps function in my init function as per the
boilerplate code:

static void gst_axd_init(GstAxd *axd, GstAxdClass *gclass)
{
	g_print("Initialising AXD plugin\n");

	axd->pipe0_sinkpad = gst_pad_new_from_static_template(
								&pipe0_sink_factory,
								"pipe0-sink");
	gst_pad_set_setcaps_function(
			axd->pipe0_sinkpad,
	        GST_DEBUG_FUNCPTR(gst_axd_set_caps)
        );
	gst_pad_set_getcaps_function(
			axd->pipe0_sinkpad,
	        GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps)
	);
	gst_pad_set_chain_function(axd->pipe0_sinkpad,
	        GST_DEBUG_FUNCPTR(gst_axd_chain));

	axd->pipe0_srcpad = gst_pad_new_from_static_template(
			&pipe0_src_factory,
	                 "pipe0-src"
	);
	gst_pad_set_getcaps_function(
			axd->pipe0_srcpad,
	        GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps)
	);

	gst_element_add_pad(GST_ELEMENT(axd), axd->pipe0_sinkpad);
	gst_element_add_pad(GST_ELEMENT(axd), axd->pipe0_srcpad);
	axd->silent = FALSE;

but my 'gst_axd_set_caps' function does appear to get called and I end
up at pre-roll without setting up the hardware

any help appreciated ???

I invoked my plugin with 'gst-launch filesrc location=test.mp3 ! axd ! alsasink

Cheers,

Neil


More information about the gstreamer-devel mailing list