.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "DVB 3pm" .TH DVB 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Linux::DVB \- interface to (some parts of) the Linux DVB API .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Linux::DVB; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module provides an interface to the Linux DVB API. It is a straightforward translation of the C API. You should read the Linux DVB API description to make any sense of this module. It can be found here: .PP .Vb 1 \& http://www.linuxtv.org/docs/dvbapi/dvbapi.html .Ve .PP All constants from \fIfrontend.h\fR and \fIdemux.h\fR are exported by their C name and by default. .PP Noteworthy differences to the C API: unions and sub-structs are usually translated into flat perl hashes, i.e \f(CW\*(C`struct.u.qam.symbol_rate\*(C'\fR becomes \f(CW\*(C`$struct\->{symbol_rate}\*(C'\fR. .PP Noteworthy limitations of this module include: No interface to the video, audio and net devices. If you need this functionality bug the author. .SH "Linux::DVB::Frontend CLASS" .IX Header "Linux::DVB::Frontend CLASS" .SS SYNOPSIS .IX Subsection "SYNOPSIS" .Vb 1 \& my $fe = new Linux::DVB::Frontend $path, $writable; \& \& my $fe = new Linux::DVB::Frontend \& "/dev/dvb/adapter0/frontend0", 1; \& \& $fe\->fh; # filehandle \& $fe\->fd; # fileno \& $fe\->blocking (0); # or 1 \& \& $fe\->{name} \& $fe\->{type} \& $fe\->frontend_info\->{name} \& \& $fe\->status & FE_HAS_LOCK \& print $fe\->ber, $fe\->snr, $fe\->signal_strength, $fe\->uncorrected; \& \& my $tune = $fe\->parameters; \& $tune\->{frequency}; \& $tune\->{symbol_rate}; .Ve .ie n .IP "$fe\->set (parameter => value, ...)" 4 .el .IP "\f(CW$fe\fR\->set (parameter => value, ...)" 4 .IX Item "$fe->set (parameter => value, ...)" Sets frontend parameters. All values are stuffed into the \&\f(CW\*(C`dvb_frontend_parameters\*(C'\fR structure without conversion and passed to FE_SET_FRONTEND. .Sp Returns true on success. .Sp All modes: .Sp .Vb 2 \& frequency => \& inversion => .Ve .Sp QPSK frontends: .Sp .Vb 2 \& symbol_rate => \& fec_inner => .Ve .Sp QAM frontends: .Sp .Vb 2 \& symbol_rate => \& modulation => .Ve .Sp QFDM frontends: .Sp .Vb 5 \& bandwidth => \& code_rate_HP => \& code_rate_LP => \& constellation => \& transmission_mode => .Ve .ie n .IP $fe\->parameters 4 .el .IP \f(CW$fe\fR\->parameters 4 .IX Item "$fe->parameters" Calls FE_GET_FRONTEND and returns a hash reference that contains the same keys as given to the \f(CW\*(C`set\*(C'\fR method. .Sp Example: .Sp .Vb 1 \& Data::Dumper::Dumper $fe\->get \& \& { \& frequency => 426000000, # 426 Mhz \& inversion => 0, # INVERSION_OFF \& symbol_rate => 6900000, # 6.9 MB/s \& modulation => 3, # QAM_64 \& } .Ve .ie n .IP "$ok = $fe\->diseqc_reset_overload" 4 .el .IP "\f(CW$ok\fR = \f(CW$fe\fR\->diseqc_reset_overload" 4 .IX Item "$ok = $fe->diseqc_reset_overload" If the bus has been automatically powered off due to power overload, this call restores the power to the bus. The call requires read/write access to the device. This call has no effect if the device is manually powered off. Not all DVB adapters support this call. .ie n .IP "$ok = $fe\->diseqc_voltage (13|18)" 4 .el .IP "\f(CW$ok\fR = \f(CW$fe\fR\->diseqc_voltage (13|18)" 4 .IX Item "$ok = $fe->diseqc_voltage (13|18)" Set the DiSEqC voltage to either 13 or 18 volts. .ie n .IP "$ok = $fe\->diseqc_tone (1|0)" 4 .el .IP "\f(CW$ok\fR = \f(CW$fe\fR\->diseqc_tone (1|0)" 4 .IX Item "$ok = $fe->diseqc_tone (1|0)" Enables (1) or disables (0) the DiSEqC continuous 22khz tone generation. .ie n .IP "$ok = $fe\->diseqc_send_burst (0|1)" 4 .el .IP "\f(CW$ok\fR = \f(CW$fe\fR\->diseqc_send_burst (0|1)" 4 .IX Item "$ok = $fe->diseqc_send_burst (0|1)" Sends a 22KHz tone burst of type SEC_MINI_A (0) or SEC_MINI_B (1). .ie n .IP "$ok = $fe\->diseqc_cmd ($command)" 4 .el .IP "\f(CW$ok\fR = \f(CW$fe\fR\->diseqc_cmd ($command)" 4 .IX Item "$ok = $fe->diseqc_cmd ($command)" Sends a DiSEqC command ($command is 3 to 6 bytes of binary data). .ie n .IP "$reply = $fe\->diseqc_reply ($timeout)" 4 .el .IP "\f(CW$reply\fR = \f(CW$fe\fR\->diseqc_reply ($timeout)" 4 .IX Item "$reply = $fe->diseqc_reply ($timeout)" Receives a reply to a DiSEqC 2.0 command and returns it as a binary octet string 0..4 bytes in length (or \f(CW\*(C`undef\*(C'\fR in the error case). .SH "Linux::DVB::Demux CLASS" .IX Header "Linux::DVB::Demux CLASS" .SS SYNOPSIS .IX Subsection "SYNOPSIS" .Vb 2 \& my $dmx = new Linux::DVB::Demux \& "/dev/dvb/adapter0/demux0"; \& \& $fe\->fh; # filehandle \& $fe\->fd; # fileno \& $fe\->blocking (1); # non\-blocking is default \& \& $dmx\->buffer (16384); \& $dmx\->sct_filter ($pid, "filter", "mask", $timeout=0, $flags=DMX_CHECK_CRC); \& $dmx\->pes_filter ($pid, $input, $output, $type, $flags=0); \& $dmx\->start; \& $dmx\->stop; .Ve .SH "Linux::DVB::Decode CLASS" .IX Header "Linux::DVB::Decode CLASS" .SS SYNOPSIS .IX Subsection "SYNOPSIS" .Vb 1 \& $si_decoded_hashref = Linux::DVB::Decode::si $section_data; .Ve .ie n .IP "$hashref = Linux::DVB::Decode::si $section_data" 4 .el .IP "\f(CW$hashref\fR = Linux::DVB::Decode::si \f(CW$section_data\fR" 4 .IX Item "$hashref = Linux::DVB::Decode::si $section_data" Tries to parse the string inside \f(CW$section_data\fR as an SI table and return it as a hash reference. Only the first SI table will be returned as hash reference, and the \f(CW$section_data\fR will be modified in-place by removing the table data. .Sp The way to use this function is to append new data to your \&\f(CW$section_data\fR and then call \f(CW\*(C`Linux::DVB::Decode::si\*(C'\fR in a loop until it returns \f(CW\*(C`undef\*(C'\fR. Please ntoe, however, that the Linux DVB API will return only one table at a time from sysread, so you can safely assume that every sysread will return exactly one (or zero in case of errors) SI table. .Sp Here is an example of what to expect: .Sp .Vb 10 \& { \& \*(Aqsegment_last_section_number\*(Aq => 112, \& \*(Aqtable_id\*(Aq => 81, \& \*(Aqservice_id\*(Aq => 28129, \& \*(Aqoriginal_network_id\*(Aq => 1, \& \*(Aqsection_syntax_indicator\*(Aq => 1, \& \*(Aqcurrent_next_indicator\*(Aq => 1, \& \*(Aqevents\*(Aq => [ \& { \& \*(Aqrunning_status\*(Aq => 0, \& \*(Aqstart_time_hms\*(Aq => 2097152, \& \*(Aqevent_id\*(Aq => 39505, \& \*(Aqfree_CA_mode\*(Aq => 0, \& \*(Aqstart_time_mjd\*(Aq => 53470, \& \*(Aqdescriptors\*(Aq => [ \& { \& \*(Aqevent_name\*(Aq => \*(AqNachrichten\*(Aq, \& \*(Aqtext\*(Aq => \*(Aq\*(Aq, \& \*(AqISO_639_language_code\*(Aq => \*(Aqdeu\*(Aq, \& \*(Aqtype\*(Aq => 77 \& }, \& { \& \*(Aqprogramme_identification_label\*(Aq => 337280, \& \*(Aqtype\*(Aq => 105 \& }, \& { \& \*(Aqraw_data\*(Aq => \*(Aq22:0010.04#00\*(Aq, \& \*(Aqtype\*(Aq => 130 \& } \& ], \& \*(Aqduration\*(Aq => 1280 \& }, \& { \& \*(Aqrunning_status\*(Aq => 0, \& \*(Aqstart_time_hms\*(Aq => 2098432, \& \*(Aqevent_id\*(Aq => 39506, \& \*(Aqfree_CA_mode\*(Aq => 0, \& \*(Aqstart_time_mjd\*(Aq => 53470, \& \*(Aqdescriptors\*(Aq => [ \& { \& \*(Aqevent_name\*(Aq => \*(AqSR 1 \- Nachtwerk\*(Aq, \& \*(Aqtext\*(Aq => \*(Aq\*(Aq, \& \*(AqISO_639_language_code\*(Aq => \*(Aqdeu\*(Aq, \& \*(Aqtype\*(Aq => 77 \& }, \& { \& \*(Aqprogramme_identification_label\*(Aq => 337285, \& \*(Aqtype\*(Aq => 105 \& }, \& { \& \*(Aqraw_data\*(Aq => \*(Aq22:0510.04#00\*(Aq, \& \*(Aqtype\*(Aq => 130 \& } \& ], \& \*(Aqduration\*(Aq => 87296 \& } \& ], \& \*(Aqlast_table_id\*(Aq => 81, \& \*(Aqsection_number\*(Aq => 112, \& \*(Aqlast_section_number\*(Aq => 176, \& \*(Aqversion_number\*(Aq => 31, \& \*(Aqtransport_stream_id\*(Aq => 1101 \& } .Ve .ie n .IP "$text = Linux::DVB::Decode::text $data" 4 .el .IP "\f(CW$text\fR = Linux::DVB::Decode::text \f(CW$data\fR" 4 .IX Item "$text = Linux::DVB::Decode::text $data" Converts text found in DVB si tables into perl text. Only iso\-8859\-1..\-11 and UTF\-16 is supported, other encodings (big5 etc. is not. Bug me if you need this). .ie n .IP %Linux::DVB::Decode::nibble_to_genre 4 .el .IP \f(CW%Linux::DVB::Decode::nibble_to_genre\fR 4 .IX Item "%Linux::DVB::Decode::nibble_to_genre" A two-level hash mapping genre nibbles to genres, e.g. .Sp .Vb 2 \& $Linux::DVB::Decode::nibble_to_genre{7}{6} \& => \*(Aqfilm/cinema\*(Aq .Ve .ie n .IP "($sec,$min,$hour) = Linux::DVB::Decode::time $hms" 4 .el .IP "($sec,$min,$hour) = Linux::DVB::Decode::time \f(CW$hms\fR" 4 .IX Item "($sec,$min,$hour) = Linux::DVB::Decode::time $hms" .PD 0 .ie n .IP "($mday,$mon,$year) = Linux::DVB::Decode::date $mjd" 4 .el .IP "($mday,$mon,$year) = Linux::DVB::Decode::date \f(CW$mjd\fR" 4 .IX Item "($mday,$mon,$year) = Linux::DVB::Decode::date $mjd" .ie n .IP "($sec,$min,$hour,$mday,$mon,$year) = Linux::DVB::Decode::datetime $mjd, $hms" 4 .el .IP "($sec,$min,$hour,$mday,$mon,$year) = Linux::DVB::Decode::datetime \f(CW$mjd\fR, \f(CW$hms\fR" 4 .IX Item "($sec,$min,$hour,$mday,$mon,$year) = Linux::DVB::Decode::datetime $mjd, $hms" .ie n .IP "$sec = Linux::DVB::Decode::time_linear $hms" 4 .el .IP "\f(CW$sec\fR = Linux::DVB::Decode::time_linear \f(CW$hms\fR" 4 .IX Item "$sec = Linux::DVB::Decode::time_linear $hms" .ie n .IP "$sec = Linux::DVB::Decode::datetime_linear $mjd, $hms" 4 .el .IP "\f(CW$sec\fR = Linux::DVB::Decode::datetime_linear \f(CW$mjd\fR, \f(CW$hms\fR" 4 .IX Item "$sec = Linux::DVB::Decode::datetime_linear $mjd, $hms" .PD Break down a "DVB time" (modified julian date + bcd encoded seconds) into it's components (non\-\f(CW\*(C`_linear\*(C'\fR) or into a seconds count (\f(CW\*(C`_linear\*(C'\fR variants) since the epoch (\f(CW\*(C`datetime_linear\*(C'\fR) or the start of the day (\f(CW\*(C`time_linear\*(C'\fR). .Sp The format of the returns value of the date and datetime functions is \&\fInot\fR compatible with \f(CW\*(C`Time::Local\*(C'\fR. Use the \f(CW\*(C`_linear\*(C'\fR functions instead. .Sp Example: .Sp .Vb 4 \& my $time = Linux::DVB::Decode::datetime_linear $mjd, $hms \& printf "Starts at %s\en", \& POSIX::strftime "%Y\-%m\-%d %H:%M:%S", \& localtime $time; .Ve .SH AUTHORS .IX Header "AUTHORS" .Vb 2 \& Marc Lehmann , http://home.schmorp.de/ \& Magnus Schmidt, eMail at http://www.27b\-6.de/email.php .Ve