aboutsummaryrefslogtreecommitdiffstats
path: root/util/dvbscan/dvbscan.h
blob: ddf61cf1d0b5d444d9ac5f864b193e37930752e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
	dvbscan utility

	Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 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 General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef DVBSCAN_H
#define DVBSCAN_H 1

#include <libdvbapi/dvbfe.h>
#include <libdvbsec/dvbsec_api.h>
#include <libucsi/types.h>

/**
 * A stream which is part of a service.
 */
struct stream
{
	uint8_t stream_type;
	iso639lang_t language;

	struct stream *next;
};

/**
 * A service (programme) which is part of a transponder.
 */
struct service
{
	/**
	 * Service identification stuff. Strings are in UTF-8.
	 */
	uint16_t service_id;
	char *provider_name;
	char *service_name;

	/**
	 * Pids common to the whole service.
	 */
	uint16_t pmt_pid;
	uint16_t pcr_pid;

	/**
	 * CA stuff.
	 */
	uint16_t *ca_ids;
	uint32_t ca_ids_count;
	uint8_t is_scrambled;

	/**
	 * BBC channel number (-1 if unknown).
	 */
	int bbc_channel_number;

	/**
	 * Streams composing this service.
	 */
	struct stream *streams;
	struct stream *streams_end;

	/**
	 * Next service in list.
	 */
	struct service *next;
};

/**
 * A collection of multiplexed services.
 */
struct transponder
{
	/**
	 * we need to have a seperate list of frequencies since the
	 * DVB standard allows a frequency list descriptor of alternate
	 * frequencies to be supplied.
	 */
	uint32_t *frequencies;
	uint32_t frequency_count;

	/**
	 * The rest of the tuning parameters.
	 */
	struct dvbfe_parameters params;

	/**
	 * DVBS specific parameters
	 */
	enum dvbsec_diseqc_polarization polarization;
	int oribital_position;

	/**
	 * Numerical IDs
	 */
	uint16_t network_id;
	uint16_t original_network_id;
	uint16_t transport_stream_id;

	/**
	 * Services detected on this transponder.
	 */
	struct service *services;
	struct service *services_end;

	/**
	 * Next item in list.
	 */
	struct transponder *next;
};

extern void append_transponder(struct transponder *t, struct transponder **tlist, struct transponder **tlist_end);
extern struct transponder *new_transponder(void);
extern void free_transponder(struct transponder *t);
extern int seen_transponder(struct transponder *t, struct transponder *checklist);
extern void add_frequency(struct transponder *t, uint32_t frequency);
extern struct transponder *first_transponder(struct transponder **tlist, struct transponder **tlist_end);

extern int create_section_filter(int adapter, int demux, uint16_t pid, uint8_t table_id);
extern void dvbscan_scan_dvb(struct dvbfe_handle *fe);
extern void dvbscan_scan_atsc(struct dvbfe_handle *fe);

#endif