How do I set the cap in code

William Johnston wgj at cast.uark.edu
Fri May 8 03:28:02 UTC 2020


I have and element that looks like this:

element: misbfixcoordinates1
     pad: videosink
         caps (writable):   video/x-raw, format=(string)RGB
         template caps: video/x-raw, format=(string)RGB
     pad: misbsink
          caps (writable):   EMPTY
          template caps: meta/klv
     pad: videosrc
         caps (writable):   video/x-raw, format=(string)RGB, 
width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], 
framerate=(fraction)[ 0/1, 2147483647/1 ]
         template caps: video/x-raw, format=(string)RGB
     pad: misbsrc
         caps (writable):   EMPTY
         template caps: meta/klv

See those "EMPTY" caps? I want to set them to something else. I thought 
this would work:

GstPad* 
misbsinkPad=gst_element_get_static_pad(misbfixcoordinates,"misbsink");
GstCaps* newCaps1=gst_caps_from_string("meta/klv");
gst_pad_set_caps(misbsinkPad,newCaps1);

But it doesn't change anything. Anyone know how to do this?



More information about the gstreamer-devel mailing list