demux_ts: avoid using unitialized data
[mplayer.git] / stream / dvbin.h
blob8f7ff28d40b481728ed4d3ed88795d2cbee6fb8b
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 <inttypes.h>
19 #include <linux/dvb/dmx.h>
20 #include <linux/dvb/frontend.h>
21 #include <linux/dvb/version.h>
23 #undef DVB_ATSC
24 #if defined(DVB_API_VERSION_MINOR)
26 /* kernel headers >=2.6.28 have version 5.
28 * FIXME: are there any real differences between 3.1 and 5?
31 #if (DVB_API_VERSION == 3 && DVB_API_VERSION_MINOR >= 1) || DVB_API_VERSION == 5
32 #define DVB_ATSC 1
33 #endif
35 #endif
38 #define DVB_CHANNEL_LOWER -1
39 #define DVB_CHANNEL_HIGHER 1
41 #ifndef DMX_FILTER_SIZE
42 #define DMX_FILTER_SIZE 16
43 #endif
45 typedef struct {
46 char *name;
47 int freq, srate, diseqc, tone;
48 char pol;
49 int tpid, dpid1, dpid2, progid, ca, pids[DMX_FILTER_SIZE], pids_cnt;
50 fe_spectral_inversion_t inv;
51 fe_modulation_t mod;
52 fe_transmit_mode_t trans;
53 fe_bandwidth_t bw;
54 fe_guard_interval_t gi;
55 fe_code_rate_t cr, cr_lp;
56 fe_hierarchy_t hier;
57 } dvb_channel_t;
59 typedef struct {
60 uint16_t NUM_CHANNELS;
61 uint16_t current;
62 dvb_channel_t *channels;
63 } dvb_channels_list;
65 typedef struct {
66 int type;
67 dvb_channels_list *list;
68 char *name;
69 int devno;
70 } dvb_card_config_t;
72 typedef struct {
73 int count;
74 dvb_card_config_t *cards;
75 void *priv;
76 } dvb_config_t;
78 typedef struct {
79 int card;
80 int fe_fd;
81 int sec_fd;
82 int demux_fd[3], demux_fds[DMX_FILTER_SIZE], demux_fds_cnt;
83 int dvr_fd;
85 dvb_config_t *config;
86 dvb_channels_list *list;
87 int tuner_type;
88 int is_on;
89 int retry;
90 int timeout;
91 int last_freq;
92 } dvb_priv_t;
95 #define TUNER_SAT 1
96 #define TUNER_TER 2
97 #define TUNER_CBL 3
98 #define TUNER_ATSC 4
100 int dvb_step_channel(stream_t *, int);
101 int dvb_set_channel(stream_t *, int, int);
102 dvb_config_t *dvb_get_config(void);
103 void dvb_free_config(dvb_config_t *config);
105 #endif /* MPLAYER_DVBIN_H */