-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
55 lines (39 loc) · 1.13 KB
/
Copy pathmain.cpp
File metadata and controls
55 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
#include <gst/gst.h>
int
main(int argc,
char *argv[])
{
const gchar *nano_str;
guint major, minor, micro, nano;
gst_init (&argc, &argv);
gst_version (&major, &minor, µ, &nano);
if (nano == 1)
nano_str = "(CVS)";
else if (nano == 2)
nano_str = "(Prerelease)";
else
nano_str = "";
printf ("GStreamer: %d.%d.%d %s\n",
major, minor, micro, nano_str);
GstElementFactory *factory;
factory = gst_element_factory_find("fakesrc");
if (!factory) {
g_print("'fakesrc' factory is not found\n");
return -1;
}
GstElement *element;
//element = gst_element_factory_make("fakesrc", "source");
element = gst_element_factory_create(factory, "source");
if (!element) {
g_print("failed to create element\n");
return -1;
}
g_print("%s element\n", gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(factory)));
gchar *name;
g_object_get(G_OBJECT(element), "name", &name, NULL);
g_print("the name is '%s'\n", name);
g_free(name);
gst_object_unref(element);
return 0;
}