2000-01-30 10:44:33 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
extern gboolean _gst_plugin_spew;
|
|
|
|
|
|
|
|
int main(int argc,char *argv[]) {
|
|
|
|
GstElement *pipeline;
|
|
|
|
GstElement *src, *sink;
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
_gst_plugin_spew = TRUE;
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
// gst_plugin_load("dvdsrc");
|
|
|
|
|
|
|
|
fd = creat("output.vob",0644);
|
|
|
|
|
|
|
|
pipeline = gst_elementfactory_make("pipeline","dvdcat");
|
|
|
|
g_return_if_fail(pipeline != NULL);
|
|
|
|
|
|
|
|
src = gst_elementfactory_make("dvdsrc","src");
|
|
|
|
g_return_if_fail(src != NULL);
|
2000-11-20 19:04:32 +00:00
|
|
|
|
2000-01-30 10:44:33 +00:00
|
|
|
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
|
|
|
|
if (argc >= 3)
|
|
|
|
gtk_object_set(GTK_OBJECT(src),"offset",atoi(argv[2]),NULL);
|
2000-11-20 19:04:32 +00:00
|
|
|
|
2000-01-30 10:44:33 +00:00
|
|
|
sink = gst_elementfactory_make("fdsink","sink");
|
|
|
|
g_return_if_fail(sink != NULL);
|
|
|
|
gtk_object_set(GTK_OBJECT(sink),"fd",fd,NULL);
|
|
|
|
|
|
|
|
// construct the outer pipeline
|
|
|
|
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src));
|
|
|
|
gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(sink));
|
|
|
|
gst_pad_connect(gst_element_get_pad(src,"src"),
|
|
|
|
gst_element_get_pad(sink,"sink"));
|
|
|
|
|
2000-08-14 15:17:24 +00:00
|
|
|
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_READY);
|
2000-01-30 10:44:33 +00:00
|
|
|
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);
|
|
|
|
|
2000-11-20 19:04:32 +00:00
|
|
|
while (1)
|
2000-12-27 22:39:45 +00:00
|
|
|
gst_bin_iterate(GST_BIN(pipeline));
|
2000-01-30 10:44:33 +00:00
|
|
|
}
|