]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
remove (the unused) plugin framework
authorAndreas Öman <andreas@lonelycoder.com>
Sat, 12 Jan 2008 07:39:23 +0000 (07:39 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sat, 12 Jan 2008 07:39:23 +0000 (07:39 +0000)
Makefile
plugin.c [deleted file]
plugin.h [deleted file]
tsdemux.c

index facc62b6961a16943517c8bf4b580b8c8869a16b..4a59c6b6686fb1e96150f2978da22b344ef2effe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 -include ../config.mak
 
 SRCS = main.c dispatch.c channels.c transports.c teletext.c psi.c \
-       subscriptions.c tsmux.c tsdemux.c pes.c buffer.c tcp.c plugin.c \
+       subscriptions.c tsmux.c tsdemux.c pes.c buffer.c tcp.c \
        resolver.c
 
 SRCS += http.c htmlui.c
diff --git a/plugin.c b/plugin.c
deleted file mode 100644 (file)
index 144c3e6..0000000
--- a/plugin.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- *  tvheadend, Plugin framework
- *  Copyright (C) 2007 Andreas Öman
- *
- *  This program 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
- *  (at your option) any later version.
- *
- *  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <pthread.h>
-#include <assert.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <dlfcn.h>
-#include <dirent.h>
-
-#include "tvhead.h"
-#include "plugin.h"
-
-struct th_plugin_list th_plugins;
-
-/**
- *
- */
-void *
-plugin_aux_create(struct pluginaux_list *h, struct th_plugin *p, size_t siz)
-{
-  pluginaux_t *pa;
-
-  pa = calloc(1, siz);
-  pa->pa_plugin = p;
-  LIST_INSERT_HEAD(h, pa, pa_link);
-  return pa;
-}
-
-
-/**
- *
- */
-void *
-plugin_aux_find(struct pluginaux_list *h, struct th_plugin *p)
-{
-  pluginaux_t *pa;
-
-  LIST_FOREACH(pa, h, pa_link)
-    if(pa->pa_plugin == p)
-      break;
-
-  return pa;
-}
-
-/**
- *
- */
-void
-plugin_aux_destroy(void *pa)
-{
-  pluginaux_t *pa0 = pa;
-  LIST_REMOVE(pa0, pa_link);
-  free(pa);
-}
-
-/**
- *
- */
-th_plugin_t *
-plugin_alloc(const char *name, void *opaque, size_t minsiz)
-{
-  th_plugin_t *p;
-
-  if(sizeof(th_plugin_t) < minsiz)
-    return NULL;
-
-  p = calloc(1, sizeof(th_plugin_t));
-
-  p->thp_name = strdup(name);
-  p->thp_opaque = opaque;
-
-  LIST_INSERT_HEAD(&th_plugins, p, thp_link);
-
-  return p;
-}
-
-/**
- *
- */
-void
-plugin_init(void)
-{
-  const char *path;
-  char file[400];
-  DIR *dir;
-  struct dirent *d;
-  char *c;
-  void *h;
-
-  void (*ini)(void);
-
-  if((path = config_get_str("plugins", NULL)) == NULL)
-    return;
-
-  if((dir = opendir(path)) == NULL)
-    return;
-
-  while((d = readdir(dir)) != NULL) {
-    if(d->d_name[0] == '.')
-      continue;
-    
-    if((c = strrchr(d->d_name, '.')) == NULL)
-      continue;
-    
-    if(strcmp(c, ".so"))
-      continue;
-    
-    snprintf(file, sizeof(file), "%s/%s", path, d->d_name);
-
-    h = dlopen(file, RTLD_NOW | RTLD_LOCAL);
-    if(h == NULL) {
-      syslog(LOG_ERR, "%s", dlerror());
-      continue;
-    }
-
-    ini = dlsym(h, "plugin_init");
-    if(ini == NULL) {
-      syslog(LOG_ERR, "Plugin \"%s\" lacks init function", file);
-      continue;
-    }
-
-    ini();
-  }
-  closedir(dir);
-}
diff --git a/plugin.h b/plugin.h
deleted file mode 100644 (file)
index b615734..0000000
--- a/plugin.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *  tvheadend, Plugin framework
- *  Copyright (C) 2007 Andreas Öman
- *
- *  This program 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
- *  (at your option) any later version.
- *
- *  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef PLUGIN_H_
-#define PLUGIN_H_
-
-#include "tvhead.h"
-
-LIST_HEAD(th_plugin_list, th_plugin);
-
-extern struct th_plugin_list th_plugins;
-struct th_plugin;
-
-typedef struct th_plugin {
-  
-  LIST_ENTRY(th_plugin) thp_link;
-
-  void *thp_opaque;
-
-  const char *thp_name;
-
-  void (*thp_transport_start)(struct th_plugin *p, struct pluginaux_list *h, 
-                             th_transport_t *t);
-
-  void (*thp_transport_stop)(struct th_plugin *p, struct pluginaux_list *h, 
-                            th_transport_t *t);
-
-  void (*thp_psi_table)(struct th_plugin *p, struct pluginaux_list *h, 
-                       th_transport_t *t, struct th_stream *st,
-                       const uint8_t *data, size_t len);
-
-  int (*thp_tsb_process)(pluginaux_t *pa, th_transport_t *t,
-                        struct th_stream *st, uint8_t *tsb);
-  
-} th_plugin_t;
-
-void *plugin_aux_create(struct pluginaux_list *h, struct th_plugin *p,
-                       size_t siz);
-
-void *plugin_aux_find(struct pluginaux_list *h, struct th_plugin *p);
-
-void plugin_aux_destroy(void *pa);
-
-th_plugin_t *plugin_alloc(const char *name, void *opaque, size_t minsiz);
-
-void plugin_init(void);
-
-#endif /* PLUGIN_H_ */
index 67ba42bc76823a21d23085398df7f55ddf6ded0c..2f20c5190ba7bf331d4c0657715e8bdac7dac37b 100644 (file)
--- a/tsdemux.c
+++ b/tsdemux.c
@@ -48,7 +48,6 @@
 #include "psi.h"
 #include "buffer.h"
 #include "tsdemux.h"
-#include "plugin.h"
 
 static int 
 ts_reassembly_pes(th_transport_t *t, th_stream_t *st, uint8_t *data, int len)