ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-DVB/eg/extract-si
(Generate patch)

Comparing Linux-DVB/eg/extract-si (file contents):
Revision 1.1 by root, Mon Sep 6 06:25:12 2004 UTC vs.
Revision 1.2 by root, Mon Sep 6 06:28:33 2004 UTC

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
9my $PID = 18; # epg data and more
2 10
3use Event; 11use Event;
4use Linux::DVB; 12use Linux::DVB;
5 13
6use Data::Dumper; 14use Data::Dumper;
15 23
16sub new { 24sub 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
30sub DESTROY { 38sub DESTROY {
31 my $self = shift; 39 my $self = shift;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines