summaryrefslogtreecommitdiff
path: root/src/libwebvi/webvicontext.c
diff options
context:
space:
mode:
authorAntti Ajanki <antti.ajanki@iki.fi>2013-08-08 17:16:00 +0300
committerAntti Ajanki <antti.ajanki@iki.fi>2013-08-08 17:16:00 +0300
commitb3bdb5e6a1515c938fec0661bb56f4b39538195c (patch)
tree874355a1601ed713a8e4dc4e78806862f369fd63 /src/libwebvi/webvicontext.c
parent78e8b44d32231a45086fe3c7e1465e8bb60b871c (diff)
downloadvdr-plugin-webvideo-b3bdb5e6a1515c938fec0661bb56f4b39538195c.tar.gz
vdr-plugin-webvideo-b3bdb5e6a1515c938fec0661bb56f4b39538195c.tar.bz2
Combine quvi and external downloader pipes into a pipe that reads a
menu written by an external shell script (src/menuscripts). Add YLE Areena as an example script (TODO: downloading rtmp streams).
Diffstat (limited to 'src/libwebvi/webvicontext.c')
-rw-r--r--src/libwebvi/webvicontext.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libwebvi/webvicontext.c b/src/libwebvi/webvicontext.c
index 16cba10..c6c43a4 100644
--- a/src/libwebvi/webvicontext.c
+++ b/src/libwebvi/webvicontext.c
@@ -6,6 +6,7 @@
#include "request.h"
#define DEFAULT_TEMPLATE_PATH "/etc/webvi/websites"
+#define DEFAULT_MENU_SCRIPT_PATH "/usr/local/bin/webvi/menuscripts"
#define MAX_MESSAGE_LENGTH 128
struct WebviContext {
@@ -14,6 +15,7 @@ struct WebviContext {
WebviHandle next_request;
CURLM *curl_multi_handle;
gchar *template_path;
+ gchar *menu_script_path;
webvi_timeout_callback timeout_callback;
void *timeout_data;
GArray *finish_messages;
@@ -128,13 +130,24 @@ void webvi_context_set_template_path(WebviContext *self, const char *path) {
if (self->template_path) {
g_free(self->template_path);
}
- self->template_path = path ? g_strdup(path) : NULL;
+ self->template_path = g_strdup(path);
}
const char *webvi_context_get_template_path(const WebviContext *self) {
return self->template_path ? self->template_path : DEFAULT_TEMPLATE_PATH;
}
+void webvi_context_set_menu_script_path(WebviContext *self, const char *path) {
+ if (self->menu_script_path) {
+ g_free(self->menu_script_path);
+ }
+ self->menu_script_path = g_strdup(path);
+}
+
+const char *webvi_context_get_menu_script_path(const WebviContext *self) {
+ return self->menu_script_path ? self->menu_script_path : DEFAULT_MENU_SCRIPT_PATH;
+}
+
const LinkTemplates *get_link_templates(WebviContext *self) {
if (!self->link_templates) {
self->link_templates = link_templates_create();