mao0504 发表于 2021-10-26 17:56:20

有gstreamer的库吗?

我想搞一个基于gstreamer的应用,类似gst-launch-1.0,有对应的库吗?还是需要自己移植?

mao0504 发表于 2021-10-26 17:58:36

#include <gst/gst.h>

int main (int argc, char *argv[])
{
GstElementFactory *factory;
GstElement * element;

/* init GStreamer */
gst_init (&argc, &argv);

/* create element, method #2 */
factory = gst_element_factory_find ("fakesrc");
if (!factory) {
    g_print ("Failed to find factory of type 'fakesrc'\n");
    return -1;
}
element = gst_element_factory_create (factory, "source");
if (!element) {
    g_print ("Failed to create element, even though its factory exists!\n");
    return -1;
}

/* get name */
g_object_get (G_OBJECT (element), "name", &name, NULL);
g_print ("The name of the element is '%s'.\n", name);
g_free (name);

gst_object_unref (GST_OBJECT (element));
gst_object_unref (GST_OBJECT (factory));

return 0;
}
页: [1]
查看完整版本: 有gstreamer的库吗?