Skip to content

Instantly share code, notes, and snippets.

@tetkuz
Created October 6, 2015 13:08
Show Gist options
  • Save tetkuz/15e50dab4c9eda8b57d5 to your computer and use it in GitHub Desktop.
Save tetkuz/15e50dab4c9eda8b57d5 to your computer and use it in GitHub Desktop.
A very very simple GStreamer application
#include <gst/gst.h>
#include <glib.h>
int main(int argc, char *argv[])
{
GString *launch_str;
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;
gst_init(&argc, &argv);
launch_str = g_string_new(NULL);
g_string_printf(launch_str,
"fakesrc ! fakesink", NULL);
pipeline = gst_parse_launch (launch_str->str, NULL);
if (pipeline == NULL) {
g_print("parse_launch fail.\n");
return 1;
}
gst_element_set_state (pipeline, GST_STATE_PLAYING);
bus = gst_element_get_bus (pipeline);
msg = gst_bus_poll (bus, GST_MESSAGE_EOS | GST_MESSAGE_ERROR, GST_CLOCK_TIME_NONE);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment