t->tht_uniquename = strdup("TEST1");
- transport_link(t, ch);
+ transport_link(t, ch, THT_OTHER);
}
free(t);
}
-/**
- *
- */
-void
-transport_link(th_transport_t *t, th_channel_t *ch)
-{
- transport_set_channel(t, ch);
- transport_monitor_init(t);
- LIST_INSERT_HEAD(&all_transports, t, tht_global_link);
-}
-
-
/**
*
*/
return NULL;
t = calloc(1, sizeof(th_transport_t));
- transport_monitor_init(t);
+ transport_init(t, THT_MPEG_TS);
t->tht_dvb_transport_id = tid;
t->tht_dvb_service_id = sid;
t->tht_dvb_mux = tdm;
t->tht_name = strdup(tdm->tdm_title);
- transport_link(t, channel_find(channel_name, 1, NULL));
+ transport_link(t, channel_find(channel_name, 1, NULL), THT_MPEG_TS);
return 0;
}
iptv_stop_feed(t);
if(!timeout)
- transport_link(t, t->tht_channel);
+ transport_link(t, t->tht_channel, THT_MPEG_TS);
else
LIST_INSERT_HEAD(&iptv_stale_transports, t, tht_adapter_link);
}
+/**
+ *
+ */
void
-transport_monitor_init(th_transport_t *t)
+transport_init(th_transport_t *t, int source_type)
{
+ t->tht_source_type = source_type;
+
avgstat_init(&t->tht_cc_errors, 3600);
avgstat_init(&t->tht_rate, 10);
}
+/**
+ *
+ */
+void
+transport_link(th_transport_t *t, th_channel_t *ch, int source_type)
+{
+ transport_set_channel(t, ch);
+ transport_init(t, source_type);
+ LIST_INSERT_HEAD(&all_transports, t, tht_global_link);
+}
+
+
+
th_stream_t *
transport_add_stream(th_transport_t *t, int pid, tv_streamtype_t type)
{
void transport_stop(th_transport_t *t, int flush_subscriptions);
-void transport_monitor_init(th_transport_t *t);
+void transport_init(th_transport_t *t, int source_type);
-int transport_set_channel(th_transport_t *th, th_channel_t *ch);
+void transport_link(th_transport_t *t, th_channel_t *ch, int source_type);
-void transport_link(th_transport_t *t, th_channel_t *ch);
+int transport_set_channel(th_transport_t *t, th_channel_t *ch);
th_transport_t *transport_find(th_channel_t *ch, unsigned int weight);
const char *tht_uniquename;
const char *tht_network;
+ enum {
+ THT_MPEG_TS,
+ THT_OTHER,
+ } tht_source_type;
+
} th_transport_t;
snprintf(buf, sizeof(buf), "ANALOG:%u", t->tht_v4l_frequency);
t->tht_uniquename = strdup(buf);
- transport_link(t, channel_find(channel_name, 1, NULL));
+ transport_link(t, channel_find(channel_name, 1, NULL), THT_OTHER);
return 0;
}