2005-04-16 12:51:09 +00:00
|
|
|
/* Imported from the dvbstream project
|
|
|
|
*
|
2006-06-22 13:34:00 +00:00
|
|
|
* Modified for use with MPlayer, for details see the changelog at
|
|
|
|
* http://svn.mplayerhq.hu/mplayer/trunk/
|
2005-04-16 12:51:09 +00:00
|
|
|
* $Id$
|
|
|
|
*/
|
2003-03-16 20:13:28 +00:00
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#ifndef MPLAYER_DVBIN_H
|
|
|
|
#define MPLAYER_DVBIN_H
|
2003-03-16 20:13:28 +00:00
|
|
|
|
2010-01-04 18:58:35 +00:00
|
|
|
#include "config.h"
|
2003-08-11 00:02:46 +00:00
|
|
|
#include "stream.h"
|
|
|
|
|
2015-01-06 19:19:49 +00:00
|
|
|
#define SLOF (11700 * 1000UL)
|
|
|
|
#define LOF1 (9750 * 1000UL)
|
|
|
|
#define LOF2 (10600 * 1000UL)
|
2006-07-14 22:07:05 +00:00
|
|
|
|
2010-06-21 14:39:24 +00:00
|
|
|
#include <inttypes.h>
|
2010-03-02 19:57:17 +00:00
|
|
|
#include <linux/dvb/dmx.h>
|
|
|
|
#include <linux/dvb/frontend.h>
|
|
|
|
#include <linux/dvb/version.h>
|
2003-03-16 20:13:28 +00:00
|
|
|
|
2005-01-06 09:43:10 +00:00
|
|
|
#undef DVB_ATSC
|
|
|
|
#if defined(DVB_API_VERSION_MINOR)
|
2009-02-22 14:12:33 +00:00
|
|
|
|
|
|
|
/* kernel headers >=2.6.28 have version 5.
|
|
|
|
*
|
2014-12-30 19:33:16 +00:00
|
|
|
* Version 5 is also called S2API, it adds support for tuning to S2 channels
|
2015-01-06 19:19:49 +00:00
|
|
|
* and is extensible for future delivery systems. Old API is deprecated.
|
|
|
|
* StreamID-implementation only supported since API >=5.2.
|
2009-02-22 14:12:33 +00:00
|
|
|
*/
|
|
|
|
|
2014-12-30 19:33:16 +00:00
|
|
|
#if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 2)
|
|
|
|
#define DVB_USE_S2API 1
|
|
|
|
|
2015-01-06 19:19:49 +00:00
|
|
|
// This had a different name until API 5.8.
|
2014-12-30 19:33:16 +00:00
|
|
|
#ifndef DTV_STREAM_ID
|
|
|
|
#define DTV_STREAM_ID DTV_ISDBS_TS_ID
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// This is only defined, for convenience, since API 5.8.
|
|
|
|
#ifndef NO_STREAM_ID_FILTER
|
|
|
|
#define NO_STREAM_ID_FILTER (~0U)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2009-02-22 14:12:33 +00:00
|
|
|
#if (DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR >= 1) || DVB_API_VERSION == 5
|
2005-01-06 09:43:10 +00:00
|
|
|
#define DVB_ATSC 1
|
|
|
|
#endif
|
2009-02-22 14:12:33 +00:00
|
|
|
|
2005-01-06 09:43:10 +00:00
|
|
|
#endif
|
2003-03-16 20:13:28 +00:00
|
|
|
|
|
|
|
#define DVB_CHANNEL_LOWER -1
|
|
|
|
#define DVB_CHANNEL_HIGHER 1
|
|
|
|
|
2004-07-12 20:52:02 +00:00
|
|
|
#ifndef DMX_FILTER_SIZE
|
2015-01-05 19:27:22 +00:00
|
|
|
#define DMX_FILTER_SIZE 32
|
2004-07-12 20:52:02 +00:00
|
|
|
#endif
|
2003-03-16 20:13:28 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2015-01-06 19:19:49 +00:00
|
|
|
char *name;
|
|
|
|
int freq, srate, diseqc, tone;
|
|
|
|
char pol;
|
|
|
|
int tpid, dpid1, dpid2, progid, ca, pids[DMX_FILTER_SIZE], pids_cnt;
|
|
|
|
bool is_dvb_s2;
|
|
|
|
int stream_id;
|
|
|
|
int service_id;
|
|
|
|
fe_spectral_inversion_t inv;
|
|
|
|
fe_modulation_t mod;
|
|
|
|
fe_transmit_mode_t trans;
|
|
|
|
fe_bandwidth_t bw;
|
|
|
|
fe_guard_interval_t gi;
|
|
|
|
fe_code_rate_t cr, cr_lp;
|
|
|
|
fe_hierarchy_t hier;
|
2003-03-16 20:13:28 +00:00
|
|
|
} dvb_channel_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2015-01-06 19:19:49 +00:00
|
|
|
uint16_t NUM_CHANNELS;
|
|
|
|
uint16_t current;
|
|
|
|
dvb_channel_t *channels;
|
2003-03-16 20:13:28 +00:00
|
|
|
} dvb_channels_list;
|
|
|
|
|
2004-04-26 21:22:33 +00:00
|
|
|
typedef struct {
|
2015-01-06 19:19:49 +00:00
|
|
|
int type;
|
|
|
|
dvb_channels_list *list;
|
|
|
|
char *name;
|
|
|
|
int devno;
|
2004-04-26 21:22:33 +00:00
|
|
|
} dvb_card_config_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2015-01-06 19:19:49 +00:00
|
|
|
int count;
|
|
|
|
dvb_card_config_t *cards;
|
|
|
|
void *priv;
|
2004-04-26 21:22:33 +00:00
|
|
|
} dvb_config_t;
|
2003-03-16 20:13:28 +00:00
|
|
|
|
2014-06-10 19:44:50 +00:00
|
|
|
typedef struct dvb_params {
|
2015-01-06 19:19:49 +00:00
|
|
|
struct mp_log *log;
|
|
|
|
int fd;
|
|
|
|
int card;
|
|
|
|
int fe_fd;
|
|
|
|
int sec_fd;
|
|
|
|
int demux_fd[3], demux_fds[DMX_FILTER_SIZE], demux_fds_cnt;
|
|
|
|
int dvr_fd;
|
|
|
|
|
|
|
|
dvb_config_t *config;
|
|
|
|
dvb_channels_list *list;
|
|
|
|
int tuner_type;
|
|
|
|
int is_on;
|
|
|
|
int retry;
|
|
|
|
int timeout;
|
|
|
|
int last_freq;
|
|
|
|
|
|
|
|
char *cfg_prog;
|
|
|
|
int cfg_card;
|
|
|
|
int cfg_timeout;
|
|
|
|
char *cfg_file;
|
|
|
|
|
|
|
|
int cfg_full_transponder;
|
2003-03-16 20:13:28 +00:00
|
|
|
} dvb_priv_t;
|
|
|
|
|
2014-04-13 16:00:51 +00:00
|
|
|
#define TUNER_SAT 1
|
|
|
|
#define TUNER_TER 2
|
|
|
|
#define TUNER_CBL 3
|
|
|
|
#define TUNER_ATSC 4
|
2003-03-16 20:13:28 +00:00
|
|
|
|
2008-12-03 23:01:03 +00:00
|
|
|
int dvb_step_channel(stream_t *, int);
|
|
|
|
int dvb_set_channel(stream_t *, int, int);
|
2013-12-21 19:36:45 +00:00
|
|
|
dvb_config_t *dvb_get_config(stream_t *);
|
2008-12-03 23:01:03 +00:00
|
|
|
void dvb_free_config(dvb_config_t *config);
|
2003-03-16 20:13:28 +00:00
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#endif /* MPLAYER_DVBIN_H */
|