GStreamer
- 我想搞一个基于gstreamer的应用,类似gst-launch-1.0,有对应的库吗?还是需要自己移植?
回帖(1)
2022-1-6 10:32:56
- #include
- 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;
- }
- #include
- 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;
- }
举报
更多回帖