From 8692b68a439ad7a62dc4b4c7364d103a914159ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Tue, 20 Nov 2007 08:15:37 +0000 Subject: [PATCH] Allow TS output to get raw data directly from TS inputs --- tsdemux.c | 5 +++++ tvhead.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/tsdemux.c b/tsdemux.c index 9d1584ab..384ebd9e 100644 --- a/tsdemux.c +++ b/tsdemux.c @@ -98,6 +98,7 @@ void ts_recv_packet(th_transport_t *t, int pid, uint8_t *tsb) { th_stream_t *st = NULL; + th_subscription_t *s; int cc, err = 0, afc, afl = 0; int len, pusi; @@ -108,6 +109,10 @@ ts_recv_packet(th_transport_t *t, int pid, uint8_t *tsb) if(st == NULL) return; + LIST_FOREACH(s, &t->tht_subscriptions, ths_transport_link) + if(s->ths_raw_input != NULL) + s->ths_raw_input(s, tsb, 188, st, s->ths_opaque); + avgstat_add(&t->tht_rate, 188, dispatch_clock); afc = (tsb[3] >> 4) & 3; diff --git a/tvhead.h b/tvhead.h index 409d04b8..8eccdc1e 100644 --- a/tvhead.h +++ b/tvhead.h @@ -614,6 +614,11 @@ typedef void (subscription_callback_t)(struct th_subscription *s, subscription_event_t event, void *opaque); +typedef void (subscription_raw_input_t)(struct th_subscription *s, + void *data, int len, + th_stream_t *st, + void *opaque); + typedef struct th_subscription { LIST_ENTRY(th_subscription) ths_global_link; int ths_weight; @@ -635,6 +640,8 @@ typedef struct th_subscription { subscription_callback_t *ths_callback; void *ths_opaque; + subscription_raw_input_t *ths_raw_input; + } th_subscription_t;