blob: 5e41244a158048d2a6593a685d6267ea85057d9b (
plain)
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
|
#include <gst/gst.h>
extern gboolean _gst_plugin_spew;
GstPipeline *create_pipeline() {
GstPipeline *pipeline;
GstElement *src, *sink;
GstPad *srcpad, *sinkpad;
pipeline = gst_pipeline_new("fake_pipeline");
g_return_if_fail(pipeline != NULL);
src = gst_elementfactory_make("fakesrc","fakesrc");
g_return_if_fail(src != NULL);
sink = gst_elementfactory_make("fakesink","fakesink");
g_return_if_fail(sink != NULL);
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src));
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(sink));
srcpad = gst_element_get_pad(src,"src");
g_return_if_fail(srcpad != NULL);
sinkpad = gst_element_get_pad(sink,"sink");
g_return_if_fail(srcpad != NULL);
gst_pad_connect(srcpad,sinkpad);
return GST_PIPELINE(pipeline);
}
int main(int argc,char *argv[]) {
GstElement *pipeline;
xmlDocPtr doc;
// _gst_plugin_spew = TRUE;
gst_init(&argc,&argv);
pipeline = GST_ELEMENT(create_pipeline());
doc = gst_xml_write(pipeline);
xmlSaveFile("save.xml",doc);
}
|