Keep track of the format the source arrives in. This way MPEG TS output muxes can shourtcut MPEG TS input muxes and avoid the internal PES remuxing

This commit is contained in:
Andreas Öman 2008-01-07 16:36:05 +00:00
parent 4a810182f5
commit 3ffb51dd25
9 changed files with 32 additions and 21 deletions

View file

@ -118,7 +118,7 @@ avgen_init(void)
t->tht_uniquename = strdup("TEST1");
transport_link(t, ch);
transport_link(t, ch, THT_OTHER);
}

View file

@ -239,18 +239,6 @@ service_load(struct config_head *head)
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);
}
/**
*
*/

2
dvb.c
View file

@ -168,7 +168,7 @@ dvb_find_transport(th_dvb_mux_instance_t *tdmi, uint16_t tid,
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;

View file

@ -338,7 +338,7 @@ dvb_configure_transport(th_transport_t *t, const char *muxname,
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;
}

View file

@ -286,7 +286,7 @@ iptv_probe_done(th_transport_t *t, int timeout)
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);

View file

@ -329,9 +329,14 @@ transport_monitor(void *aux, int64_t now)
}
/**
*
*/
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);
@ -339,6 +344,19 @@ transport_monitor_init(th_transport_t *t)
}
/**
*
*/
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)
{

View file

@ -25,11 +25,11 @@ unsigned int transport_compute_weight(struct th_transport_list *head);
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);

View file

@ -442,6 +442,11 @@ typedef struct th_transport {
const char *tht_uniquename;
const char *tht_network;
enum {
THT_MPEG_TS,
THT_OTHER,
} tht_source_type;
} th_transport_t;

2
v4l.c
View file

@ -101,7 +101,7 @@ v4l_configure_transport(th_transport_t *t, const char *muxname,
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;
}