MAN = tvheadend.1
CFLAGS += -g -Wall -Werror -O2 -mmmx
CFLAGS += -I$(INCLUDES_INSTALL_BASE) $(HTS_CFLAGS) -I$(CURDIR)
-CFLAGS += -Wno-deprecated-declarations
+CFLAGS += -Wno-deprecated-declarations -Wmissing-prototypes
CFLAGS += -D_LARGEFILE64_SOURCE
CFLAGS += -DENABLE_INPUT_IPTV -DENABLE_INPUT_DVB -DENABLE_INPUT_V4L
LDFLAGS += -L$(LIBS_INSTALL_BASE)
/**
*
*/
-access_entry_t *
+static access_entry_t *
access_add_network(const char *prefix)
{
access_entry_t *ae;
/**
*
*/
-access_entry_t *
+static access_entry_t *
access_add_user(const char *username)
{
access_entry_t *ae;
*
* Group is given by 'tag' as an ASCII string in remain
*/
-int
+static int
ajax_channel_tab(http_connection_t *hc, http_reply_t *hr,
const char *remain, void *opaque)
{
/**
*
*/
-const char *
+static const char *
nicenum(unsigned int v)
{
static char buf[4][30];
/**
*
*/
-int
+static int
ajax_transport_op(http_connection_t *hc, http_reply_t *hr,
const char *remain, void *opaque)
{
/**
*
*/
-int
+static int
ajax_transport_chdisable(http_connection_t *hc, http_reply_t *hr,
const char *remain, void *opaque)
{
#include "transports.h"
#include "epg_xmltv.h"
#include "dvb_support.h"
+#include "ajaxui_mailbox.h"
#define MAILBOX_UNUSED_TIMEOUT 15
#define MAILBOX_EMPTY_REPLY_TIMEOUT 10
void
-ajax_mailbox_xmltv_grabber_status_change(xmltv_grabber_t *xg, int status)
+ajax_mailbox_xmltv_grabber_status_change(xmltv_grabber_t *xg)
{
char buf[500];
#include "tcp.h"
-int ajax_mailbox_create(const char *subscriptionid);
-
void ajax_mailbox_tdmi_state_change(th_dvb_mux_instance_t *tdmi);
void ajax_mailbox_tdmi_qual_change(th_dvb_mux_instance_t *tdmi);
/**
* return 1 if the event 'e' is matched by the autorec rule 'ar'
*/
-int
+static int
autorec_cmp(autorec_t *ar, event_t *e)
{
if(ar->ar_ch != NULL && ar->ar_ch != e->e_ch)
#include <pthread.h>
#include <assert.h>
+#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "ffdecsa/FFdecsa.h"
#include "dispatch.h"
#include "transports.h"
+#include "cwc.h"
#define CWC_KEEPALIVE_INTERVAL 600
/**
*
*/
-void
+static void
cwc_table_input(struct th_descrambler *td, struct th_transport *t,
struct th_stream *st, uint8_t *data, int len)
{
#define DISPATCH_ERR 0x4
#define DISPATCH_PRI 0x8
-extern inline int64_t
+static inline int64_t
getclock_hires(void)
{
int64_t now;
void *aux, int64_t t);
-extern inline void
+static inline void
dtimer_disarm(dtimer_t *ti)
{
if(ti->dti_callback) {
/**
* Helper for preparing a section filter parameter struct
*/
-struct dmx_sct_filter_params *
+static struct dmx_sct_filter_params *
dvb_fparams_alloc(int pid, int flags)
{
struct dmx_sct_filter_params *p;
e->e_desc = strdup(desc);
}
-void
+static void
epg_event_set_content_type(event_t *e, epg_content_type_t *ect)
{
if(e->e_content_type != NULL)
/* Notify clients that a new programme is on */
- clients_send_ref(ch->ch_tag);
-
htsp_async_channel_update(ch);
if(e == NULL)
#include "channels.h"
#include "epg.h"
#include "epg_xmltv.h"
-#include "refstr.h"
#include "spawn.h"
#include "intercom.h"
#include "notify.h"
/**
*
*/
-void
+static void
xmltv_grabber_enqueue(xmltv_grabber_t *xg)
{
pthread_mutex_lock(&xmltv_work_lock);
}
//-----get control words
-
+#if 0
void get_control_words(void *keys, unsigned char *even, unsigned char *odd){
memcpy(even,&((struct csa_keys_t *)keys)->even.ck,8);
memcpy(odd,&((struct csa_keys_t *)keys)->odd.ck,8);
}
+#endif
//----- decrypt
#ifdef STREAM_INIT
-void stream_cypher_group_init(
+static void stream_cypher_group_init(
struct stream_regs *regs,
group iA[8][4], // [In] iA00,iA01,...iA73 32 groups | Derived from key.
group iB[8][4], // [In] iB00,iB01,...iB73 32 groups | Derived from key.
unsigned char *sb) // [In] (SB0,SB1,...SB7)...x32 32*8 bytes | Extra input.
#endif
#ifdef STREAM_NORMAL
-void stream_cypher_group_normal(
+static void stream_cypher_group_normal(
struct stream_regs *regs,
unsigned char *cb) // [Out] (CB0,CB1,...CB7)...x32 32*8 bytes | Output.
#endif
#include "buffer.h"
#include "tsmux.h"
#include "tcp.h"
+#include "htsclient.h"
LIST_HEAD(client_list, client);
-static void client_status_update(void *aux, int64_t now);
+void client_status_update(void *aux, int64_t now);
#define cprintf(c, fmt...) tcp_printf(&(c)->c_tcp_session, fmt)
-void
+static void
client_output_ts(void *opaque, th_subscription_t *s,
uint8_t *pkt, int blocks, int64_t pcr)
{
}
-
-/*
- *
- *
- */
-
-void
-clients_send_ref(int ref)
-{
- client_t *c;
- char buf[10];
- uint32_t v = htonl(ref);
- struct sockaddr_in sin;
-
- buf[0] = HTSTV_REFTAG;
- memcpy(buf + 1, &v, sizeof(uint32_t));
-
- LIST_FOREACH(c, &all_clients, c_global_link) {
- if(c->c_streamfd == -1)
- continue;
-
- sin.sin_family = AF_INET;
- sin.sin_port = htons(c->c_port);
- sin.sin_addr = c->c_ipaddr;
-
- sendto(c->c_streamfd, buf, 5, 0,
- (struct sockaddr *)&sin, sizeof(sin));
- }
-}
-
/*
*
*/
*
*/
-int
+static int
cr_channel_unsubscribe(client_t *c, char **argv, int argc)
{
th_subscription_t *s;
/*
*
*/
-int
+static int
cr_channel_subscribe(client_t *c, char **argv, int argc)
{
th_channel_t *ch;
*
*/
-int
+static int
cr_channels_list(client_t *c, char **argv, int argc)
{
th_channel_t *ch;
*
*/
-int
+static int
cr_streamport(client_t *c, char **argv, int argc)
{
if(argc < 2)
TAILQ_INIT(&c->c_refq);
LIST_INSERT_HEAD(&all_clients, c, c_global_link);
c->c_streamfd = -1;
- dtimer_arm(&c->c_status_timer, client_status_update, c, 1);
break;
case TCP_DISCONNECT:
htsclient_tcp_callback);
}
-
-
-
-
-
-
-
-
-
-/*
- * Periodically send status updates to client (on stream 2)
- */
-static void
-csprintf(client_t *c, th_channel_t *ch, const char *fmt, ...)
-{
- va_list ap;
- char buf[1000];
- struct sockaddr_in sin;
-
- memset(&sin, 0, sizeof(sin));
-
- buf[0] = HTSTV_STATUS;
- buf[1] = ch->ch_index;
-
- va_start(ap, fmt);
- vsnprintf(buf + 2, sizeof(buf) - 2, fmt, ap);
- va_end(ap);
-
- sin.sin_family = AF_INET;
- sin.sin_port = htons(c->c_port);
- sin.sin_addr = c->c_ipaddr;
-
- sendto(c->c_streamfd, buf, strlen(buf + 2) + 2, 0,
- (struct sockaddr *)&sin, sizeof(sin));
-}
-
-
-static void
-client_status_update(void *aux, int64_t now)
-{
- client_t *c = aux;
- th_channel_t *ch;
- th_subscription_t *s;
- th_transport_t *t;
-
- dtimer_arm(&c->c_status_timer, client_status_update, c, 1);
-
- LIST_FOREACH(s, &c->c_subscriptions, ths_subscriber_link) {
-
- ch = s->ths_channel;
- t = s->ths_transport;
-
- if(t == NULL) {
- csprintf(c, ch,
- "status = 0\n"
- "info = No transport available");
- continue;
- }
-
- csprintf(c, ch,
- "status = 0\n"
- "info = Running");
- }
-}
void clients_send_ref(int ref);
-void client_status_update(void);
-
#endif /* HTSCLIENT_H_ */
/**
* Output MPEG TS
*/
-void
+static void
iptv_output_ts(void *opaque, th_subscription_t *s, uint8_t *pkt,
int blocks, int64_t pcr)
{
#define _XOPEN_SOURCE
#include <unistd.h>
+char *cwc_krypt(const char *key, const char *salt);
+
char *
cwc_krypt(const char *key, const char *salt)
{
#include "subscriptions.h"
#include "psi.h"
#include "buffer.h"
-
+#include "mux.h"
* TS Muxer
*/
th_muxer_t *
-muxer_init(th_subscription_t *s, th_mux_output_t *cb, void *opaque,
- int flags)
+muxer_init(th_subscription_t *s, th_mux_output_t *cb, void *opaque)
{
th_transport_t *t = s->ths_transport;
th_stream_t *st;
{
event_t *e;
- clients_send_ref(pvrr->pvrr_ref);
e = epg_event_find_by_time(pvrr->pvrr_channel, pvrr->pvrr_start);
- if(e != NULL)
- clients_send_ref(e->e_tag);
}
pvr_fsm(pvrr);
pvr_database_save(pvrr);
- clients_send_ref(-1);
return 0;
}
}
pvr_inform_status_change(pvrr);
- clients_send_ref(-1);
}
#include "tcp.h"
#include "http.h"
#include "access.h"
+#include "rtsp.h"
#include <libavutil/random.h>
-int
+static int
str_is_tt_clock(const char *str)
{
return
*
*/
-void
+static void
transport_flush_subscribers(th_transport_t *t)
{
th_subscription_t *s;
#include <libhts/htscfg.h>
#include <libhts/avg.h>
#include <libhts/hts_strtab.h>
-#include "refstr.h"
#include <libavcodec/avcodec.h>
/*
#define EVENT_SRC_XMLTV 1
#define EVENT_SRC_DVB 2
- refstr_t *e_icon;
-
} event_t;
config_entry_t *find_mux_config(const char *muxtype, const char *muxname);
extern const char *sys_warning;
extern th_channel_group_t *defgroup;
-extern inline unsigned int tvh_strhash(const char *s, unsigned int mod)
+static inline unsigned int tvh_strhash(const char *s, unsigned int mod)
{
unsigned int v = 5381;
while(*s)
* Function for delivery of data.
* We try to respond to any pending read
*/
-void
+static void
xbmsp_output_file(void *opaque)
{
xbmsp_subscrption_t *xs = opaque;
/**
*
*/
-th_channel_group_t *
+static th_channel_group_t *
xbmsp_cur_channel_group(xbmsp_t *xbmsp)
{
th_channel_group_t *tcg;
/**
* xbmsp_cdup() - Change to one directory up (cd ..)
*/
-const char *
+static const char *
xbmsp_cdup(xbmsp_t *xbmsp)
{
char *wd = xbmsp->xbmsp_wd;
/**
* xbmsp_cdroot() - Change to root (cd /)
*/
-const char *
+static const char *
xbmsp_cdroot(xbmsp_t *xbmsp)
{
free(xbmsp->xbmsp_wd);
/**
* xbmsp_cddown() - Change to root (cd dir)
*/
-const char *
+static const char *
xbmsp_cddown(xbmsp_t *xbmsp, const char *dir)
{
th_channel_group_t *tcg;