pipeline = gst_parse_launch("v4lsrc name=webcam ! tee name=tee .src0 ! xvimagesink name=display tee.src1 ! queue ! ffmpegcolorspace name=csp ! jpgenc ! filesink name=image_sink", &error1); if (!pipeline) { fprintf (stderr, "Parse error in central branch: %s\n", error1->message); return 1; } ffmpegcolorspace = gst_bin_get_by_name (GST_BIN (pipeline), "csp"); screen_sink = gst_bin_get_by_name (GST_BIN (pipeline), "display"); image_sink = gst_bin_get_by_name (GST_BIN (pipeline), "image_sink"); pad = gst_element_get_pad (ffmpegcolorspace, "sink"); gst_pad_set_blocked (pad, TRUE);