… | |
… | |
10 | |
10 | |
11 | This module provides an interface to the Linux DVB API. It is a straightforward |
11 | This module provides an interface to the Linux DVB API. It is a straightforward |
12 | translation of the C API. You should read the Linux DVB API description to make |
12 | translation of the C API. You should read the Linux DVB API description to make |
13 | any sense of this module. It can be found here: |
13 | any sense of this module. It can be found here: |
14 | |
14 | |
15 | http://www.linuxtv.org/developer/dvbapi.xml |
15 | http://www.linuxtv.org/docs/dvbapi/dvbapi.html |
16 | |
16 | |
17 | All constants from F<frontend.h> and F<demux.h> are exported by their C |
17 | All constants from F<frontend.h> and F<demux.h> are exported by their C |
18 | name and by default. |
18 | name and by default. |
19 | |
19 | |
20 | Noteworthy differences to the C API: unions and sub-structs are usually |
20 | Noteworthy differences to the C API: unions and sub-structs are usually |
… | |
… | |
30 | package Linux::DVB; |
30 | package Linux::DVB; |
31 | |
31 | |
32 | use Fcntl (); |
32 | use Fcntl (); |
33 | |
33 | |
34 | BEGIN { |
34 | BEGIN { |
35 | $VERSION = '0.02'; |
35 | $VERSION = '0.2'; |
36 | @ISA = qw(Exporter); |
36 | @ISA = qw(Exporter); |
37 | |
37 | |
38 | require XSLoader; |
38 | require XSLoader; |
39 | XSLoader::load __PACKAGE__, $VERSION; |
39 | XSLoader::load __PACKAGE__, $VERSION; |
40 | |
40 | |
… | |
… | |
111 | sub ber { _read_ber ($_[0]{fd}) } |
111 | sub ber { _read_ber ($_[0]{fd}) } |
112 | sub snr { _snr ($_[0]{fd}) } |
112 | sub snr { _snr ($_[0]{fd}) } |
113 | sub signal_strength { _signal_strength ($_[0]{fd}) } |
113 | sub signal_strength { _signal_strength ($_[0]{fd}) } |
114 | sub uncorrected { _uncorrected ($_[0]{fd}) } |
114 | sub uncorrected { _uncorrected ($_[0]{fd}) } |
115 | |
115 | |
116 | #sub set { _set ($_[0]{fd}, $_[0]{type}) } |
116 | =item $fe->set (parameter => value, ...) |
|
|
117 | |
|
|
118 | Sets frontend parameters. All values are stuffed into the |
|
|
119 | C<dvb_frontend_parameters> structure without conversion and passed to |
|
|
120 | FE_SET_FRONTEND. |
|
|
121 | |
|
|
122 | Returns true on success. |
|
|
123 | |
|
|
124 | All modes: |
|
|
125 | |
|
|
126 | frequency => |
|
|
127 | inversion => |
|
|
128 | |
|
|
129 | QPSK frontends: |
|
|
130 | |
|
|
131 | symbol_rate => |
|
|
132 | fec_inner => |
|
|
133 | |
|
|
134 | QAM frontends: |
|
|
135 | |
|
|
136 | symbol_rate => |
|
|
137 | fec_inner => |
|
|
138 | modulation => |
|
|
139 | |
|
|
140 | QFDM frontends: |
|
|
141 | |
|
|
142 | bandwidth => |
|
|
143 | code_rate_HP => |
|
|
144 | code_rate_LP => |
|
|
145 | constellation => |
|
|
146 | transmission_mode => |
|
|
147 | |
|
|
148 | =cut |
|
|
149 | |
|
|
150 | sub set { |
|
|
151 | my ($self) = shift; |
|
|
152 | _set $self->{fd}, { @_ }, $self->{type} |
|
|
153 | } |
|
|
154 | |
|
|
155 | =item $fe->parameters |
|
|
156 | |
|
|
157 | Calls FE_GET_FRONTEND and returns a hash reference that contains the same keys |
|
|
158 | as given to the C<set> method. |
|
|
159 | |
|
|
160 | Example: |
|
|
161 | |
|
|
162 | Data::Dumper::Dumper $fe->get |
|
|
163 | |
|
|
164 | { |
|
|
165 | frequency => 426000000, # 426 Mhz |
|
|
166 | inversion => 0, # INVERSION_OFF |
|
|
167 | symbol_rate => 6900000, # 6.9 MB/s |
|
|
168 | fec_inner => 0, # FEC_NONE |
|
|
169 | modulation => 3, # QAM_64 |
|
|
170 | } |
|
|
171 | |
|
|
172 | =cut |
|
|
173 | |
117 | sub parameters { _get ($_[0]{fd}, $_[0]{type}) } |
174 | sub parameters { _get ($_[0]{fd}, $_[0]{type}) } |
|
|
175 | sub get { _get ($_[0]{fd}, $_[0]{type}) } # unannounced alias |
118 | sub event { _event ($_[0]{fd}, $_[0]{type}) } |
176 | sub event { _event ($_[0]{fd}, $_[0]{type}) } |
119 | |
177 | |
120 | package Linux::DVB::Demux; |
178 | package Linux::DVB::Demux; |
121 | |
179 | |
122 | @ISA = qw(Linux::DVB); |
180 | @ISA = qw(Linux::DVB); |