diff --git a/channels.h b/channels.h index ba1c216c..9f78f0b4 100644 --- a/channels.h +++ b/channels.h @@ -63,8 +63,6 @@ channel_t *channel_find_by_name(const char *name, int create); channel_t *channel_find_by_identifier(int id); -void channel_unsubscribe(th_subscription_t *s); - void channel_set_teletext_rundown(channel_t *ch, int v); void channel_settings_write(channel_t *ch); diff --git a/dvb/dvb_multiplex.c b/dvb/dvb_multiplex.c index 81ce2219..1bbac13e 100644 --- a/dvb/dvb_multiplex.c +++ b/dvb/dvb_multiplex.c @@ -41,7 +41,6 @@ #include "dvb.h" #include "channels.h" #include "transports.h" -#include "subscriptions.h" #include "teletext.h" #include "psi.h" #include "dvb_support.h" diff --git a/subscriptions.h b/subscriptions.h index ecb22488..db2f8d65 100644 --- a/subscriptions.h +++ b/subscriptions.h @@ -19,6 +19,68 @@ #ifndef SUBSCRIPTIONS_H #define SUBSCRIPTIONS_H + + +/* + * Subscription + */ + +typedef enum { + TRANSPORT_AVAILABLE, + TRANSPORT_UNAVAILABLE, +} subscription_event_t; + +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 void (subscription_status_callback_t)(struct th_subscription *s, + int status, + void *opaque); + +typedef struct th_subscription { + LIST_ENTRY(th_subscription) ths_global_link; + int ths_weight; + + LIST_ENTRY(th_subscription) ths_channel_link; + struct channel *ths_channel; /* May be NULL if channel has been + destroyed during the + subscription */ + + LIST_ENTRY(th_subscription) ths_transport_link; + struct th_transport *ths_transport; /* if NULL, ths_transport_link + is not linked */ + + LIST_ENTRY(th_subscription) ths_subscriber_link; /* Caller is responsible + for this link */ + + char *ths_title; /* display title */ + time_t ths_start; /* time when subscription started */ + int ths_total_err; /* total errors during entire subscription */ + + subscription_callback_t *ths_callback; + void *ths_opaque; + uint32_t ths_u32; + + subscription_raw_input_t *ths_raw_input; + + th_muxer_t *ths_muxer; + + subscription_status_callback_t *ths_status_callback; + +} th_subscription_t; + + +/** + * Prototypes + */ void subscription_unsubscribe(th_subscription_t *s); void subscription_set_weight(th_subscription_t *s, unsigned int weight); diff --git a/transports.h b/transports.h index b7d9d470..1069592a 100644 --- a/transports.h +++ b/transports.h @@ -20,6 +20,7 @@ #define TRANSPORTS_H #include "channels.h" +#include "subscriptions.h" unsigned int transport_compute_weight(struct th_transport_list *head); diff --git a/tvhead.h b/tvhead.h index 19c09aec..2b77c8be 100644 --- a/tvhead.h +++ b/tvhead.h @@ -753,63 +753,6 @@ typedef struct tt_decoder { - -/* - * Subscription - */ - -typedef enum { - TRANSPORT_AVAILABLE, - TRANSPORT_UNAVAILABLE, -} subscription_event_t; - -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 void (subscription_status_callback_t)(struct th_subscription *s, - int status, - void *opaque); - -typedef struct th_subscription { - LIST_ENTRY(th_subscription) ths_global_link; - int ths_weight; - - LIST_ENTRY(th_subscription) ths_channel_link; - struct channel *ths_channel; /* May be NULL if channel has been - destroyed during the - subscription */ - - LIST_ENTRY(th_subscription) ths_transport_link; - struct th_transport *ths_transport; /* if NULL, ths_transport_link - is not linked */ - - LIST_ENTRY(th_subscription) ths_subscriber_link; /* Caller is responsible - for this link */ - - char *ths_title; /* display title */ - time_t ths_start; /* time when subscription started */ - int ths_total_err; /* total errors during entire subscription */ - - subscription_callback_t *ths_callback; - void *ths_opaque; - uint32_t ths_u32; - - subscription_raw_input_t *ths_raw_input; - - th_muxer_t *ths_muxer; - - subscription_status_callback_t *ths_status_callback; - -} th_subscription_t; - char *utf8toprintable(const char *in); char *utf8tofilename(const char *in); const char *htstvstreamtype2txt(tv_streamtype_t s);