2007-09-29 14:28:03 +00:00
|
|
|
|
/*
|
|
|
|
|
* tvheadend, subscription functions
|
|
|
|
|
* Copyright (C) 2007 Andreas <EFBFBD>man
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef SUBSCRIPTIONS_H
|
|
|
|
|
#define SUBSCRIPTIONS_H
|
|
|
|
|
|
2009-11-18 20:28:35 +00:00
|
|
|
|
#define SUBSCRIPTION_RAW_MPEGTS 0x1
|
|
|
|
|
|
2008-09-03 16:27:37 +00:00
|
|
|
|
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 */
|
|
|
|
|
|
|
|
|
|
char *ths_title; /* display title */
|
|
|
|
|
time_t ths_start; /* time when subscription started */
|
|
|
|
|
int ths_total_err; /* total errors during entire subscription */
|
|
|
|
|
|
2009-06-03 19:06:33 +00:00
|
|
|
|
streaming_target_t ths_input;
|
|
|
|
|
|
|
|
|
|
streaming_target_t *ths_output;
|
2008-09-27 16:48:05 +00:00
|
|
|
|
|
2009-11-18 20:28:35 +00:00
|
|
|
|
int ths_flags;
|
|
|
|
|
|
2008-09-03 16:27:37 +00:00
|
|
|
|
} th_subscription_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Prototypes
|
|
|
|
|
*/
|
2007-09-29 14:28:03 +00:00
|
|
|
|
void subscription_unsubscribe(th_subscription_t *s);
|
|
|
|
|
|
|
|
|
|
void subscription_set_weight(th_subscription_t *s, unsigned int weight);
|
|
|
|
|
|
2008-09-05 22:02:22 +00:00
|
|
|
|
th_subscription_t *subscription_create_from_channel(channel_t *ch,
|
|
|
|
|
unsigned int weight,
|
|
|
|
|
const char *name,
|
2009-11-18 20:28:35 +00:00
|
|
|
|
streaming_target_t *st,
|
|
|
|
|
int flags);
|
2008-09-05 22:02:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
th_subscription_t *subscription_create_from_transport(th_transport_t *t,
|
|
|
|
|
const char *name,
|
2009-11-18 20:28:35 +00:00
|
|
|
|
streaming_target_t *st,
|
|
|
|
|
int flags);
|
2007-09-29 14:28:03 +00:00
|
|
|
|
|
2007-10-27 07:40:30 +00:00
|
|
|
|
void subscription_stop(th_subscription_t *s);
|
|
|
|
|
|
2009-06-03 19:06:33 +00:00
|
|
|
|
void subscription_unlink_transport(th_subscription_t *s);
|
2008-05-02 10:17:22 +00:00
|
|
|
|
|
2009-07-07 18:17:54 +00:00
|
|
|
|
void subscription_dummy_join(const char *id);
|
|
|
|
|
|
2009-07-26 10:11:43 +00:00
|
|
|
|
int subscriptions_active(void);
|
|
|
|
|
|
2007-09-29 14:28:03 +00:00
|
|
|
|
#endif /* SUBSCRIPTIONS_H */
|