2001-05-25 21:00:07 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
int main(int argc,char *argv[]) {
|
|
|
|
GstBin *pipeline, *thread;
|
|
|
|
GstElement *src, *queue1, *sink;
|
|
|
|
|
|
|
|
gst_info_set_categories(-1);
|
|
|
|
gst_debug_set_categories(-1);
|
2001-05-26 05:26:47 +00:00
|
|
|
gst_init(&argc,&argv);
|
2001-05-25 21:00:07 +00:00
|
|
|
|
|
|
|
pipeline = gst_pipeline_new("pipeline");
|
|
|
|
thread = gst_thread_new("thread");
|
|
|
|
src = gst_elementfactory_make("fakesrc","src");
|
2001-05-26 05:36:26 +00:00
|
|
|
gtk_object_set(GTK_OBJECT(src),"silent",TRUE,NULL);
|
2001-05-25 21:00:07 +00:00
|
|
|
sink = gst_elementfactory_make("fakesink","sink");
|
2001-05-26 05:36:26 +00:00
|
|
|
gtk_object_set(GTK_OBJECT(sink),"silent",TRUE,NULL);
|
2001-05-25 21:00:07 +00:00
|
|
|
|
|
|
|
fprintf(stderr,"ADDING src\n");
|
|
|
|
gst_bin_add(thread,src);
|
|
|
|
fprintf(stderr,"ADDING sink\n");
|
|
|
|
gst_bin_add(thread,sink);
|
|
|
|
fprintf(stderr,"CONNECTING src to sink\n");
|
|
|
|
gst_element_connect (src, "src", sink, "sink");
|
|
|
|
|
2001-05-26 05:19:33 +00:00
|
|
|
fprintf(stderr,"ADDING thread\n");
|
|
|
|
gst_bin_add(pipeline,GST_ELEMENT(thread));
|
2001-05-25 21:00:07 +00:00
|
|
|
|
2001-05-26 05:19:33 +00:00
|
|
|
while (1) {
|
|
|
|
fprintf(stderr,"\nSWITCHING to PLAYING:\n");
|
|
|
|
gst_element_set_state (thread, GST_STATE_PLAYING);
|
2001-05-26 05:26:47 +00:00
|
|
|
sleep(1);
|
2001-05-26 05:19:33 +00:00
|
|
|
fprintf(stderr,"\nSWITCHING to PAUSED:\n");
|
|
|
|
gst_element_set_state (thread, GST_STATE_PAUSED);
|
2001-05-26 05:36:26 +00:00
|
|
|
// sleep(1);
|
2001-05-26 05:19:33 +00:00
|
|
|
}
|
2001-05-25 21:00:07 +00:00
|
|
|
}
|