1 | #!/opt/bin/perl |
1 | #!/opt/bin/perl |
|
|
2 | |
|
|
3 | # extract whatever data available in the currently tuned transponder |
|
|
4 | |
|
|
5 | # this program is slightly overdesigned as it is was the base for a |
|
|
6 | # larger program, it still shows how to react to channel changes |
|
|
7 | # and scan pids and decode si info. |
|
|
8 | |
|
|
9 | my $PID = 18; # epg data and more |
2 | |
10 | |
3 | use Event; |
11 | use Event; |
4 | use Linux::DVB; |
12 | use Linux::DVB; |
5 | |
13 | |
6 | use Data::Dumper; |
14 | use Data::Dumper; |
… | |
… | |
15 | |
23 | |
16 | sub new { |
24 | sub new { |
17 | print "new scanner\n"; |
25 | print "new scanner\n"; |
18 | my $self = bless { }; |
26 | my $self = bless { }; |
19 | |
27 | |
20 | $self->{10} = ::new_demux; |
28 | $self->{dmx} = ::new_demux; |
21 | $self->{10}->sct_filter (18, "", ""); |
29 | $self->{dmx}->sct_filter ($PID, "", ""); |
22 | $self->{10}->start; |
30 | $self->{dmx}->start; |
23 | |
31 | |
24 | $self->{w} = Event->io (fd => $self->{10}->fh, poll => 'r', cb => sub { |
32 | $self->{w} = Event->io (fd => $self->{dmx}->fh, poll => 'r', cb => sub { |
25 | sysread $self->{10}->fh, my $data, 8192; |
33 | sysread $self->{dmx}->fh, my $data, 8192; |
26 | print PApp::Util::dumpval Linux::DVB::Decode::si $data; |
34 | print Data::Dumper::Dumper Linux::DVB::Decode::si $data; |
27 | }); |
35 | }); |
28 | } |
36 | } |
29 | |
37 | |
30 | sub DESTROY { |
38 | sub DESTROY { |
31 | my $self = shift; |
39 | my $self = shift; |