sync with en/mplayer.1 rev. 30936
[mplayer/glamo.git] / stream / dvbin.h
blobe278e7948951f99712ed02adfa56361c9ebe7a71
1 /* Imported from the dvbstream project
3 * Modified for use with MPlayer, for details see the changelog at
4 * http://svn.mplayerhq.hu/mplayer/trunk/
5 * $Id$
6 */
8 #ifndef MPLAYER_DVBIN_H
9 #define MPLAYER_DVBIN_H
11 #include "config.h"
12 #include "stream.h"
14 #define SLOF (11700*1000UL)
15 #define LOF1 (9750*1000UL)
16 #define LOF2 (10600*1000UL)
18 #include <linux/dvb/dmx.h>
19 #include <linux/dvb/frontend.h>
20 #include <linux/dvb/version.h>
22 #undef DVB_ATSC
23 #if defined(DVB_API_VERSION_MINOR)
25 /* kernel headers >=2.6.28 have version 5.
27 * FIXME: are there any real differences between 3.1 and 5?
30 #if (DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR >= 1) || DVB_API_VERSION == 5
31 #define DVB_ATSC 1
32 #endif
34 #endif
37 #define DVB_CHANNEL_LOWER -1
38 #define DVB_CHANNEL_HIGHER 1
40 #include "inttypes.h"
42 #ifndef DMX_FILTER_SIZE
43 #define DMX_FILTER_SIZE 16
44 #endif
46 typedef struct {
47 char *name;
48 int freq, srate, diseqc, tone;
49 char pol;
50 int tpid, dpid1, dpid2, progid, ca, pids[DMX_FILTER_SIZE], pids_cnt;
51 fe_spectral_inversion_t inv;
52 fe_modulation_t mod;
53 fe_transmit_mode_t trans;
54 fe_bandwidth_t bw;
55 fe_guard_interval_t gi;
56 fe_code_rate_t cr, cr_lp;
57 fe_hierarchy_t hier;
58 } dvb_channel_t;
60 typedef struct {
61 uint16_t NUM_CHANNELS;
62 uint16_t current;
63 dvb_channel_t *channels;
64 } dvb_channels_list;
66 typedef struct {
67 int type;
68 dvb_channels_list *list;
69 char *name;
70 int devno;
71 } dvb_card_config_t;
73 typedef struct {
74 int count;
75 dvb_card_config_t *cards;
76 void *priv;
77 } dvb_config_t;
79 typedef struct {
80 int card;
81 int fe_fd;
82 int sec_fd;
83 int demux_fd[3], demux_fds[DMX_FILTER_SIZE], demux_fds_cnt;
84 int dvr_fd;
86 dvb_config_t *config;
87 dvb_channels_list *list;
88 int tuner_type;
89 int is_on;
90 int retry;
91 int timeout;
92 int last_freq;
93 } dvb_priv_t;
96 #define TUNER_SAT 1
97 #define TUNER_TER 2
98 #define TUNER_CBL 3
99 #define TUNER_ATSC 4
101 int dvb_step_channel(stream_t *, int);
102 int dvb_set_channel(stream_t *, int, int);
103 dvb_config_t *dvb_get_config(void);
104 void dvb_free_config(dvb_config_t *config);
106 #endif /* MPLAYER_DVBIN_H */