[gst-devel] Composing Caps - Where can I put a code sample?
HaroldJRoth
dlafferty at gmail.com
Tue Nov 9 11:08:07 CET 2010
Any suggestions on where I'd put this code sample?
For newbies who learn from copy/paste/modify, I think its useful, as it took
me a while to figure it out. (Feel free to correct)
// Bland caps specification
//
LOG_INFO(TAG_GSTREAMER, "Create videoCaps for our input.");
GstCaps* videoCaps = gst_caps_new_simple("video/x-raw-yuv", "format",
GST_TYPE_FOURCC, GST_MAKE_FOURCC('I', '4', '2', '0'), NULL);
// Idiom for tightening a caps specification.
//
LOG_DEBUG(TAG_GSTREAMER, "VideoCaps for our input was: %s \n",
gst_caps_to_string(videoCaps));
GstStructure *cs = gst_caps_get_structure(videoCaps, 0);
gst_structure_set(cs, "width", G_TYPE_INT, 320, "height", G_TYPE_INT, 240,
NULL);
LOG_DEBUG(TAG_GSTREAMER, "VideoCaps for our input is NOW: %s \n",
gst_caps_to_string(videoCaps));
Keywords:
GstCaps
GstStructure
adding properties to existing GstCaps
printing out full caps specification
example
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Composing-Caps-Where-can-I-put-a-code-sample-tp3033434p3033434.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list