From a9d6f08f6a27e9e121f0a6821c2f2320d48834f2 Mon Sep 17 00:00:00 2001 From: Bob Copeland Date: Sat, 30 Aug 2008 14:54:13 -0400 Subject: [PATCH] Make pipeline configurable by mount option --- gstfs.c | 2 +- xcode.c | 8 ++------ xcode.h | 3 ++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/gstfs.c b/gstfs.c index 42d3a48..8063ae6 100644 --- a/gstfs.c +++ b/gstfs.c @@ -240,7 +240,7 @@ int gstfs_read(const char *path, char *buf, size_t size, off_t offset, pthread_mutex_lock(&info->mutex); if (!info->buf) - transcode(info->src_filename, read_cb, info); + transcode(mount_info.pipeline, info->src_filename, read_cb, info); if (info->len <= offset) goto out; diff --git a/xcode.c b/xcode.c index e36bac7..2d69181 100644 --- a/xcode.c +++ b/xcode.c @@ -31,16 +31,12 @@ void *send_pipe(void *data) /* * Transcodes a file into a buffer, blocking until done. */ -int transcode(char *filename, void (*add_data_cb)(char *, size_t, void *), - void *user_data) +int transcode(char *pipeline_str, char *filename, + void (*add_data_cb)(char *, size_t, void *), void *user_data) { GstElement *pipeline, *source, *dest; GError *error = NULL; GstBus *bus; - char *pipeline_str = "filesrc name=\"_source\" ! oggdemux ! " - "vorbisdec ! audioconvert ! lame bitrate=160 ! " - "fdsink name=\"_dest\" sync=false"; - int pipefds[2]; struct pipe_params thread_params; diff --git a/xcode.h b/xcode.h index 7d7d4e7..6484ae3 100644 --- a/xcode.h +++ b/xcode.h @@ -1,6 +1,7 @@ #ifndef _XCODE_H #define _XCODE_H -extern int transcode(char *filename, int (*add_data_cb)(char *, size_t, void *), void *user_data); +extern int transcode(char *pipeline, char *filename, + int (*add_data_cb)(char *, size_t, void *), void *user_data); #endif /* _XCODE_H */ -- 2.11.4.GIT