diff options
author | Christian Pointner <equinox@helsinki.at> | 2011-02-20 00:44:54 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2011-02-20 00:44:54 (GMT) |
commit | 88fafd10a4a260631c3de6b18720601b9cfafba1 (patch) | |
tree | 6d07af649b6cfc5adc80995b35ad6c98e51bf826 /src/writer.c | |
parent | 034f1c9a29123761c1d981e057acbdc5ac466cd0 (diff) |
added writer
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/writer.c b/src/writer.c new file mode 100644 index 0000000..1697262 --- /dev/null +++ b/src/writer.c @@ -0,0 +1,68 @@ +/* + * rharchive + * + * rharchive is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. rharchive supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 + * endpoints and vice versa. + * + * + * Copyright (C) 2010-2011 Christian Pointner <equinox@helsinki.at> + * + * This file is part of rharchive. + * + * rharchive is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * rharchive is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with rharchive. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <gst/gst.h> + +#include "writer.h" + +#include "datatypes.h" +#include "log.h" + +int writer_init(writer_t* writer, const char* name_format, const char* output_dir, int length, int offset) +{ + if(!writer) + return -1; + + writer->sink_ = gst_element_factory_make("filesink", "writer"); + if(!writer->sink_) { + log_printf(ERROR, "the writer object could not be created. Exiting."); + return -1; + } + g_object_set(G_OBJECT(writer->sink_), "location", "output.ogg", NULL); + writer->name_format_ = name_format; + writer->output_dir_ = output_dir; + writer->length_ = length; + writer->offset_ = offset; + + return 0; +} + +void writer_start(writer_t* writer) +{ + if(!writer) + return; + + // nothing yet +} + +void writer_stop(writer_t* writer) +{ + if(!writer) + return; + + // nothing yet +} |