Skip to content

Instantly share code, notes, and snippets.

@tetkuz
Created December 8, 2016 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tetkuz/23d618f2a73e6f6dd1dd5f9d276d87f9 to your computer and use it in GitHub Desktop.
Save tetkuz/23d618f2a73e6f6dd1dd5f9d276d87f9 to your computer and use it in GitHub Desktop.
#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("fakesrc num-buffers=100 ! fakesink");
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);
if (msg) {
(void)msg;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment