mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
9f23c76bea
Original commit message from CVS: Aplied more fixage from Michael Meeks.
29 lines
849 B
C
29 lines
849 B
C
#include <gst/gst.h>
|
|
|
|
void eos_handler(GstElement *element) {
|
|
printf("got EOS signal\n");
|
|
}
|
|
|
|
int main (int argc,char *argv[]) {
|
|
GstElement *pipeline, *disksrc, *identity, *fakesink;
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
pipeline = gst_pipeline_new("pipeline");
|
|
disksrc = gst_elementfactory_make("disksrc","disksrc");
|
|
identity = gst_elementfactory_make("identity","identity");
|
|
fakesink = gst_elementfactory_make("fakesink","fakesink");
|
|
|
|
g_object_set(G_OBJECT(disksrc),"location","events.c",NULL);
|
|
g_signal_connect(G_OBJECT(fakesink),"eos",G_CALLBACK (eos_handler),NULL);
|
|
|
|
gst_bin_add(GST_BIN(pipeline),disksrc);
|
|
gst_bin_add(GST_BIN(pipeline),fakesink);
|
|
|
|
gst_element_connect(disksrc,"src",fakesink,"sink");
|
|
|
|
gst_element_set_state(pipeline,GST_STATE_PLAYING);
|
|
|
|
gst_bin_iterate(GST_BIN(pipeline));
|
|
gst_bin_iterate(GST_BIN(pipeline));
|
|
}
|