Plugin Writing - Pad Caps Format Change

emreterzioglu emreterzioglu at mistelektronik.com
Tue Feb 26 08:48:17 UTC 2019


Hi,

I am trying to make filter element(based on videofilter class) which take
GRAY16_LE format on src pad and give RGB format on sink pad(code added 
below). When i define pads in class_init function, other element on up or
down stream could not link with my plugin(in transform _ip function i change
frame data GRAY16_LE to RGB). What should i do in this situation?

Thanks,


GstCaps *in_caps = gst_caps_new_simple ("video/x-raw",
									 "format", G_TYPE_STRING, "GRAY16_LE",
									 "framerate", GST_TYPE_FRACTION, 25, 1,
									 "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
									 "width", G_TYPE_INT, 320,
									 "height", G_TYPE_INT, 256,
									 NULL);
GstCaps *out_caps = gst_caps_new_simple ("video/x-raw",
									 "format", G_TYPE_STRING, "RGB",
									 "framerate", GST_TYPE_FRACTION, 25, 1,
									 "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
									 "width", G_TYPE_INT, 320,
									 "height", G_TYPE_INT, 256,
									 NULL);
gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass),
      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
         in_caps));

gst_element_class_add_pad_template (GST_ELEMENT_CLASS (klass),
      gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
          out_caps));





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


More information about the gstreamer-devel mailing list