2000-01-30 10:44:33 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
extern gboolean _gst_plugin_spew;
|
|
|
|
|
|
|
|
int main(int argc,char *argv[]) {
|
2000-07-17 17:14:15 +00:00
|
|
|
GstBin *bin;
|
2000-01-30 10:44:33 +00:00
|
|
|
GstElement *src, *sink;
|
|
|
|
GstPad *srcpad, *sinkpad;
|
|
|
|
|
|
|
|
// _gst_plugin_spew = TRUE;
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
|
2001-06-01 18:09:26 +00:00
|
|
|
bin = GST_BIN (gst_pipeline_new("pipeline"));
|
|
|
|
g_return_val_if_fail(bin != NULL,-1);
|
2000-01-30 10:44:33 +00:00
|
|
|
|
|
|
|
g_print("--- creating src and sink elements\n");
|
|
|
|
src = gst_elementfactory_make("fakesrc","src");
|
2001-06-01 18:09:26 +00:00
|
|
|
g_return_val_if_fail(src != NULL,-1);
|
2000-01-30 10:44:33 +00:00
|
|
|
sink = gst_elementfactory_make("fakesink","sink");
|
2001-06-01 18:09:26 +00:00
|
|
|
g_return_val_if_fail(sink != NULL,-1);
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2000-07-17 17:14:15 +00:00
|
|
|
g_print("--- about to add the elements to the bin\n");
|
|
|
|
gst_bin_add(bin,GST_ELEMENT(src));
|
|
|
|
gst_bin_add(bin,GST_ELEMENT(sink));
|
2000-01-30 10:44:33 +00:00
|
|
|
|
|
|
|
g_print("--- getting pads\n");
|
|
|
|
srcpad = gst_element_get_pad(src,"src");
|
2001-06-01 18:09:26 +00:00
|
|
|
g_return_val_if_fail(srcpad != NULL,-1);
|
2000-01-30 10:44:33 +00:00
|
|
|
sinkpad = gst_element_get_pad(sink,"sink");
|
2001-06-01 18:09:26 +00:00
|
|
|
g_return_val_if_fail(srcpad != NULL,-1);
|
2000-01-30 10:44:33 +00:00
|
|
|
|
|
|
|
g_print("--- connecting\n");
|
|
|
|
gst_pad_connect(srcpad,sinkpad);
|
|
|
|
|
|
|
|
g_print("--- setting up\n");
|
2000-07-17 17:14:15 +00:00
|
|
|
gst_element_set_state(GST_ELEMENT(bin),GST_STATE_READY);
|
|
|
|
|
|
|
|
g_print("--- iterating\n");
|
|
|
|
gst_bin_iterate(bin);
|
2001-06-01 18:09:26 +00:00
|
|
|
|
|
|
|
return 0;
|
2000-01-30 10:44:33 +00:00
|
|
|
}
|