summaryrefslogtreecommitdiff
path: root/src/sydra.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sydra.c')
-rw-r--r--src/sydra.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/sydra.c b/src/sydra.c
index bded404..2c0816f 100644
--- a/src/sydra.c
+++ b/src/sydra.c
@@ -41,7 +41,6 @@
#include "log.h"
#include "sig_handler.h"
#include "daemon.h"
-#include "writer.h"
static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data)
{
@@ -88,7 +87,6 @@ int main_loop(options_t* opt)
GMainLoop *loop;
GstElement *pipeline, *source;
GstBus *bus;
- writer_t writer;
loop = g_main_loop_new(NULL, FALSE);
pipeline = gst_pipeline_new("sydra");
@@ -97,26 +95,17 @@ int main_loop(options_t* opt)
return -1;
}
- int ret = writer_init(&writer, loop, opt->name_format_, opt->mode_, opt->nocache_, opt->output_dir_, opt->interval_, opt->offset_, opt->post_process_);
- if(ret) {
- gst_object_unref(GST_OBJECT(pipeline));
- gst_object_unref(GST_OBJECT(loop));
- return ret;
- }
-
GError *error = NULL;
source = gst_parse_bin_from_description(opt->src_bin_desc_, TRUE, &error);
if(!source || error) {
log_printf(ERROR, "Source Bin Description Parser Error: %s", error ? error->message : "unknown");
g_error_free(error);
- gst_object_unref(GST_OBJECT(writer.sink_));
gst_object_unref(GST_OBJECT(pipeline));
gst_object_unref(GST_OBJECT(loop));
return -1;
}
- gst_bin_add_many(GST_BIN(pipeline), source, writer.sink_, NULL);
- gst_element_link_many(source, writer.sink_, NULL);
+ gst_bin_add_many(GST_BIN(pipeline), source, NULL);
bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
gst_bus_add_watch(bus, bus_call, loop);
gst_object_unref(bus);
@@ -127,18 +116,14 @@ int main_loop(options_t* opt)
gst_element_set_state(pipeline, GST_STATE_PLAYING);
signal_start(loop);
- ret = writer_start(&writer);
- if(!ret) {
- g_main_loop_run(loop);
- signal_stop();
- }
+ g_main_loop_run(loop);
+ signal_stop();
log_printf(NOTICE, "Stopping pipeline");
gst_element_set_state (pipeline, GST_STATE_NULL);
- writer_stop(&writer);
gst_object_unref(GST_OBJECT(pipeline));
- return ret;
+ return 0;
}
int main(int argc, char* argv[])