Questions about transforming caps

j1432 other3 at buffingtonfx.com
Fri Feb 22 19:31:20 UTC 2019


I've been writing an element that takes input from a stereo camera that
outputs the two camera's images as raw Bayer patterns that are byte by byte
interleaved.  So far I have the element working so that I am using a
transform function to manually copy rather than transform it in place.  This
lets me at least select which camera to output.  I am now working to make
the element so that it can start to convert the Bayer pattern over to RGB. 
To do that, I have done the following things:

* I have changed my static pad source template from GST_STATIC_CAPS
("video/x-raw)
to GST_STATIC_CAPS ("video/x-raw, format=(string)RGB")

* I have added a transform_caps function because the input and output will
now be differently sized. 

* I have added this line in my _init function: 
trans_class->transform_caps = GST_DEBUG_FUNCPTR
(gst_ocamElement_transform_caps);

* I have modified my transform function so that at the moment it simply
copies the data from one camera into all three channels of the RGB image so
that I should just see a black and white version of the Bayer pattern.  

Right now I am getting the following in my console when I try using the
element with gst-launch:

...
Setting pipeline to PLAYING ...
0:00:00.131178176 24688 0x55600b8d3a80 DEBUG            ocamelement
ocamelement.c:358:gst_ocamElement_transform_caps:<ocamelement0> Transforming
caps EMPTY in direction src
0:00:00.131189539 24688 0x55600b8d3a80 DEBUG            ocamelement
ocamelement.c:404:gst_ocamElement_transform_caps:<ocamelement0> returning
caps: EMPTY
...

It then fails to even open a video window.  

1. What could cause the caps to be empty?  

2. I haven't found any good documentation about how to properly implement a
transform_caps function so I have mostly just copied it from another
element.  Is there any sort of documentation about what you are supposed to
do with this function?  I don't think that my error is in there but I think
that I may run into issues later because I don't really understand what is
going on here.

3. How is the size of the output buffer arrived at?   I am working off of
the assumption that Gstreamer is looking at the width and height of my input
buffer and seeing that the output is now RGB so it should give me
width*height*3 bytes.  Is that correct?






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


More information about the gstreamer-devel mailing list