From eaac42f1becbbcc62317e9bf81e07608aaad62fd Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sun, 12 Jan 2003 23:20:37 +0000 Subject: DVB plugin updated to new api. thanks to Micael Beronius, Chris Purnell for their great work CVS patchset: 3884 CVS date: 2003/01/12 23:20:37 --- src/input/Makefile.am | 4 +- src/input/dvb/Makefile.am | 20 ++ src/input/dvb/dmx.h | 172 +++++++++++++ src/input/dvb/frontend.h | 262 +++++++++++++++++++ src/input/input_dvb.c | 625 +++++++++++++++++++++++++++------------------- src/input/ost/Makefile.am | 22 -- src/input/ost/README | 9 - src/input/ost/ca.h | 84 ------- src/input/ost/demux.h | 346 ------------------------- src/input/ost/dmx.h | 143 ----------- src/input/ost/frontend.h | 211 ---------------- src/input/ost/sec.h | 118 --------- 12 files changed, 826 insertions(+), 1190 deletions(-) create mode 100644 src/input/dvb/Makefile.am create mode 100644 src/input/dvb/dmx.h create mode 100644 src/input/dvb/frontend.h delete mode 100644 src/input/ost/Makefile.am delete mode 100644 src/input/ost/README delete mode 100644 src/input/ost/ca.h delete mode 100644 src/input/ost/demux.h delete mode 100644 src/input/ost/dmx.h delete mode 100644 src/input/ost/frontend.h delete mode 100644 src/input/ost/sec.h (limited to 'src') diff --git a/src/input/Makefile.am b/src/input/Makefile.am index 103c656d8..4985ba18b 100644 --- a/src/input/Makefile.am +++ b/src/input/Makefile.am @@ -3,9 +3,9 @@ ## if HAVE_DVDNAV -SUBDIRS = ost libreal librtsp libdvdread +SUBDIRS = dvb libreal librtsp libdvdread else -SUBDIRS = ost libreal librtsp libdvdread libdvdnav +SUBDIRS = dvb libreal librtsp libdvdread libdvdnav endif LIBTOOL = $(SHELL) $(top_builddir)/libtool-nofpic diff --git a/src/input/dvb/Makefile.am b/src/input/dvb/Makefile.am new file mode 100644 index 000000000..b3682a971 --- /dev/null +++ b/src/input/dvb/Makefile.am @@ -0,0 +1,20 @@ +noinst_HEADERS = \ + dmx.h \ + frontend.h + +debug: + @list='$(SUBDIRS)'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) $@) || exit;\ + done; + @$(MAKE) CFLAGS="$(DEBUG_CFLAGS)" + +install-debug: debug + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +mostlyclean-generic: + -rm -f *~ \#* .*~ .\#* + +maintainer-clean-generic: + -@echo "This command is intended for maintainers to use;" + -@echo "it deletes files that may require special tools to rebuild." + -rm -f Makefile.in diff --git a/src/input/dvb/dmx.h b/src/input/dvb/dmx.h new file mode 100644 index 000000000..1c0f990c7 --- /dev/null +++ b/src/input/dvb/dmx.h @@ -0,0 +1,172 @@ +/* + * dmx.h + * + * Copyright (C) 2000 Marcus Metzler + * & Ralph Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * 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 Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _DMX_H_ +#define _DMX_H_ + +#ifdef __KERNEL__ +#include +#else +#include +#endif + +#define DMX_FILTER_SIZE 16 + +typedef enum +{ + DMX_OUT_DECODER, /* Streaming directly to decoder. */ + DMX_OUT_TAP, /* Output going to a memory buffer */ + /* (to be retrieved via the read command).*/ + DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ + /* (to be retrieved by reading from the */ + /* logical DVR device). */ +} dmx_output_t; + + +typedef enum +{ + DMX_IN_FRONTEND, /* Input from a front-end device. */ + DMX_IN_DVR /* Input from the logical DVR device. */ +} dmx_input_t; + + +typedef enum +{ + DMX_PES_AUDIO0, + DMX_PES_VIDEO0, + DMX_PES_TELETEXT0, + DMX_PES_SUBTITLE0, + DMX_PES_PCR0, + + DMX_PES_AUDIO1, + DMX_PES_VIDEO1, + DMX_PES_TELETEXT1, + DMX_PES_SUBTITLE1, + DMX_PES_PCR1, + + DMX_PES_AUDIO2, + DMX_PES_VIDEO2, + DMX_PES_TELETEXT2, + DMX_PES_SUBTITLE2, + DMX_PES_PCR2, + + DMX_PES_AUDIO3, + DMX_PES_VIDEO3, + DMX_PES_TELETEXT3, + DMX_PES_SUBTITLE3, + DMX_PES_PCR3, + + DMX_PES_OTHER +} dmx_pes_type_t; + +#define DMX_PES_AUDIO DMX_PES_AUDIO0 +#define DMX_PES_VIDEO DMX_PES_VIDEO0 +#define DMX_PES_TELETEXT DMX_PES_TELETEXT0 +#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0 +#define DMX_PES_PCR DMX_PES_PCR0 + + +typedef enum +{ + DMX_SCRAMBLING_EV, + DMX_FRONTEND_EV +} dmx_event_t; + + +typedef enum +{ + DMX_SCRAMBLING_OFF, + DMX_SCRAMBLING_ON +} dmx_scrambling_status_t; + + +typedef struct dmx_filter +{ + uint8_t filter[DMX_FILTER_SIZE]; + uint8_t mask[DMX_FILTER_SIZE]; + uint8_t mode[DMX_FILTER_SIZE]; +} dmx_filter_t; + + +struct dmx_sct_filter_params +{ + uint16_t pid; + dmx_filter_t filter; + uint32_t timeout; + uint32_t flags; +#define DMX_CHECK_CRC 1 +#define DMX_ONESHOT 2 +#define DMX_IMMEDIATE_START 4 +#define DMX_KERNEL_CLIENT 0x8000 +}; + + +struct dmx_pes_filter_params +{ + uint16_t pid; + dmx_input_t input; + dmx_output_t output; + dmx_pes_type_t pes_type; + uint32_t flags; +}; + + +struct dmx_event +{ + dmx_event_t event; + time_t timeStamp; + union + { + dmx_scrambling_status_t scrambling; + } u; +}; + +typedef struct dmx_caps { + uint32_t caps; + int num_decoders; +} dmx_caps_t; + +typedef enum { + DMX_SOURCE_FRONT0 = 0, + DMX_SOURCE_FRONT1, + DMX_SOURCE_FRONT2, + DMX_SOURCE_FRONT3, + DMX_SOURCE_DVR0 = 16, + DMX_SOURCE_DVR1, + DMX_SOURCE_DVR2, + DMX_SOURCE_DVR3 +} dmx_source_t; + + +#define DMX_START _IO('o',41) +#define DMX_STOP _IO('o',42) +#define DMX_SET_FILTER _IOW('o',43,struct dmx_sct_filter_params) +#define DMX_SET_PES_FILTER _IOW('o',44,struct dmx_pes_filter_params) +#define DMX_SET_BUFFER_SIZE _IO('o',45) +#define DMX_GET_EVENT _IOR('o',46,struct dmx_event) +#define DMX_GET_PES_PIDS _IOR('o',47,uint16_t[5]) +#define DMX_GET_CAPS _IOR('o',48,dmx_caps_t) +#define DMX_SET_SOURCE _IOW('o',49,dmx_source_t) + +#endif /*_DMX_H_*/ + diff --git a/src/input/dvb/frontend.h b/src/input/dvb/frontend.h new file mode 100644 index 000000000..550d3b42c --- /dev/null +++ b/src/input/dvb/frontend.h @@ -0,0 +1,262 @@ +/* + * frontend.h + * + * Copyright (C) 2000 Marcus Metzler + * Ralph Metzler + * Holger Waechtler + * Andre Draszik + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * 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 Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _FRONTEND_H_ +#define _FRONTEND_H_ + +#ifdef __KERNEL__ +#include +#else +#include +#endif + + +typedef enum { + FE_QPSK, + FE_QAM, + FE_OFDM +} fe_type_t; + + +typedef enum { + FE_IS_STUPID = 0, + FE_CAN_INVERSION_AUTO = 0x1, + FE_CAN_FEC_1_2 = 0x2, + FE_CAN_FEC_2_3 = 0x4, + FE_CAN_FEC_3_4 = 0x8, + FE_CAN_FEC_4_5 = 0x10, + FE_CAN_FEC_5_6 = 0x20, + FE_CAN_FEC_6_7 = 0x40, + FE_CAN_FEC_7_8 = 0x80, + FE_CAN_FEC_8_9 = 0x100, + FE_CAN_FEC_AUTO = 0x200, + FE_CAN_QPSK = 0x400, + FE_CAN_QAM_16 = 0x800, + FE_CAN_QAM_32 = 0x1000, + FE_CAN_QAM_64 = 0x2000, + FE_CAN_QAM_128 = 0x4000, + FE_CAN_QAM_256 = 0x8000, + FE_CAN_QAM_AUTO = 0x10000, + FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000, + FE_CAN_BANDWIDTH_AUTO = 0x40000, + FE_CAN_GUARD_INTERVAL_AUTO = 0x80000, + FE_CAN_HIERARCHY_AUTO = 0x100000, + FE_CAN_MUTE_TS = 0x80000000, + FE_CAN_CLEAN_SETUP = 0x40000000 +} fe_caps_t; + + +struct dvb_frontend_info { + char name[128]; + fe_type_t type; + uint32_t frequency_min; + uint32_t frequency_max; + uint32_t frequency_stepsize; + uint32_t frequency_tolerance; + uint32_t symbol_rate_min; + uint32_t symbol_rate_max; + uint32_t symbol_rate_tolerance; /* ppm */ + uint32_t notifier_delay; /* ms */ + fe_caps_t caps; +}; + + +/** + * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for + * the meaning of this struct... + */ +struct dvb_diseqc_master_cmd { + uint8_t msg [6]; /* { framing, address, command, data [3] } */ + uint8_t msg_len; /* valid values are 3...6 */ +}; + + +struct dvb_diseqc_slave_reply { + uint8_t msg [4]; /* { framing, data [3] } */ + uint8_t msg_len; /* valid values are 0...4, 0 means no msg */ + int timeout; /* return from ioctl after timeout ms with */ +}; /* errorcode when no message was received */ + + +typedef enum { + SEC_VOLTAGE_13, + SEC_VOLTAGE_18 +} fe_sec_voltage_t; + + +typedef enum { + SEC_TONE_ON, + SEC_TONE_OFF +} fe_sec_tone_mode_t; + + +typedef enum { + SEC_MINI_A, + SEC_MINI_B +} fe_sec_mini_cmd_t; + + +typedef enum { + FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ + FE_HAS_CARRIER = 0x02, /* found a DVB signal */ + FE_HAS_VITERBI = 0x04, /* FEC is stable */ + FE_HAS_SYNC = 0x08, /* found sync bytes */ + FE_HAS_LOCK = 0x10, /* everything's working... */ + FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ + FE_REINIT = 0x40 /* frontend was reinitialized, */ +} fe_status_t; /* application is recommned to reset */ + /* DiSEqC, tone and parameters */ + +typedef enum { + INVERSION_OFF, + INVERSION_ON, + INVERSION_AUTO +} fe_spectral_inversion_t; + + +typedef enum { + FEC_NONE = 0, + FEC_1_2, + FEC_2_3, + FEC_3_4, + FEC_4_5, + FEC_5_6, + FEC_6_7, + FEC_7_8, + FEC_8_9, + FEC_AUTO +} fe_code_rate_t; + + +typedef enum { + QPSK, + QAM_16, + QAM_32, + QAM_64, + QAM_128, + QAM_256, + QAM_AUTO +} fe_modulation_t; + + +typedef enum { + TRANSMISSION_MODE_2K, + TRANSMISSION_MODE_8K, + TRANSMISSION_MODE_AUTO +} fe_transmit_mode_t; + +typedef enum { + BANDWIDTH_8_MHZ, + BANDWIDTH_7_MHZ, + BANDWIDTH_6_MHZ, + BANDWIDTH_AUTO +} fe_bandwidth_t; + + +typedef enum { + GUARD_INTERVAL_1_32, + GUARD_INTERVAL_1_16, + GUARD_INTERVAL_1_8, + GUARD_INTERVAL_1_4, + GUARD_INTERVAL_AUTO +} fe_guard_interval_t; + + +typedef enum { + HIERARCHY_NONE, + HIERARCHY_1, + HIERARCHY_2, + HIERARCHY_4, + HIERARCHY_AUTO +} fe_hierarchy_t; + + +struct dvb_qpsk_parameters { + uint32_t symbol_rate; /* symbol rate in Symbols per second */ + fe_code_rate_t fec_inner; /* forward error correction (see above) */ +}; + + +struct dvb_qam_parameters { + uint32_t symbol_rate; /* symbol rate in Symbols per second */ + fe_code_rate_t fec_inner; /* forward error correction (see above) */ + fe_modulation_t modulation; /* modulation type (see above) */ +}; + + +struct dvb_ofdm_parameters { + fe_bandwidth_t bandwidth; + fe_code_rate_t code_rate_HP; /* high priority stream code rate */ + fe_code_rate_t code_rate_LP; /* low priority stream code rate */ + fe_modulation_t constellation; /* modulation type (see above) */ + fe_transmit_mode_t transmission_mode; + fe_guard_interval_t guard_interval; + fe_hierarchy_t hierarchy_information; +}; + + +struct dvb_frontend_parameters { + uint32_t frequency; /* (absolute) frequency in Hz for QAM/OFDM */ + /* intermediate frequency in kHz for QPSK */ + fe_spectral_inversion_t inversion; + union { + struct dvb_qpsk_parameters qpsk; + struct dvb_qam_parameters qam; + struct dvb_ofdm_parameters ofdm; + } u; +}; + + +struct dvb_frontend_event { + fe_status_t status; + struct dvb_frontend_parameters parameters; +}; + + + +#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) + +#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) +#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd) +#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply) +#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */ + +#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */ +#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */ +#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */ + +#define FE_READ_STATUS _IOR('o', 69, fe_status_t) +#define FE_READ_BER _IOR('o', 70, uint32_t) +#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, uint16_t) +#define FE_READ_SNR _IOR('o', 72, uint16_t) +#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, uint32_t) + +#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) +#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) +#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) + + +#endif /*_FRONTEND_H_*/ + diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 4bf69b4cd..7dd052e54 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2002 the xine project + * Copyright (C) 2000-2003 the xine project * * This file is part of xine, a free video player. * @@ -38,9 +38,9 @@ #include #include -#include "ost/dmx.h" -#include "ost/sec.h" -#include "ost/frontend.h" +/* These will eventually be #include */ +#include "dvb/dmx.h" +#include "dvb/frontend.h" #include "xine_internal.h" #include "xineutils.h" @@ -51,43 +51,34 @@ #define LOG */ -#define FRONTEND_DEVICE "/dev/ost/frontend" -#define SEC_DEVICE "/dev/ost/sec" -#define DEMUX_DEVICE "/dev/ost/demux" -#define DVR_DEVICE "/dev/ost/dvr" +#define FRONTEND_DEVICE "/dev/dvb/adapter0/frontend0" +#define DEMUX_DEVICE "/dev/dvb/adapter0/demux0" +#define DVR_DEVICE "/dev/dvb/adapter0/dvr0" #define BUFSIZE 4096 #define NOPID 0xffff typedef struct { - int fd_frontend; - int fd_sec; - int fd_demuxa, fd_demuxv, fd_demuxtt; + int fd_frontend; + int fd_demuxa, fd_demuxv; - FrontendInfo feinfo; - FrontendParameters front_param; + struct dvb_frontend_info feinfo; - struct secCommand scmd; - struct secCmdSequence scmds; - struct dmxPesFilterParams pesFilterParamsV; - struct dmxPesFilterParams pesFilterParamsA; - struct dmxPesFilterParams pesFilterParamsTT; + struct dmx_pes_filter_params pesFilterParamsV; + struct dmx_pes_filter_params pesFilterParamsA; } tuner_t; typedef struct { char *name; - int freq; /* freq - lof */ - int tone; /* SEC_TONE_ON/OFF */ - int volt; /* SC_VOLTAGE_13/18 */ - int diseqcnr; - int srate; - int fec; - int vpid; - int apid; - + struct dvb_frontend_parameters front_param; + int vpid; + int apid; + int sat_no; + int tone; + int pol; } channel_t; typedef struct { @@ -106,13 +97,13 @@ typedef struct { dvb_input_class_t *cls; xine_stream_t *stream; - + char *mrl; off_t curpos; nbc_t *nbc; - + tuner_t *tuner; channel_t *channels; int fd; @@ -127,10 +118,84 @@ typedef struct { /* scratch buffer for forward seeking */ char seek_buf[BUFSIZE]; - int out_fd; /* recording function */ - } dvb_input_plugin_t; +typedef struct { + char *name; + int value; +} Param; + +static const Param inversion_list [] = { + { "INVERSION_OFF", INVERSION_OFF }, + { "INVERSION_ON", INVERSION_ON }, + { "INVERSION_AUTO", INVERSION_AUTO }, + { NULL, 0 } +}; + +static const Param bw_list [] = { + { "BANDWIDTH_6_MHZ", BANDWIDTH_6_MHZ }, + { "BANDWIDTH_7_MHZ", BANDWIDTH_7_MHZ }, + { "BANDWIDTH_8_MHZ", BANDWIDTH_8_MHZ }, + { NULL, 0 } +}; + +static const Param fec_list [] = { + { "FEC_1_2", FEC_1_2 }, + { "FEC_2_3", FEC_2_3 }, + { "FEC_3_4", FEC_3_4 }, + { "FEC_4_5", FEC_4_5 }, + { "FEC_5_6", FEC_5_6 }, + { "FEC_6_7", FEC_6_7 }, + { "FEC_7_8", FEC_7_8 }, + { "FEC_8_9", FEC_8_9 }, + { "FEC_AUTO", FEC_AUTO }, + { "FEC_NONE", FEC_NONE }, + { NULL, 0 } +}; + +static const Param guard_list [] = { + {"GUARD_INTERVAL_1_16", GUARD_INTERVAL_1_16}, + {"GUARD_INTERVAL_1_32", GUARD_INTERVAL_1_32}, + {"GUARD_INTERVAL_1_4", GUARD_INTERVAL_1_4}, + {"GUARD_INTERVAL_1_8", GUARD_INTERVAL_1_8}, + { NULL, 0 } +}; + +static const Param hierarchy_list [] = { + { "HIERARCHY_1", HIERARCHY_1 }, + { "HIERARCHY_2", HIERARCHY_2 }, + { "HIERARCHY_4", HIERARCHY_4 }, + { "HIERARCHY_NONE", HIERARCHY_NONE }, + { NULL, 0 } +}; + +static const Param qam_list [] = { + { "QPSK", QPSK }, + { "QAM_128", QAM_128 }, + { "QAM_16", QAM_16 }, + { "QAM_256", QAM_256 }, + { "QAM_32", QAM_32 }, + { "QAM_64", QAM_64 }, + { NULL, 0 } +}; + +static const Param transmissionmode_list [] = { + { "TRANSMISSION_MODE_2K", TRANSMISSION_MODE_2K }, + { "TRANSMISSION_MODE_8K", TRANSMISSION_MODE_8K }, + { NULL, 0 } +}; + +static void tuner_dispose (tuner_t *this) { + + if (this->fd_frontend >= 0) + close (this->fd_frontend); + if (this->fd_demuxa >= 0) + close (this->fd_demuxa); + if (this->fd_demuxv >= 0) + close (this->fd_demuxv); + + free (this); +} static tuner_t *tuner_init () { @@ -138,69 +203,52 @@ static tuner_t *tuner_init () { this = malloc (sizeof (tuner_t)); + this->fd_frontend = -1; + this->fd_demuxa = -1; + this->fd_demuxv = -1; + if ((this->fd_frontend = open(FRONTEND_DEVICE, O_RDWR)) < 0){ - perror("FRONTEND DEVICE: "); - free (this); + perror("FRONTEND DEVICE"); + tuner_dispose(this); return NULL; } - ioctl (this->fd_frontend, FE_GET_INFO, &this->feinfo); - if (this->feinfo.type==FE_QPSK) { - - if ((this->fd_sec = open (SEC_DEVICE, O_RDWR)) < 0) { - perror ("SEC DEVICE: "); - free (this); - return NULL; - } - } - - this->fd_demuxtt = open (DEMUX_DEVICE, O_RDWR); - if (this->fd_demuxtt < 0) { - perror ("DEMUX DEVICE tt: "); - free (this); + if ((ioctl (this->fd_frontend, FE_GET_INFO, &this->feinfo)) < 0) { + perror("FE_GET_INFO"); + tuner_dispose(this); return NULL; } this->fd_demuxa = open (DEMUX_DEVICE, O_RDWR); if (this->fd_demuxa < 0) { - perror ("DEMUX DEVICE audio: "); - free (this); + perror ("DEMUX DEVICE audio"); + tuner_dispose(this); return NULL; } this->fd_demuxv=open (DEMUX_DEVICE, O_RDWR); if (this->fd_demuxv < 0) { - perror ("DEMUX DEVICE video: "); - free (this); + perror ("DEMUX DEVICE video"); + tuner_dispose(this); return NULL; } return this; } -static void tuner_dispose (tuner_t *this) { - - close (this->fd_frontend); - close (this->fd_sec); - close (this->fd_demuxa); - close (this->fd_demuxv); - close (this->fd_demuxtt); - - free (this); -} static void tuner_set_vpid (tuner_t *this, ushort vpid) { if (vpid==0 || vpid==NOPID || vpid==0x1fff) { - ioctl (this->fd_demuxv, DMX_STOP, 0); + ioctl (this->fd_demuxv, DMX_STOP); return; } - this->pesFilterParamsV.pid = vpid; - this->pesFilterParamsV.input = DMX_IN_FRONTEND; - this->pesFilterParamsV.output = DMX_OUT_TS_TAP; - this->pesFilterParamsV.pesType = DMX_PES_VIDEO; - this->pesFilterParamsV.flags = DMX_IMMEDIATE_START; + this->pesFilterParamsV.pid = vpid; + this->pesFilterParamsV.input = DMX_IN_FRONTEND; + this->pesFilterParamsV.output = DMX_OUT_TS_TAP; + this->pesFilterParamsV.pes_type = DMX_PES_VIDEO; + this->pesFilterParamsV.flags = DMX_IMMEDIATE_START; if (ioctl(this->fd_demuxv, DMX_SET_PES_FILTER, &this->pesFilterParamsV) < 0) perror("set_vpid"); @@ -208,155 +256,100 @@ static void tuner_set_vpid (tuner_t *this, ushort vpid) { static void tuner_set_apid (tuner_t *this, ushort apid) { if (apid==0 || apid==NOPID || apid==0x1fff) { - ioctl (this->fd_demuxa, DMX_STOP, apid); + ioctl (this->fd_demuxa, DMX_STOP); return; } - - this->pesFilterParamsA.pid = apid; - this->pesFilterParamsA.input = DMX_IN_FRONTEND; - this->pesFilterParamsA.output = DMX_OUT_TS_TAP; - this->pesFilterParamsA.pesType = DMX_PES_AUDIO; - this->pesFilterParamsA.flags = DMX_IMMEDIATE_START; + + this->pesFilterParamsA.pid = apid; + this->pesFilterParamsA.input = DMX_IN_FRONTEND; + this->pesFilterParamsA.output = DMX_OUT_TS_TAP; + this->pesFilterParamsA.pes_type = DMX_PES_AUDIO; + this->pesFilterParamsA.flags = DMX_IMMEDIATE_START; if (ioctl (this->fd_demuxa, DMX_SET_PES_FILTER, &this->pesFilterParamsA) < 0) perror("set_apid"); } -static void tuner_set_ttpid (tuner_t *this, ushort ttpid) { +static int tuner_set_diseqc(tuner_t *this, channel_t *c) +{ + struct dvb_diseqc_master_cmd cmd = + {{0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00}, 4}; - if (ttpid==0 || ttpid== NOPID || ttpid==0x1fff) { - ioctl (this->fd_demuxtt, DMX_STOP, 0); - return; - } - this->pesFilterParamsTT.pid = ttpid; - this->pesFilterParamsTT.input = DMX_IN_FRONTEND; - this->pesFilterParamsTT.output = DMX_OUT_DECODER; - this->pesFilterParamsTT.pesType = DMX_PES_TELETEXT; - this->pesFilterParamsTT.flags = DMX_IMMEDIATE_START; - if (ioctl(this->fd_demuxtt, DMX_SET_PES_FILTER, - &this->pesFilterParamsTT) < 0) { - /* printf("PID=%04x\n", ttpid); */ - perror("set_ttpid"); - } -} + cmd.msg[3] = 0xf0 | ((c->sat_no * 4) & 0x0f) | + (c->tone ? 1 : 0) | (c->pol ? 0 : 2); -static void tuner_get_front (tuner_t *this) { - tuner_set_vpid (this, 0); - tuner_set_apid (this, 0); - tuner_set_ttpid(this, 0); - this->scmds.voltage = SEC_VOLTAGE_13; - this->scmds.miniCommand = SEC_MINI_NONE; - this->scmds.continuousTone = SEC_TONE_OFF; - this->scmds.numCommands = 1; - this->scmds.commands = &this->scmd; -} - -static void tuner_set_diseqc_nr (tuner_t *this, int nr) { + if (ioctl(this->fd_frontend, FE_SET_TONE, SEC_TONE_OFF) < 0) + return 0; + if (ioctl(this->fd_frontend, FE_SET_VOLTAGE, + c->pol ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18) < 0) + return 0; + usleep(15000); + if (ioctl(this->fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd) < 0) + return 0; + usleep(15000); + if (ioctl(this->fd_frontend, FE_DISEQC_SEND_BURST, + (c->sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A) < 0) + return 0; + usleep(15000); + if (ioctl(this->fd_frontend, FE_SET_TONE, + c->tone ? SEC_TONE_ON : SEC_TONE_OFF) < 0) + return 0; - this->scmd.type=0; - this->scmd.u.diseqc.addr = 0x10; - this->scmd.u.diseqc.cmd = 0x38; - this->scmd.u.diseqc.numParams = 1; - this->scmd.u.diseqc.params[0] = 0xF0 | ((nr * 4) & 0x0F) | - (this->scmds.continuousTone == SEC_TONE_ON ? 1 : 0) | - (this->scmds.voltage==SEC_VOLTAGE_18 ? 2 : 0); + return 1; } -static void tuner_set_tp (tuner_t *this, int freq, int tone, - int volt, int diseqcnr, - int srate, int fec) { - - static const uint8_t rfectab[9] = {1,2,3,0,4,0,5,0,0}; - - this->front_param.Frequency = freq; - this->scmds.continuousTone = tone; - this->scmds.voltage = volt; - tuner_set_diseqc_nr (this, diseqcnr); - this->front_param.u.qpsk.SymbolRate = srate; - this->front_param.u.qpsk.FEC_inner = (CodeRate)rfectab[fec]; - this->front_param.Inversion = INVERSION_AUTO; -} +static int tuner_tune_it (tuner_t *this, struct dvb_frontend_parameters + *front_param) { + fe_status_t status; -static int tuner_tune_it (tuner_t *this, FrontendParameters *front_param) { - FrontendEvent event; - struct pollfd pfd[1]; - - if (ioctl(this->fd_frontend, FE_SET_FRONTEND, front_param) <0) + if (ioctl(this->fd_frontend, FE_SET_FRONTEND, front_param) <0) { perror("setfront front"); + } - pfd[0].fd=this->fd_frontend; - pfd[0].events=POLLIN; - if (poll(pfd,1,2000)) { - if (pfd[0].revents & POLLIN){ - if (ioctl(this->fd_frontend, FE_GET_EVENT, &event) - == -EBUFFEROVERFLOW){ - perror("fe get event"); - return 0; - } - switch(event.type){ - case FE_UNEXPECTED_EV: - perror("unexpected event\n"); - return 0; - case FE_FAILURE_EV: - perror("failure event\n"); - return 0; - - case FE_COMPLETION_EV: - fprintf(stderr, "completion event\n"); - return 1; - } + do { + if (ioctl(this->fd_frontend, FE_READ_STATUS, &status) < 0) { + perror("fe get event"); + return 0; + } + printf("input_dvb: status: %x\n", status); + if (status & FE_HAS_LOCK) { + return 1; } + usleep(500000); } - return 0; -} - + while (!(status & FE_TIMEDOUT)); -static int tuner_set_front (tuner_t *this) { - this->scmds.miniCommand = SEC_MINI_NONE; - this->scmds.numCommands=1; - this->scmds.commands=&this->scmd; - - tuner_set_vpid (this, 0); - tuner_set_apid (this, 0); - tuner_set_ttpid(this,0); - - if (this->feinfo.type==FE_QPSK) { - if (ioctl(this->fd_sec, SEC_SEND_SEQUENCE, &this->scmds) < 0) - perror("setfront sec"); - usleep(70000); - } - return tuner_tune_it(this, &this->front_param); + return 0; } static void print_channel (channel_t *channel) { - - printf ("input_dvb: channel '%s' diseqc %d freq %d volt %d srate %d fec %d vpid %d apid %d\n", + printf ("input_dvb: channel '%s' freq %d vpid %d apid %d\n", channel->name, - channel->diseqcnr, - channel->freq, - channel->volt, - channel->srate, - channel->fec, + channel->front_param.frequency, channel->vpid, channel->apid); - } -static int tuner_set_channel (tuner_t *this, +static int tuner_set_channel (tuner_t *this, channel_t *c) { print_channel (c); - tuner_get_front (this); - tuner_set_tp (this, c->freq, c->tone, c->volt, c->diseqcnr, c->srate, c->fec); - if (!tuner_set_front (this)) + tuner_set_vpid (this, 0); + tuner_set_apid (this, 0); + + if (this->feinfo.type==FE_QPSK) { + if (!tuner_set_diseqc(this, c)) + return 0; + } + + if (!tuner_tune_it (this, &c->front_param)) return 0; - + tuner_set_vpid (this, c->vpid); tuner_set_apid (this, c->apid); - tuner_set_ttpid (this, 0); - + return 1; /* fixme: error handling */ } @@ -364,15 +357,15 @@ static void osd_show_channel (dvb_input_plugin_t *this) { int i, channel ; - this->stream->osd_renderer->filled_rect (this->osd, 0, 0, 395, 400, 2); + this->stream->osd_renderer->filled_rect (this->osd, 0, 0, 395, 400, 2); channel = this->channel - 5; for (i=0; i<11; i++) { if ( (channel >= 0) && (channel < this->num_channels) ) - this->stream->osd_renderer->render_text (this->osd, 10, 10+i*35, - this->channels[channel].name, + this->stream->osd_renderer->render_text (this->osd, 10, 10+i*35, + this->channels[channel].name, OSD_TEXT3); channel ++; } @@ -394,7 +387,7 @@ static void switch_channel (dvb_input_plugin_t *this) { pthread_mutex_lock (&this->mutex); close (this->fd); - + if (!tuner_set_channel (this->tuner, &this->channels[this->channel])) { printf ("input_dvb: tuner_set_channel failed\n"); pthread_mutex_unlock (&this->mutex); @@ -408,11 +401,11 @@ static void switch_channel (dvb_input_plugin_t *this) { event.data_length = sizeof (xine_pids_data_t); printf ("input_dvb: sending event\n"); - + xine_event_send (this->stream, &event); this->fd = open (DVR_DEVICE, O_RDONLY); - + pthread_mutex_unlock (&this->mutex); this->stream->osd_renderer->hide (this->osd, 0); @@ -440,27 +433,27 @@ static void dvb_event_handler (dvb_input_plugin_t *this) { this->channel++; osd_show_channel (this); break; - + case XINE_EVENT_INPUT_PREVIOUS: if (this->channel>0) this->channel--; osd_show_channel (this); break; - + case XINE_EVENT_INPUT_DOWN: if (this->channel < (this->num_channels-1)) { this->channel++; switch_channel (this); } break; - + case XINE_EVENT_INPUT_UP: if (this->channel>0) { this->channel--; switch_channel (this); } break; - + case XINE_EVENT_INPUT_SELECT: switch_channel (this); break; @@ -469,7 +462,7 @@ static void dvb_event_handler (dvb_input_plugin_t *this) { this->stream->osd_renderer->hide (this->osd, 0); break; -#if 0 +#if 0 default: printf ("input_dvb: got an event, type 0x%08x\n", event->type); #endif @@ -479,7 +472,9 @@ static void dvb_event_handler (dvb_input_plugin_t *this) { } } -static off_t dvb_plugin_read (input_plugin_t *this_gen, + + +static off_t dvb_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) { dvb_input_plugin_t *this = (dvb_input_plugin_t *) this_gen; off_t n, total; @@ -511,14 +506,11 @@ static off_t dvb_plugin_read (input_plugin_t *this_gen, } } - if (this->out_fd>0) - write (this->out_fd, buf, total); - pthread_mutex_unlock( &this->mutex ); return total; } -static buf_element_t *dvb_plugin_read_block (input_plugin_t *this_gen, +static buf_element_t *dvb_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t todo) { /* dvb_input_plugin_t *this = (dvb_input_plugin_t *) this_gen; */ buf_element_t *buf = fifo->buffer_pool_alloc (fifo); @@ -527,7 +519,7 @@ static buf_element_t *dvb_plugin_read_block (input_plugin_t *this_gen, buf->content = buf->mem; buf->type = BUF_DEMUX_BLOCK; - + total_bytes = dvb_plugin_read (this_gen, buf->content, todo); if (total_bytes != todo) { @@ -540,7 +532,7 @@ static buf_element_t *dvb_plugin_read_block (input_plugin_t *this_gen, return buf; } -static off_t dvb_plugin_seek (input_plugin_t *this_gen, off_t offset, +static off_t dvb_plugin_seek (input_plugin_t *this_gen, off_t offset, int origin) { dvb_input_plugin_t *this = (dvb_input_plugin_t *) this_gen; @@ -593,12 +585,11 @@ static void dvb_plugin_dispose (input_plugin_t *this_gen) { this->nbc = NULL; } - if (this->out_fd>0) - close (this->out_fd); - xine_event_dispose_queue (this->event_queue); free (this->mrl); + free (this->channels); + tuner_dispose ( ((dvb_input_plugin_t *)this)->tuner ); free (this); } @@ -608,21 +599,28 @@ static char* dvb_plugin_get_mrl (input_plugin_t *this_gen) { return this->mrl; } -static int dvb_plugin_get_optional_data (input_plugin_t *this_gen, +static int dvb_plugin_get_optional_data (input_plugin_t *this_gen, void *data, int data_type) { return INPUT_OPTIONAL_UNSUPPORTED; } -static channel_t *load_channels (int *num_ch) { +static int find_param(const Param *list, const char *name) +{ + while (list->name && strcmp(list->name, name)) + list++; + return list->value;; +} + +static channel_t *load_channels (int *num_ch, fe_type_t fe_type) { - FILE *f; - unsigned char str[BUFSIZE]; - unsigned char filename[BUFSIZE]; - channel_t *channels; - int num_channels; + FILE *f; + char str[BUFSIZE]; + char filename[BUFSIZE]; + channel_t *channels; + int num_channels; - snprintf (filename, BUFSIZE, "%s/.xine/dvb_channels", xine_get_homedir()); + snprintf (filename, BUFSIZE, "%s/.xine/channels.conf", xine_get_homedir()); f = fopen (filename, "rb"); if (!f) { @@ -635,7 +633,6 @@ static channel_t *load_channels (int *num_ch) { */ num_channels = 0; while ( fgets (str, BUFSIZE, f)) { - fgets (str, BUFSIZE, f); num_channels++; } fclose (f); @@ -650,53 +647,175 @@ static channel_t *load_channels (int *num_ch) { f = fopen (filename, "rb"); num_channels = 0; while ( fgets (str, BUFSIZE, f)) { - - int freq; - - channels[num_channels].name = strdup (str); - - fgets (str, BUFSIZE, f); - - sscanf (str, "%d %d %d %d %d %d %d\n", - &channels[num_channels].diseqcnr, - &freq, - &channels[num_channels].volt, - &channels[num_channels].srate, - &channels[num_channels].fec, - &channels[num_channels].vpid, - &channels[num_channels].apid); - - if (freq > 11700000) { - channels[num_channels].freq = freq - 10600000; - channels[num_channels].tone = SEC_TONE_ON; - } else { - channels[num_channels].freq = freq - 9750000; - channels[num_channels].tone = SEC_TONE_OFF; + + unsigned long freq; + char *field, *tmp; + + tmp = str; + if (!(field = strsep(&tmp, ":"))) + continue; + + channels[num_channels].name = strdup(field); + + if (!(field = strsep(&tmp, ":"))) + continue; + + freq = strtoul(field, NULL, 0); + + switch (fe_type) + { + case FE_QPSK: + + if (freq > 11700) { + channels[num_channels].front_param.frequency = (freq - 10600)*1000; + channels[num_channels].tone = 1; + } else { + channels[num_channels].front_param.frequency = (freq - 9750)*1000; + channels[num_channels].tone = 0; + } + + channels[num_channels].front_param.inversion = INVERSION_OFF; + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].pol = (field[0] == 'h' ? 0 : 1); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].sat_no = strtoul(field, NULL, 0); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.qpsk.symbol_rate = + strtoul(field, NULL, 0) * 1000; + + channels[num_channels].front_param.u.qpsk.fec_inner = FEC_AUTO; + + break; + + case FE_QAM: + + channels[num_channels].front_param.frequency = freq; + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.inversion = + find_param(inversion_list, field); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.qam.symbol_rate = + strtoul(field, NULL, 0); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.qam.fec_inner = + find_param(fec_list, field); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.qam.modulation = + find_param(qam_list, field); + + break; + + case FE_OFDM: + + channels[num_channels].front_param.frequency = freq; + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.inversion = + find_param(inversion_list, field); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.ofdm.bandwidth = + find_param(bw_list, field); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.ofdm.code_rate_HP = + find_param(fec_list, field); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.ofdm.code_rate_LP = + find_param(fec_list, field); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.ofdm.constellation = + find_param(qam_list, field); + + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.ofdm.transmission_mode = + find_param(transmissionmode_list, field); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.ofdm.guard_interval = + find_param(guard_list, field); + + if (!(field = strsep(&tmp, ":"))) + break; + + channels[num_channels].front_param.u.ofdm.hierarchy_information = + find_param(hierarchy_list, field); + + break; + } + if (!(field = strsep(&tmp, ":"))) + continue; + + channels[num_channels].vpid = strtoul(field, NULL, 0); + + if (!(field = strsep(&tmp, ":"))) + continue; + + channels[num_channels].apid = strtoul(field, NULL, 0); + #ifdef LOG printf ("input: dvb channel %s loaded\n", channels[num_channels].name); #endif num_channels++; - } + } *num_ch = num_channels; return channels; } -static input_plugin_t *open_plugin (input_class_t *cls_gen, - xine_stream_t *stream, +static input_plugin_t *open_plugin (input_class_t *cls_gen, + xine_stream_t *stream, const char *data) { - dvb_input_class_t *cls = (dvb_input_class_t *) cls_gen; + dvb_input_class_t *cls = (dvb_input_class_t *) cls_gen; dvb_input_plugin_t *this; tuner_t *tuner; channel_t *channels; int num_channels; char *mrl = (char *) data; - if (strncasecmp (mrl, "dvb:/",5)) + if (strncasecmp (mrl, "dvb:/",5)) return NULL; if ( !(tuner = tuner_init()) ) { @@ -704,11 +823,11 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, return NULL; } - if ( !(channels = load_channels(&num_channels)) ) { + if ( !(channels = load_channels(&num_channels, tuner->feinfo.type)) ) { tuner_dispose (tuner); return NULL; } - + this = (dvb_input_plugin_t *) xine_xmalloc (sizeof(dvb_input_plugin_t)); this->tuner = tuner; @@ -719,17 +838,21 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, if (!tuner_set_channel (this->tuner, &this->channels[this->channel])) { printf ("input_dvb: tuner_set_channel failed\n"); + tuner_dispose(this->tuner); + free(this->channels); free (this); return NULL; } if ((this->fd = open (DVR_DEVICE, O_RDONLY)) < 0){ printf ("input_dvb: cannot open dvr device '%s'\n", DVR_DEVICE); + tuner_dispose(this->tuner); + free(this->channels); free (this); return NULL; } - this->mrl = strdup(mrl); + this->mrl = strdup(mrl); this->curpos = 0; this->nbc = nbc_init (stream); @@ -755,15 +878,9 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, pthread_mutex_init (&this->mutex, NULL); -#if 0 - this->out_fd = open ("foo.ts", O_CREAT | O_WRONLY | O_TRUNC, 0644); -#else - this->out_fd = 0; -#endif - this->event_queue = xine_event_new_queue (this->stream); - this->osd = this->stream->osd_renderer->new_object (this->stream->osd_renderer, + this->osd = this->stream->osd_renderer->new_object (this->stream->osd_renderer, 410, 410); this->stream->osd_renderer->set_position (this->osd, 20, 20); this->stream->osd_renderer->set_font (this->osd, "cetus", 32); @@ -787,9 +904,7 @@ static char *dvb_class_get_identifier (input_class_t *this_gen) { } static void dvb_class_dispose (input_class_t *this_gen) { - - dvb_input_class_t *cls = (dvb_input_class_t *) this_gen; - + dvb_input_class_t *cls = (dvb_input_class_t *) this_gen; free (cls); } @@ -797,9 +912,9 @@ static int dvb_class_eject_media (input_class_t *this_gen) { return 1; } -static char ** dvb_class_get_autoplay_list (input_class_t *this_gen, +static char ** dvb_class_get_autoplay_list (input_class_t *this_gen, int *num_files) { - dvb_input_class_t *cls = (dvb_input_class_t *) this_gen; + dvb_input_class_t *cls = (dvb_input_class_t *) this_gen; *num_files = 1; return cls->mrls; @@ -835,7 +950,7 @@ static void *init_class (xine_t *xine, void *data) { */ plugin_info_t xine_plugin_info[] = { - /* type, API, "name", version, special_info, init_function */ + /* type, API, "name", version, special_info, init_function */ { PLUGIN_INPUT, 11, "DVB", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/ost/Makefile.am b/src/input/ost/Makefile.am deleted file mode 100644 index 7c179a4af..000000000 --- a/src/input/ost/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -noinst_HEADERS = \ - demux.h \ - dmx.h \ - frontend.h \ - sec.h - -debug: - @list='$(SUBDIRS)'; for subdir in $$list; do \ - (cd $$subdir && $(MAKE) $@) || exit;\ - done; - @$(MAKE) CFLAGS="$(DEBUG_CFLAGS)" - -install-debug: debug - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -mostlyclean-generic: - -rm -f *~ \#* .*~ .\#* - -maintainer-clean-generic: - -@echo "This command is intended for maintainers to use;" - -@echo "it deletes files that may require special tools to rebuild." - -rm -f Makefile.in diff --git a/src/input/ost/README b/src/input/ost/README deleted file mode 100644 index 5fc680215..000000000 --- a/src/input/ost/README +++ /dev/null @@ -1,9 +0,0 @@ -This directories contains header files for the Linux DVB drivers -from convergence integrated media GmbH - - Copyright (C) 2000 Ralph Metzler - & Marcus Metzler - for convergence integrated media GmbH - -released under the LGPL license. For details see the individual -header files. diff --git a/src/input/ost/ca.h b/src/input/ost/ca.h deleted file mode 100644 index 226ef5c09..000000000 --- a/src/input/ost/ca.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * ca.h - * - * Copyright (C) 2000 Ralph Metzler - * & Marcus Metzler - for convergence integrated media GmbH - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Lesser Public License - * as published by the Free Software Foundation; either version 2.1 - * 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 Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _OST_CA_H_ -#define _OST_CA_H_ - -/* slot interface types and info */ - -typedef struct ca_slot_info_s { - int num; /* slot number */ - - int type; /* CA interface this slot supports */ -#define CA_CI 1 /* CI high level interface */ -#define CA_CI_LINK 2 /* CI link layer level interface */ -#define CA_CI_PHYS 4 /* CI physical layer level interface */ -#define CA_SC 128 /* simple smart card interface */ - - unsigned int flags; -#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ -#define CA_CI_MODULE_READY 2 -} ca_slot_info_t; - - -/* descrambler types and info */ - -typedef struct ca_descr_info_s { - unsigned int num; /* number of available descramblers (keys) */ - unsigned int type; /* type of supported scrambling system */ -#define CA_ECD 1 -#define CA_NDS 2 -#define CA_DSS 4 -} ca_descr_info_t; - -typedef struct ca_cap_s { - unsigned int slot_num; /* total number of CA card and module slots */ - unsigned int slot_type; /* OR of all supported types */ - unsigned int descr_num; /* total number of descrambler slots (keys) */ - unsigned int descr_type; /* OR of all supported types */ -} ca_cap_t; - -/* a message to/from a CI-CAM */ -typedef struct ca_msg_s { - unsigned int index; - unsigned int type; - unsigned int length; - unsigned char msg[256]; -} ca_msg_t; - -typedef struct ca_descr_s { - unsigned int index; - unsigned int parity; - unsigned char cw[8]; -} ca_descr_t; - -#define CA_RESET _IOW('o', 128, int) -#define CA_GET_CAP _IOR('o', 129, ca_cap_t *) -#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t *) -#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t *) -#define CA_GET_MSG _IOR('o', 132, ca_msg_t *) -#define CA_SEND_MSG _IOW('o', 133, ca_msg_t *) -#define CA_SET_DESCR _IOW('o', 134, ca_descr_t *) - -#endif - diff --git a/src/input/ost/demux.h b/src/input/ost/demux.h deleted file mode 100644 index 758e921b6..000000000 --- a/src/input/ost/demux.h +++ /dev/null @@ -1,346 +0,0 @@ -/* * demux.h * * Copyright (c) 2000 Nokia Research Center - * Tampere, FINLAND - * - * Project: - * Universal Broadcast Access - * - * Contains: - * Type definitions of a Linux kernel-level API for filtering MPEG-2 TS - * packets and MPEG-2 sections. Support for PES packet filtering will be - * added later. - * - * History: - * 12.01.2000/JPL File created - Initial version. - * 18.02.2000/JPL Minor corrections. - * 21.02.2000/JPL DMX_NAME_SIZE and dmx_in_use() removed, typos fixed, - * some names changed. - * 23.02.2000/JPL Added a parameter indicating the callback source in - * the callback functions. - * 10.03.2000/JPL Added the macros DMX_DIR_ENTRY() and DMX_FE_ENTRY(). - * 15.03.2000/JPL Added the capabilities field to dmx_demux_t. - * 22.03.2000/JPL Corrected the callback parameter in the - * allocate_x_feed() functions. - * 03.04.2000/JPL Added support for optional resource conflict resolution - * and scarce resource handling. - * 05.04.2000/JPL Changed the dmx_resolve_conflict() to use resource - * type as a parameter. - * 12.04.2000/JPL Added a second buffer parameter for dmx_x_callback() - * functions to better handle buffer wrapping. - * 26.04.2000/JPL Added functions for section-level descrambling. - * 03.09.2000/JPL Removed support for conflict resolution and scarce - * resource handling. Otherwise only minor changes to - * data structures and function prototypes. - * - * - * Author: - * Juha-Pekka Luoma (JPL) - * Nokia Research Center - * - * Notes: - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * 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 Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ -/* $Id: demux.h,v 1.1 2002/12/27 00:53:50 guenter Exp $ */ - -#ifndef __DEMUX_H -#define __DEMUX_H - -#ifndef __KERNEL__ -#define __KERNEL__ -#endif - -#include /* __u8, __u16, ... */ -#include /* list_entry(), struct list_head */ -#include /* struct timespec */ -#include /* Function return values */ - -/*--------------------------------------------------------------------------*/ -/* Common definitions */ -/*--------------------------------------------------------------------------*/ - -/* - * DMX_MAX_FILTER_SIZE: Maximum length (in bytes) of a section/PES filter. - */ - -#ifndef DMX_MAX_FILTER_SIZE -#define DMX_MAX_FILTER_SIZE 18 -#endif -/* - * dmx_success_t: Success codes for the Demux Callback API. - */ - -typedef enum { - DMX_OK = 0, /* Received Ok */ - DMX_LENGTH_ERROR, /* Incorrect length */ - DMX_OVERRUN_ERROR, /* Receiver ring buffer overrun */ - DMX_CRC_ERROR, /* Incorrect CRC */ - DMX_FRAME_ERROR, /* Frame alignment error */ - DMX_FIFO_ERROR, /* Receiver FIFO overrun */ - DMX_MISSED_ERROR /* Receiver missed packet */ -} dmx_success_t; - -/*--------------------------------------------------------------------------*/ -/* TS packet reception */ -/*--------------------------------------------------------------------------*/ - -/* TS filter type for set_type() */ - -#define TS_PACKET 1 /* send TS packets (188 bytes) to callback (default) */ -#define TS_PAYLOAD_ONLY 2 /* in case TS_PACKET is set, only send the TS - payload (<=184 bytes per packet) to callback */ -#define TS_DECODER 4 /* send stream to built-in decoder (if present) */ - -/* PES type for filters which write to built-in decoder */ -/* these should be kept identical to the types in dmx.h */ - -typedef enum -{ - DMX_TS_PES_AUDIO, /* also send packets to audio decoder (if it exists) */ - DMX_TS_PES_VIDEO, /* ... */ - DMX_TS_PES_TELETEXT, - DMX_TS_PES_SUBTITLE, - DMX_TS_PES_PCR, - DMX_TS_PES_OTHER, -} dmx_ts_pes_t; - - -struct dmx_ts_feed_s { - int is_filtering; /* Set to non-zero when filtering in progress */ - struct dmx_demux_s* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ - int (*set) (struct dmx_ts_feed_s* feed, - __u16 pid, - size_t callback_length, - size_t circular_buffer_size, - int descramble, - struct timespec timeout); - int (*start_filtering) (struct dmx_ts_feed_s* feed); - int (*stop_filtering) (struct dmx_ts_feed_s* feed); - int (*set_type) (struct dmx_ts_feed_s* feed, - int type, - dmx_ts_pes_t pes_type); -}; - -typedef struct dmx_ts_feed_s dmx_ts_feed_t; - -/*--------------------------------------------------------------------------*/ -/* PES packet reception (not supported yet) */ -/*--------------------------------------------------------------------------*/ - -typedef struct dmx_pes_filter_s { - struct dmx_pes_s* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ -} dmx_pes_filter_t; - -typedef struct dmx_pes_feed_s { - int is_filtering; /* Set to non-zero when filtering in progress */ - struct dmx_demux_s* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ - int (*set) (struct dmx_pes_feed_s* feed, - __u16 pid, - size_t circular_buffer_size, - int descramble, - struct timespec timeout); - int (*start_filtering) (struct dmx_pes_feed_s* feed); - int (*stop_filtering) (struct dmx_pes_feed_s* feed); - int (*allocate_filter) (struct dmx_pes_feed_s* feed, - dmx_pes_filter_t** filter); - int (*release_filter) (struct dmx_pes_feed_s* feed, - dmx_pes_filter_t* filter); -} dmx_pes_feed_t; - -/*--------------------------------------------------------------------------*/ -/* Section reception */ -/*--------------------------------------------------------------------------*/ - -typedef struct { - __u8 filter_value [DMX_MAX_FILTER_SIZE]; - __u8 filter_mask [DMX_MAX_FILTER_SIZE]; - struct dmx_section_feed_s* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ -} dmx_section_filter_t; - -struct dmx_section_feed_s { - int is_filtering; /* Set to non-zero when filtering in progress */ - struct dmx_demux_s* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ - int (*set) (struct dmx_section_feed_s* feed, - __u16 pid, - size_t circular_buffer_size, - int descramble, - int check_crc); - int (*allocate_filter) (struct dmx_section_feed_s* feed, - dmx_section_filter_t** filter); - int (*release_filter) (struct dmx_section_feed_s* feed, - dmx_section_filter_t* filter); - int (*start_filtering) (struct dmx_section_feed_s* feed); - int (*stop_filtering) (struct dmx_section_feed_s* feed); -}; -typedef struct dmx_section_feed_s dmx_section_feed_t; - -/*--------------------------------------------------------------------------*/ -/* Callback functions */ -/*--------------------------------------------------------------------------*/ - -typedef int (*dmx_ts_cb) ( __u8 * buffer1, - size_t buffer1_length, - __u8 * buffer2, - size_t buffer2_length, - dmx_ts_feed_t* source, - dmx_success_t success); - -typedef int (*dmx_section_cb) ( __u8 * buffer1, - size_t buffer1_len, - __u8 * buffer2, - size_t buffer2_len, - dmx_section_filter_t * source, - dmx_success_t success); - -typedef int (*dmx_pes_cb) ( __u8 * buffer1, - size_t buffer1_len, - __u8 * buffer2, - size_t buffer2_len, - dmx_pes_filter_t* source, - dmx_success_t success); - -/*--------------------------------------------------------------------------*/ -/* DVB Front-End */ -/*--------------------------------------------------------------------------*/ - -typedef enum { - DMX_OTHER_FE = 0, - DMX_SATELLITE_FE, - DMX_CABLE_FE, - DMX_TERRESTRIAL_FE, - DMX_LVDS_FE, - DMX_ASI_FE, /* DVB-ASI interface */ - DMX_MEMORY_FE -} dmx_frontend_source_t; - -typedef struct { - /* The following char* fields point to NULL terminated strings */ - char* id; /* Unique front-end identifier */ - char* vendor; /* Name of the front-end vendor */ - char* model; /* Name of the front-end model */ - struct list_head connectivity_list; /* List of front-ends that can - be connected to a particular - demux */ - void* priv; /* Pointer to private data of the API client */ - dmx_frontend_source_t source; -} dmx_frontend_t; - -/*--------------------------------------------------------------------------*/ -/* MPEG-2 TS Demux */ -/*--------------------------------------------------------------------------*/ - -/* - * Flags OR'ed in the capabilites field of struct dmx_demux_s. - */ - -#define DMX_TS_FILTERING 1 -#define DMX_PES_FILTERING 2 -#define DMX_SECTION_FILTERING 4 -#define DMX_MEMORY_BASED_FILTERING 8 /* write() available */ -#define DMX_CRC_CHECKING 16 -#define DMX_TS_DESCRAMBLING 32 -#define DMX_SECTION_PAYLOAD_DESCRAMBLING 64 -#define DMX_MAC_ADDRESS_DESCRAMBLING 128 - -/* - * Demux resource type identifier. -*/ - -/* - * DMX_FE_ENTRY(): Casts elements in the list of registered - * front-ends from the generic type struct list_head - * to the type * dmx_frontend_t - *. -*/ - -#define DMX_FE_ENTRY(list) list_entry(list, dmx_frontend_t, connectivity_list) - -struct dmx_demux_s { - /* The following char* fields point to NULL terminated strings */ - char* id; /* Unique demux identifier */ - char* vendor; /* Name of the demux vendor */ - char* model; /* Name of the demux model */ - __u32 capabilities; /* Bitfield of capability flags */ - dmx_frontend_t* frontend; /* Front-end connected to the demux */ - struct list_head reg_list; /* List of registered demuxes */ - void* priv; /* Pointer to private data of the API client */ - int users; /* Number of users */ - int (*open) (struct dmx_demux_s* demux); - int (*close) (struct dmx_demux_s* demux); - int (*write) (struct dmx_demux_s* demux, const char* buf, size_t count); - int (*allocate_ts_feed) (struct dmx_demux_s* demux, - dmx_ts_feed_t** feed, - dmx_ts_cb callback); - int (*release_ts_feed) (struct dmx_demux_s* demux, - dmx_ts_feed_t* feed); - int (*allocate_pes_feed) (struct dmx_demux_s* demux, - dmx_pes_feed_t** feed, - dmx_pes_cb callback); - int (*release_pes_feed) (struct dmx_demux_s* demux, - dmx_pes_feed_t* feed); - int (*allocate_section_feed) (struct dmx_demux_s* demux, - dmx_section_feed_t** feed, - dmx_section_cb callback); - int (*release_section_feed) (struct dmx_demux_s* demux, - dmx_section_feed_t* feed); - int (*descramble_mac_address) (struct dmx_demux_s* demux, - __u8* buffer1, - size_t buffer1_length, - __u8* buffer2, - size_t buffer2_length, - __u16 pid); - int (*descramble_section_payload) (struct dmx_demux_s* demux, - __u8* buffer1, - size_t buffer1_length, - __u8* buffer2, size_t buffer2_length, - __u16 pid); - int (*add_frontend) (struct dmx_demux_s* demux, - dmx_frontend_t* frontend); - int (*remove_frontend) (struct dmx_demux_s* demux, - dmx_frontend_t* frontend); - struct list_head* (*get_frontends) (struct dmx_demux_s* demux); - int (*connect_frontend) (struct dmx_demux_s* demux, - dmx_frontend_t* frontend); - int (*disconnect_frontend) (struct dmx_demux_s* demux); - - - /* added because js cannot keep track of these himself */ - int (*get_pes_pids) (struct dmx_demux_s* demux, __u16 *pids); -}; -typedef struct dmx_demux_s dmx_demux_t; - -/*--------------------------------------------------------------------------*/ -/* Demux directory */ -/*--------------------------------------------------------------------------*/ - -/* - * DMX_DIR_ENTRY(): Casts elements in the list of registered - * demuxes from the generic type struct list_head* to the type dmx_demux_t - *. - */ - -#define DMX_DIR_ENTRY(list) list_entry(list, dmx_demux_t, reg_list) - -int dmx_register_demux (dmx_demux_t* demux); -int dmx_unregister_demux (dmx_demux_t* demux); -struct list_head* dmx_get_demuxes (void); - -#endif /* #ifndef __DEMUX_H */ - diff --git a/src/input/ost/dmx.h b/src/input/ost/dmx.h deleted file mode 100644 index 88eebd869..000000000 --- a/src/input/ost/dmx.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * dmx.h - * - * Copyright (C) 2000 Marcus Metzler - * & Ralph Metzler - for convergence integrated media GmbH - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * 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 Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _OST_DMX_H_ -#define _OST_DMX_H_ - -#ifdef __KERNEL__ -#include -#elif defined(__sun) -#include -#else -#include -#endif - -#ifndef EBUFFEROVERFLOW -#define EBUFFEROVERFLOW 769 -#endif - -/* pid_t conflicts with linux/include/linux/types.h !!!*/ - -typedef uint16_t dvb_pid_t; - -#define DMX_FILTER_SIZE 16 - -typedef enum -{ - DMX_OUT_DECODER, /* Streaming directly to decoder. */ - DMX_OUT_TAP, /* Output going to a memory buffer */ - /* (to be retrieved via the read command).*/ - DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ - /* (to be retrieved by reading from the */ - /* logical DVR device). */ -} dmxOutput_t; - - -typedef enum -{ - DMX_IN_FRONTEND, /* Input from a front-end device. */ - DMX_IN_DVR /* Input from the logical DVR device. */ -} dmxInput_t; - - -typedef enum -{ - DMX_PES_AUDIO, - DMX_PES_VIDEO, - DMX_PES_TELETEXT, - DMX_PES_SUBTITLE, - DMX_PES_PCR, - DMX_PES_OTHER -} dmxPesType_t; - - -typedef enum -{ - DMX_SCRAMBLING_EV, - DMX_FRONTEND_EV -} dmxEvent_t; - - -typedef enum -{ - DMX_SCRAMBLING_OFF, - DMX_SCRAMBLING_ON -} dmxScramblingStatus_t; - - -typedef struct dmxFilter -{ - uint8_t filter[DMX_FILTER_SIZE]; - uint8_t mask[DMX_FILTER_SIZE]; -} dmxFilter_t; - - -/*struct dmxFrontEnd -{ - TBD tbd; -};*/ - - -struct dmxSctFilterParams -{ - dvb_pid_t pid; - dmxFilter_t filter; - uint32_t timeout; - uint32_t flags; -#define DMX_CHECK_CRC 1 -#define DMX_ONESHOT 2 -#define DMX_IMMEDIATE_START 4 -#define DMX_KERNEL_CLIENT 0x8000 -}; - - -struct dmxPesFilterParams -{ - dvb_pid_t pid; - dmxInput_t input; - dmxOutput_t output; - dmxPesType_t pesType; - uint32_t flags; -}; - - -struct dmxEvent -{ - dmxEvent_t event; - time_t timeStamp; - union - { - dmxScramblingStatus_t scrambling; - } u; -}; - - -#define DMX_START _IOW('o',41,int) -#define DMX_STOP _IOW('o',42,int) -#define DMX_SET_FILTER _IOW('o',43,struct dmxSctFilterParams *) -#define DMX_SET_PES_FILTER _IOW('o',44,struct dmxPesFilterParams *) -#define DMX_SET_BUFFER_SIZE _IOW('o',45,unsigned long) -#define DMX_GET_EVENT _IOR('o',46,struct dmxEvent *) -#define DMX_GET_PES_PIDS _IOR('o',47,dvb_pid_t *) - -#endif /*_OST_DMX_H_*/ diff --git a/src/input/ost/frontend.h b/src/input/ost/frontend.h deleted file mode 100644 index f052f9ced..000000000 --- a/src/input/ost/frontend.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * frontend.h - * - * Copyright (C) 2000 Marcus Metzler - * & Ralph Metzler - * for convergence integrated media GmbH - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * 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 Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _FRONTEND_H_ -#define _FRONTEND_H_ - -#if defined(__sun) -#include -#else -#include -#endif - -#define ENOSIGNAL 768 -#ifndef EBUFFEROVERFLOW -#define EBUFFEROVERFLOW 769 -#endif - - -typedef uint32_t FrontendStatus; - -/* bit definitions for FrontendStatus */ -#define FE_HAS_POWER 1 -#define FE_HAS_SIGNAL 2 -#define FE_SPECTRUM_INV 4 -#define FE_HAS_LOCK 8 -#define FE_HAS_CARRIER 16 -#define FE_HAS_VITERBI 32 -#define FE_HAS_SYNC 64 -#define FE_TUNER_HAS_LOCK 128 - - -/* possible values for spectral inversion */ -typedef enum { - INVERSION_OFF, - INVERSION_ON, - INVERSION_AUTO -} SpectralInversion; - -/* possible values for FEC_inner/FEC_outer */ -typedef enum { - FEC_AUTO, - FEC_1_2, - FEC_2_3, - FEC_3_4, - FEC_5_6, - FEC_7_8, - FEC_NONE -} CodeRate; - - -typedef enum { - QPSK, - QAM_16, - QAM_32, - QAM_64, - QAM_128, - QAM_256 -} Modulation; - - -typedef enum { - TRANSMISSION_MODE_2K, - TRANSMISSION_MODE_8K -} TransmitMode; - -typedef enum { - BANDWIDTH_8_MHZ, - BANDWIDTH_7_MHZ, - BANDWIDTH_6_MHZ -} BandWidth; - - -typedef enum { - GUARD_INTERVAL_1_32, - GUARD_INTERVAL_1_16, - GUARD_INTERVAL_1_8, - GUARD_INTERVAL_1_4 -} GuardInterval; - - -typedef enum { - HIERARCHY_NONE, - HIERARCHY_1, - HIERARCHY_2, - HIERARCHY_4 -} Hierarchy; - - -typedef struct { - uint32_t SymbolRate; /* symbol rate in Symbols per second */ - CodeRate FEC_inner; /* forward error correction (see above) */ -} QPSKParameters; - - -typedef struct { - uint32_t SymbolRate; /* symbol rate in Symbols per second */ - CodeRate FEC_inner; /* forward error correction (see above) */ - Modulation QAM; /* modulation type (see above) */ -} QAMParameters; - - -typedef struct { - BandWidth bandWidth; - CodeRate HP_CodeRate; /* high priority stream code rate */ - CodeRate LP_CodeRate; /* low priority stream code rate */ - Modulation Constellation; /* modulation type (see above) */ - TransmitMode TransmissionMode; - GuardInterval guardInterval; - Hierarchy HierarchyInformation; -} OFDMParameters; - - -typedef enum { - FE_QPSK, - FE_QAM, - FE_OFDM -} FrontendType; - - -typedef struct { - uint32_t Frequency; /* (absolute) frequency in Hz for QAM/OFDM */ - /* intermediate frequency in kHz for QPSK */ - SpectralInversion Inversion; /* spectral inversion */ - union { - QPSKParameters qpsk; - QAMParameters qam; - OFDMParameters ofdm; - } u; -} FrontendParameters; - - -typedef enum { - FE_UNEXPECTED_EV, /* unexpected event (e.g. loss of lock) */ - FE_COMPLETION_EV, /* completion event, tuning succeeded */ - FE_FAILURE_EV /* failure event, we couldn't tune */ -} EventType; - - -typedef struct { - EventType type; /* type of event, FE_UNEXPECTED_EV, ... */ - - long timestamp; /* time in seconds since 1970-01-01 */ - - union { - struct { - FrontendStatus previousStatus; /* status before event */ - FrontendStatus currentStatus; /* status during event */ - } unexpectedEvent; - FrontendParameters completionEvent; /* parameters for which the - tuning succeeded */ - FrontendStatus failureEvent; /* status at failure (e.g. no lock) */ - } u; -} FrontendEvent; - -typedef struct { - FrontendType type; - uint32_t minFrequency; - uint32_t maxFrequency; - uint32_t maxSymbolRate; - uint32_t minSymbolRate; - uint32_t hwType; - uint32_t hwVersion; -} FrontendInfo; - - -typedef enum { - FE_POWER_ON, - FE_POWER_STANDBY, - FE_POWER_SUSPEND, - FE_POWER_OFF -} FrontendPowerState; - - -#define FE_SELFTEST _IO('o', 61) -#define FE_SET_POWER_STATE _IOW('o', 62, FrontendPowerState) -#define FE_GET_POWER_STATE _IOR('o', 63, FrontendPowerState*) -#define FE_READ_STATUS _IOR('o', 64, FrontendStatus*) -#define FE_READ_BER _IOW('o', 65, uint32_t*) -#define FE_READ_SIGNAL_STRENGTH _IOR('o', 66, __s32*) -#define FE_READ_SNR _IOR('o', 67, __s32*) -#define FE_READ_UNCORRECTED_BLOCKS _IOW('o', 68, uint32_t*) -#define FE_GET_NEXT_FREQUENCY _IOW('o', 69, uint32_t*) -#define FE_GET_NEXT_SYMBOL_RATE _IOW('o', 70, uint32_t*) - -#define FE_SET_FRONTEND _IOW('o', 71, FrontendParameters*) -#define FE_GET_FRONTEND _IOR('o', 72, FrontendParameters*) -#define FE_GET_INFO _IOR('o', 73, FrontendInfo*) -#define FE_GET_EVENT _IOR('o', 74, FrontendEvent*) - -#endif /*_FRONTEND_H_*/ - diff --git a/src/input/ost/sec.h b/src/input/ost/sec.h deleted file mode 100644 index 8863df268..000000000 --- a/src/input/ost/sec.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * sec.h - * - * Copyright (C) 2000 Ralph Metzler - * & Marcus Metzler - for convergence integrated media GmbH - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * 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 Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef _OST_SEC_H_ -#define _OST_SEC_H_ - -#define SEC_MAX_DISEQC_PARAMS 3 - -struct secDiseqcCmd { - uint8_t addr; - uint8_t cmd; - uint8_t numParams; - uint8_t params[SEC_MAX_DISEQC_PARAMS]; -}; - -typedef uint32_t secVoltage; - -enum { - SEC_VOLTAGE_OFF, - SEC_VOLTAGE_LT, - SEC_VOLTAGE_13, - SEC_VOLTAGE_13_5, - SEC_VOLTAGE_18, - SEC_VOLTAGE_18_5 -}; - -#define SEC_VOLTAGE_HORIZONTAL SEC_VOLTAGE_18 -#define SEC_VOLTAGE_VERTICAL SEC_VOLTAGE_13 - -typedef uint32_t secToneMode; - -typedef enum { - SEC_TONE_ON, - SEC_TONE_OFF -} secToneMode_t; - - -typedef uint32_t secMiniCmd; - -typedef enum { - SEC_MINI_NONE, - SEC_MINI_A, - SEC_MINI_B -} secMiniCmd_t; - -struct secStatus { - int32_t busMode; - secVoltage selVolt; - secToneMode contTone; -}; - -enum { - SEC_BUS_IDLE, - SEC_BUS_BUSY, - SEC_BUS_OFF, - SEC_BUS_OVERLOAD -}; - -struct secCommand { - int32_t type; - union { - struct secDiseqcCmd diseqc; - uint8_t vsec; - uint32_t pause; - } u; -}; - -struct secCmdSequence { - secVoltage voltage; - secMiniCmd miniCommand; - secToneMode continuousTone; - - uint32_t numCommands; - struct secCommand* commands; -}; - -enum { - SEC_CMDTYPE_DISEQC, - SEC_CMDTYPE_VSEC, - SEC_CMDTYPE_PAUSE -}; - - -#define SEC_GET_STATUS _IOR('o',91,struct secStatus *) -#define SEC_RESET_OVERLOAD _IOW('o',92,void) -#define SEC_SEND_SEQUENCE _IOW('o',93,struct secCmdSequence *) -#define SEC_SET_TONE _IOW('o',94,secToneMode) -#define SEC_SET_VOLTAGE _IOW('o',95,secVoltage) - -typedef enum { - SEC_DISEQC_SENT, - SEC_VSEC_SENT, - SEC_PAUSE_COMPLETE, - SEC_CALLBACK_ERROR -} secCallback_t; - - -#endif /*_OST_SEC_H_*/ -- cgit v1.2.3