How to make custom element with multiple outputs?

jackBuffington jbuffington at redzone.com
Fri Apr 3 13:46:55 UTC 2020


That was helpful Roland.  Thanks.  

>From that example, I figured out how to implement the chain function.  My
code is now running with it but I still have problems.   I have three
outputs at the moment: 'src', 'laser', and 'RGB'.  If I make my chain
function have this line:

GstFlowReturn res = gst_pad_push (filter->srcPad, buf);

and connect the next element in my graph to the 'src' pad (ignoring the
others for now) then my video comes out to the screen just fine.   

If I swap that line for the one below
GstFlowReturn res = gst_pad_push (filter->laserPad, buf);

and connect to the 'laser' pad,  then it still compiles fine but when I use
gst-launch-1.0 to test it, res is assigned -4, which corresponds to 'not
negotiated'.  

I didn't have a transform_caps function in my code as I do on other elements
that I have written so I added one that just returns the same caps that are
given to it.    This is the function that assists with caps negotiation.  I
figured that this would fix things but it didn't.  My transform_caps and
set_caps functions are pretty verbose.  I can see that caps ARE being
negotiated when I am connected to either pad and the negotiation is
identical.  With transform_caps, it still works if I connect to 'src' but
not if I connect to 'laser'.

Any ideas about why things aren't working?  Here is the output when I run
it:

<snip>
Setting pipeline to PLAYING ...
New clock: GstSystemClock
gst_lfselement_chain0  *These two lines just help me see where it is in the
code*
gst_lfselement_chain1
The result of pad_push for laserPad: -4 *Here it just tried to push to the
laser pin*
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop ():
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list