Skip to content

Instantly share code, notes, and snippets.

@yujuwon
Last active December 20, 2015 05:09
Show Gist options
  • Select an option

  • Save yujuwon/6076433 to your computer and use it in GitHub Desktop.

Select an option

Save yujuwon/6076433 to your computer and use it in GitHub Desktop.
#include <gst/gst.h>
int main(int argc, char* argv[])
{
GstElement* pipeline;
GstElement* source, *filter, *sink;
gst_init(&argc, &argv);
/* creatae pipeline */
pipeline = gst_pipeline_new("my_pipeline");
/* create element */
source = gst_element_factory_make("fakesrc", "source");
filter = gst_element_factory_make("identity", "filter");
sink = gst_element_factory_make("fakesink", "sink");
/* must add elements to pipeline before linking them */
gst_bin_add_many(GST_BIN(pipeline), source, filter, sink, NULL);
/* link */
if(!gst_element_link_many(source, filter, sink, NULL)){
g_warning("Failed to link elements!");
}
.....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment