diff options
author | Christian Pointner <equinox@helsinki.at> | 2011-04-20 14:31:37 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2011-04-20 14:31:37 (GMT) |
commit | c8bc6703879da5a96dbc1319a07fa307cf1892f1 (patch) | |
tree | 0609dcb236987385401664ffc3a3b5082c042f02 /src/writer.c | |
parent | 011afcdbf0614cc61dd4022448122fe40cfa39ff (diff) |
added option for post processing
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/writer.c b/src/writer.c index 8d08cd9..f5ce2d9 100644 --- a/src/writer.c +++ b/src/writer.c @@ -89,11 +89,13 @@ static void fdremoved_cb(GstElement* sink, gint fd, gpointer data) log_printf(INFO, "fdsink: successfully removed fd %d (sink has now %d fds)", fd, num_fds); writer_t *writer = (writer_t*)data; - // call post processing script - file_list_remove(&(writer->files_), fd); + if(writer->post_process_) + file_list_call_post_process(&(writer->files_), fd); + else + file_list_remove(&(writer->files_), fd); } -int writer_init(writer_t* writer, GMainLoop *loop, const char* name_format, mode_t mode, const char* output_dir, int interval, int offset) +int writer_init(writer_t* writer, GMainLoop *loop, const char* name_format, mode_t mode, const char* output_dir, int interval, int offset, const char* post_process) { if(!writer) return -1; @@ -118,6 +120,7 @@ int writer_init(writer_t* writer, GMainLoop *loop, const char* name_format, mode writer->output_dir_ = output_dir; writer->interval_ = interval * GST_MSECOND; writer->offset_ = offset * GST_MSECOND; + writer->post_process_ = post_process; writer->clock_id_ = NULL; writer->thread_ = NULL; int ret = file_list_init(&(writer->files_)); @@ -166,6 +169,8 @@ static int check_boundaries(writer_t* writer) writer->next_ = file_list_add(&(writer->files_), &bd_time, "next", writer->name_format_, writer->output_dir_, writer->mode_); if(writer->next_ == NULL) return -2; + + // TODO: waitpid for post processing scripts and remove file after it has finished } return 0; |