t->tht_dvb_transport_id = tid;
t->tht_dvb_service_id = sid;
- t->tht_dvb_mux = tdm;
t->tht_type = TRANSPORT_DVB;
+ t->tht_start_feed = dvb_start_feed;
+ t->tht_stop_feed = dvb_stop_feed;
+ t->tht_dvb_mux = tdm;
+
t->tht_prio = 50;
*
*/
int
-dvb_start_feed(th_transport_t *t, unsigned int weight)
+dvb_start_feed(th_transport_t *t, unsigned int weight, int status)
{
th_dvb_adapter_t *tda;
struct dmx_pes_filter_params dmx_param;
int dvb_dvr_init(th_dvb_adapter_t *tda);
-int dvb_start_feed(th_transport_t *t, unsigned int weight);
+int dvb_start_feed(struct th_transport *t, unsigned int weight, int status);
void dvb_stop_feed(th_transport_t *t);
#include "tvhead.h"
#include "channels.h"
#include "dvb.h"
+#include "dvb_dvr.h"
#include "dvb_muxconfig.h"
#include "strtab.h"
#include "transports.h"
return -1;
t->tht_type = TRANSPORT_DVB;
+ t->tht_start_feed = dvb_start_feed;
+ t->tht_stop_feed = dvb_stop_feed;
t->tht_dvb_mux = tdm;
t->tht_name = strdup(tdm->tdm_title);
}
}
-int
-iptv_start_feed(th_transport_t *t, int status)
+static int
+iptv_start_feed(th_transport_t *t, unsigned int weight, int status)
{
int fd;
struct ip_mreqn m;
return 0;
}
-int
+static void
iptv_stop_feed(th_transport_t *t)
{
if(t->tht_status == TRANSPORT_IDLE)
- return 0;
+ return;
t->tht_status = TRANSPORT_IDLE;
dispatch_delfd(t->tht_iptv_dispatch_handle);
close(t->tht_iptv_fd);
syslog(LOG_ERR, "iptv: \"%s\" left group", t->tht_name);
- return 0;
}
return -1;
t->tht_type = TRANSPORT_IPTV;
-
+ t->tht_start_feed = iptv_start_feed;
+ t->tht_stop_feed = iptv_stop_feed;
+
if((s = config_get_str_sub(head, "group-address", NULL)) == NULL)
return -1;
t->tht_iptv_group_addr.s_addr = inet_addr(s);
iptv_probe_transport(th_transport_t *t)
{
syslog(LOG_INFO, "iptv: Probing transport %s", t->tht_name);
- iptv_start_feed(t, TRANSPORT_PROBING);
+ iptv_start_feed(t, 1, TRANSPORT_PROBING);
}
struct config_head *head,
const char *channel_name);
-int iptv_start_feed(th_transport_t *t, int status);
-
-int iptv_stop_feed(th_transport_t *t);
-
extern struct th_transport_list iptv_probing_transports;
extern struct th_transport_list iptv_stale_transports;
if(LIST_FIRST(&t->tht_subscriptions))
return;
- switch(t->tht_type) {
-#ifdef ENABLE_INPUT_DVB
- case TRANSPORT_DVB:
- dvb_stop_feed(t);
- break;
-#endif
-#ifdef ENABLE_INPUT_IPTV
- case TRANSPORT_IPTV:
- iptv_stop_feed(t);
- break;
-#endif
-#ifdef ENABLE_INPUT_V4L
- case TRANSPORT_V4L:
- v4l_stop_feed(t);
- break;
-#endif
- default:
- break;
- }
+ t->tht_stop_feed(t);
t->tht_tt_commercial_advice = COMMERCIAL_UNKNOWN;
}
}
-
- switch(t->tht_type) {
-#ifdef ENABLE_INPUT_DVB
- case TRANSPORT_DVB:
- return dvb_start_feed(t, weight);
-#endif
-#ifdef ENABLE_INPUT_IPTV
- case TRANSPORT_IPTV:
- return iptv_start_feed(t, TRANSPORT_RUNNING);
-#endif
-#ifdef ENABLE_INPUT_V4L
- case TRANSPORT_V4L:
- return v4l_start_feed(t, weight);
-#endif
- default:
- return 1;
- }
- return 1;
+ return t->tht_start_feed(t, weight, TRANSPORT_RUNNING);
}
LIST_HEAD(, th_subscription) tht_subscriptions;
+ int (*tht_start_feed)(struct th_transport *t, unsigned int weight,
+ int status);
+
+ void (*tht_stop_feed)(struct th_transport *t);
+
struct th_muxer_list tht_muxers; /* muxers */
static void v4l_add_adapter(const char *path);
+static void v4l_stop_feed(th_transport_t *t);
+static int v4l_start_feed(th_transport_t *t, unsigned int weight, int status);
/*
*
return -1;
t->tht_type = TRANSPORT_V4L;
+ t->tht_start_feed = v4l_start_feed;
+ t->tht_stop_feed = v4l_stop_feed;
t->tht_v4l_frequency =
atoi(config_get_str_sub(&ce->ce_sub, "frequency", "0"));
/*
*
*/
-void
+static void
v4l_stop_feed(th_transport_t *t)
{
th_v4l_adapter_t *tva = t->tht_v4l_adapter;
/*
*
*/
-int
-v4l_start_feed(th_transport_t *t, unsigned int weight)
+static int
+v4l_start_feed(th_transport_t *t, unsigned int weight, int status)
{
th_v4l_adapter_t *tva, *cand = NULL;
int w, fd;
int v4l_configure_transport(th_transport_t *t, const char *muxname,
const char *channel_name);
-int v4l_start_feed(th_transport_t *t, unsigned int weight);
-
-void v4l_stop_feed(th_transport_t *t);
-
#endif /* V4L_H */