[gst-devel] Help with gst_buffer_alloc

Sameer Naik sameersbn at gmail.com
Mon Oct 23 21:21:35 CEST 2006


hello,
   ive written a videosink plugin and a decoder plugin for gstreamer.
the videosink plugin opens the linux frame buffer device and works on it.
now in the videosink plugin ive added pad buffer allocation capabilities 
so that the peer element can take full advantage of the acceleration in 
copying buffers around.

when i test my plugin with the videotestsrc which requests for pad 
allocated buffer, it works very well.

now ive also written a decoder plugin, with no get_caps functionality 
for either the src_pad or sink_pad, assuming the template caps will be 
returned when requested.
ive defined a setcaps function for the sink_pad, so when this is called 
i set the caps on the sink pad, get the caps of the src_pads peer, get 
an intersection of it, create a new caps and set it as the
src_pad's caps, and fix the caps on the src_pad, disallowing 
renegotiation...thereby completing the negotiation.

*(*
*My PIPELINE:
gst-launch filesrc location=file.mpeg ! mpegdemux ! onedecoder ! queue ! 
onevideosink
onedecoder, is my decoder plugin
onevideosink, is my videosink plugin
)

*now in the chain function of the decoder plugin when i make a request 
for gst_pad_alloc_buffer() , the videosink elements buffer_alloc 
function is called, the buffer if allocated and the funtion 
returns(checked  with debug statements)... now before the control 
returns to the chain_function() where the call was made(i.e. in the 
chain() of the decoder), i get the following errors:

(gst-launch-0.10:1945): GStreamer-CRITICAL **: 
gst_pad_alloc_buffer_full: assertion `buf != NULL' failed
(gst-launch-0.10:1945): GStreamer-CRITICAL **: gst_caps_is_fixed: 
assertion `GST_IS_CAPS (caps)' failed
(gst-launch-0.10:1945): GStreamer-CRITICAL **: gst_caps_is_empty: 
assertion `GST_IS_CAPS (caps)' failed
(gst-launch-0.10:1945): GStreamer-CRITICAL **: gst_caps_is_any: 
assertion `GST_IS_CAPS (caps)' failed
(gst-launch-0.10:1945): GStreamer-CRITICAL **: gst_caps_is_empty: 
assertion `GST_IS_CAPS (caps)' failed
(gst-launch-0.10:1945): GStreamer-CRITICAL **: gst_caps_is_any: 
assertion `GST_IS_CAPS (caps)' failed
(gst-launch-0.10:1945): GStreamer-CRITICAL **: gst_caps_copy: assertion 
`GST_IS_CAPS (caps)' failed

and gstreamer exits from the pipeline execution. i have no clue why this 
is happening

as an alternative test, if i dont request a buffer from the peer and 
instead allocate it myself (gst_buffer_new()), do the processing, set 
the caps and push it over the source pad it works ok...meaning the 
negotiation was successful, buffer is received by the videosink and 
rendered.

ive tried a lot to get the pad_buffer_alloc() working, but all in vain.
plz help

thanks in advance
tc






More information about the gstreamer-devel mailing list