# MPEGTS core
SRCS-$(CONFIG_MPEGTS) += \
+ src/input/mpegts.c \
src/input/mpegts/mpegts_input.c \
src/input/mpegts/mpegts_network.c \
src/input/mpegts/mpegts_mux.c \
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __TVH_API_IDNODE_H__
-#define __TVH_API_IDNODE_H__
-
#include "tvheadend.h"
#include "access.h"
#include "idnode.h"
api_register_all(ah);
}
-
-
-#endif /* __TVH_API_IDNODE_H__ */
SKEL_DECLARE(idclasses_skel, idclass_link_t);
-static void
-idclass_register(const idclass_t *idc);
-
/* **************************************************************************
* Utilities
* *************************************************************************/
return strcmp(a->idc->ic_class, b->idc->ic_class);
}
-static void
+void
idclass_register(const idclass_t *idc)
{
while (idc) {
void idnode_notify_simple (void *in);
void idnode_notify_title_changed (void *in);
+void idclass_register ( const idclass_t *idc );
const idclass_t *idclass_find ( const char *name );
htsmsg_t *idclass_serialize0 (const idclass_t *idc, int optmask);
htsmsg_t *idnode_serialize0 (idnode_t *self, int optmask);
--- /dev/null
+/*
+ * TVheadend
+ * Copyright (C) 2013 Adam Sutton
+ *
+ * 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/>.
+ */
+
+#include "input.h"
+
+void
+mpegts_init ( int linuxdvb_mask, str_list_t *tsfiles, int tstuners )
+{
+ /* Register classes (avoid API 400 errors due to not yet defined) */
+ idclass_register(&mpegts_network_class);
+ idclass_register(&mpegts_mux_class);
+ idclass_register(&mpegts_service_class);
+
+ /* Setup DVB networks */
+#if ENABLE_MPEGTS_DVB
+ dvb_network_init();
+#endif
+
+ /* TS files */
+#if ENABLE_TSFILE
+ if(tsfiles->num) {
+ int i;
+ tsfile_init(tstuners ?: tsfiles->num);
+ for (i = 0; i < tsfiles->num; i++)
+ tsfile_add_file(tsfiles->str[i]);
+ }
+#endif
+
+ /* IPTV */
+#if ENABLE_IPTV
+ iptv_init();
+#endif
+
+ /* Linux DVB */
+#if ENABLE_LINUXDVB
+ linuxdvb_init(linuxdvb_mask);
+#endif
+
+ /* Mux schedulers */
+#if ENABLE_MPEGTS
+ mpegts_mux_sched_init();
+#endif
+
+}
+
+void
+mpegts_done ( void )
+{
+ tvhftrace("main", mpegts_mux_sched_done);
+#if ENABLE_MPEGTS_DVB
+ tvhftrace("main", dvb_network_done);
+#endif
+#if ENABLE_IPTV
+ tvhftrace("main", iptv_done);
+#endif
+#if ENABLE_LINUXDVB
+ tvhftrace("main", linuxdvb_done);
+#endif
+#if ENABLE_TSFILE
+ tvhftrace("main", tsfile_done);
+#endif
+}
+
+/******************************************************************************
+ * Editor Configuration
+ *
+ * vim:sts=2:ts=2:sw=2:et
+ *****************************************************************************/
extern const idclass_t mpegts_service_class;
extern const idclass_t mpegts_input_class;
+/* **************************************************************************
+ * Setup / Tear down
+ * *************************************************************************/
+
+void mpegts_init ( int linuxdvb_mask, str_list_t *tsfiles, int tstuners );
+void mpegts_done ( void );
+
/* **************************************************************************
* Data / SI processing
* *************************************************************************/
pthread_t main_tid;
/* Command line option struct */
-typedef struct str_list
-{
- int max;
- int num;
- char **str;
-} str_list_t;
typedef struct {
const char sopt;
const char *lopt;
service_init();
-#if ENABLE_TSFILE
- if(opt_tsfile.num) {
- tsfile_init(opt_tsfile_tuner ?: opt_tsfile.num);
- for (i = 0; i < opt_tsfile.num; i++)
- tsfile_add_file(opt_tsfile.str[i]);
- }
-#endif
-#if ENABLE_MPEGTS_DVB
- dvb_network_init();
-#endif
-#if ENABLE_IPTV
- iptv_init();
-#endif
-#if ENABLE_LINUXDVB
- linuxdvb_init(adapter_mask);
-#endif
#if ENABLE_MPEGTS
- mpegts_mux_sched_init();
+ mpegts_init(adapter_mask, &opt_tsfile, opt_tsfile_tuner);
#endif
channel_init();
tvhftrace("main", http_client_done);
tvhftrace("main", fsmonitor_done);
#if ENABLE_MPEGTS
- tvhftrace("main", mpegts_mux_sched_done);
-#endif
-#if ENABLE_MPEGTS_DVB
- tvhftrace("main", dvb_network_done);
-#endif
-#if ENABLE_IPTV
- tvhftrace("main", iptv_done);
-#endif
-#if ENABLE_LINUXDVB
- tvhftrace("main", linuxdvb_done);
-#endif
-#if ENABLE_TSFILE
- tvhftrace("main", tsfile_done);
+ tvhftrace("main", mpegts_done);
#endif
// Note: the locking is obviously a bit redundant, but without
return r;
}
+typedef struct str_list
+{
+ int max;
+ int num;
+ char **str;
+} str_list_t;
+
#define PTS_UNSET INT64_C(0x8000000000000000)
extern int tvheadend_running;