summaryrefslogtreecommitdiff
path: root/mcast/common/tools.h
diff options
context:
space:
mode:
authorLars Heer <l.heer@gmx.de>2013-09-18 05:50:03 +0200
committerLars Heer <l.heer@gmx.de>2013-09-18 05:50:03 +0200
commitccf6e0f9c6b0481ed13e0f4794e3fbead750f385 (patch)
treeed86efb54f7ee41edfba5c89ca519b5fd10aa0d5 /mcast/common/tools.h
downloadvdr-plugin-mcli-ccf6e0f9c6b0481ed13e0f4794e3fbead750f385.tar.gz
vdr-plugin-mcli-ccf6e0f9c6b0481ed13e0f4794e3fbead750f385.tar.bz2
added vdr-plugin-mcli-0.0.1+svn20120927
Diffstat (limited to 'mcast/common/tools.h')
-rw-r--r--mcast/common/tools.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/mcast/common/tools.h b/mcast/common/tools.h
new file mode 100644
index 0000000..bdcdf69
--- /dev/null
+++ b/mcast/common/tools.h
@@ -0,0 +1,108 @@
+/*
+ * (c) BayCom GmbH, http://www.baycom.de, info@baycom.de
+ *
+ * See the COPYING file for copyright information and
+ * how to reach the author.
+ *
+ */
+
+#ifndef __TOOLS_H__
+#define __TOOLS_H__
+
+#define PID_MASK 0x1fff
+#define NOPID_MASK 0xe000
+
+#define MC_PREFIX 0xff18
+
+#define NO_SAT_POS 0xfff
+
+// value from sat_resolved
+#define NOT_RESOLVED -1 // Not run through mcg_is_equivalent/satellite_resolver
+#define NOT_SUPPORTED -2 // requested position not available
+#define LEGACY_DISEQC -3
+
+
+#define COMPRESSION_ON 1
+#define COMPRESSION_OFF 0
+
+struct lookup_dvb_t_fec
+{
+ int fec_hp;
+ int fec_lp;
+ int val;
+};
+
+typedef struct
+{
+ char *name;
+ int value;
+} Param;
+
+typedef enum
+{
+ STREAMING_TCA = 1,
+ STREAMING_TRA = 2,
+ STREAMING_PID = 3,
+ STREAMING_TEN = 4,
+ STREAMING_LOG = 5,
+} streaming_group_t;
+
+
+// 8=max. tuner slots (some safety)
+#define MAX_TUNER_CACHE 8
+
+// contains parsed/cached FE params
+
+
+struct sat_cache {
+ int resolved; // -1=not resolved
+ int num;
+ int component;
+};
+
+struct mcg_data {
+ struct in6_addr mcg;
+ fe_type_t type;
+ recv_sec_t sec;
+ int vpid;
+ struct dvb_frontend_parameters fep;
+ int satpos;
+ // Small temporary cache for SAT-resolution
+ struct sat_cache sat_cache[MAX_TUNER_CACHE];
+};
+
+void print_fe_info (struct dvb_frontend_info *fe_info);
+void print_mcg (struct in6_addr *mcg);
+void print_frontend_settings (struct dvb_frontend_parameters *fe_parms);
+
+DLL_SYMBOL void fe_parms_to_mcg (struct in6_addr *mcg, streaming_group_t StreamingGroup, fe_type_t type, recv_sec_t * sec, struct dvb_frontend_parameters *fep, int vpid);
+DLL_SYMBOL int mcg_to_fe_parms (struct in6_addr *mcg, fe_type_t * type, recv_sec_t * sec, struct dvb_frontend_parameters *fep, int *vpid);
+DLL_SYMBOL int mcg_to_all_parms(struct in6_addr *mcg, struct mcg_data * mcd);
+
+DLL_SYMBOL void mcg_set_streaming_group (struct in6_addr *mcg, streaming_group_t StreamingGroup);
+DLL_SYMBOL void mcg_get_streaming_group (struct in6_addr *mcg, streaming_group_t *StreamingGroup);
+DLL_SYMBOL void mcg_init_streaming_group (struct in6_addr *mcg, streaming_group_t StreamingGroup);
+
+DLL_SYMBOL void mcg_set_pid (struct in6_addr *mcg, int pid);
+DLL_SYMBOL void mcg_get_pid (struct in6_addr *mcg, int *pid);
+
+DLL_SYMBOL void mcg_get_priority (struct in6_addr *mcg, int *priority);
+DLL_SYMBOL void mcg_set_priority (struct in6_addr *mcg, int priority);
+
+DLL_SYMBOL void mcg_get_satpos (struct in6_addr *mcg, int *satpos);
+DLL_SYMBOL void mcg_set_satpos (struct in6_addr *mcg, int satpos);
+
+DLL_SYMBOL void mcg_get_id (struct in6_addr *mcg, int *id);
+DLL_SYMBOL void mcg_set_id (struct in6_addr *mcg, int id);
+
+
+int gzip (Bytef * dest, unsigned int *destLen, const Bytef * source, unsigned int sourceLen, int level);
+int gunzip (Bytef * dest, unsigned int *destLen, const Bytef * source, unsigned int sourceLen);
+void print_trace (void);
+void SignalHandlerCrash(int signum);
+
+int syslog_init(void);
+int syslog_write(char *s);
+void syslog_exit(void);
+
+#endif