libdvbv5
1.4.0
Library to work with Digital TV streams
|
Provides interfaces to deal with DVB channel and program files. More...
#include "dvb-fe.h"
Go to the source code of this file.
Data Structures | |
struct | dvb_elementary_pid |
associates an elementary stream type with its PID More... | |
struct | dvb_entry |
Represents one entry on a DTV file. More... | |
struct | dvb_file |
Describes an entire DVB file opened. More... | |
struct | dvb_parse_table |
Describes the fields to parse on a file. More... | |
struct | dvb_parse_struct |
Describes the format to parse an specific delivery system. More... | |
struct | dvb_parse_file |
Describes an entire file format. More... | |
Enumerations | |
enum | dvb_file_formats { FILE_UNKNOWN, FILE_ZAP, FILE_CHANNEL, FILE_DVBV5 } |
Known file formats. More... | |
Functions | |
static void | dvb_file_free (struct dvb_file *dvb_file) |
Deallocates memory associated with a struct dvb_file. More... | |
struct dvb_file * | dvb_read_file (const char *fname) |
Read a file at libdvbv5 format. More... | |
int | dvb_write_file (const char *fname, struct dvb_file *dvb_file) |
Write a file at libdvbv5 format. More... | |
struct dvb_file * | dvb_read_file_format (const char *fname, uint32_t delsys, enum dvb_file_formats format) |
Read a file on any format natively supported by the library. More... | |
int | dvb_write_file_format (const char *fname, struct dvb_file *dvb_file, uint32_t delsys, enum dvb_file_formats format) |
int | dvb_store_entry_prop (struct dvb_entry *entry, uint32_t cmd, uint32_t value) |
Stores a key/value pair on a DVB file entry. More... | |
int | dvb_retrieve_entry_prop (struct dvb_entry *entry, uint32_t cmd, uint32_t *value) |
Retrieves the value associated witha key on a DVB file entry. More... | |
int | dvb_store_channel (struct dvb_file **dvb_file, struct dvb_v5_fe_parms *parms, struct dvb_v5_descriptors *dvb_desc, int get_detected, int get_nit) |
stored a new scanned channel into a dvb_file struct More... | |
int | dvb_parse_delsys (const char *name) |
Ancillary function that seeks for a delivery system. More... | |
enum dvb_file_formats | dvb_parse_format (const char *name) |
Ancillary function that parses the name of a file format. More... | |
Variables | |
const struct dvb_parse_file | channel_file_format |
File format definitions for dvb-apps channel format. More... | |
const struct dvb_parse_file | channel_file_zap_format |
File format definitions for dvb-apps zap format. More... | |
Provides interfaces to deal with DVB channel and program files.
There are basically two types of files used for DVB:
The libdvbv5 library defines an unified type for both types. Other applications generally use different formats.
The purpose of the functions and structures defined herein is to provide support to read and write to those different formats.
Please submit bug report and patches to linux -med ia@vg er.k ernel .org
Definition in file dvb-file.h.
enum dvb_file_formats |
Known file formats.
FILE_UNKNOWN | File format is unknown |
FILE_ZAP | File is at the dvb-apps "dvbzap" format |
FILE_CHANNEL | File is at the dvb-apps output format for dvb-zap |
FILE_DVBV5 | File is at libdvbv5 format |
Please notice that the channel format defined here has a few optional fields that aren't part of the dvb-apps format, for DVB-S2 and for DVB-T2. They're there to match the formats found at dtv-scan-tables package up to September, 5 2014.
Enumerator | |
---|---|
FILE_UNKNOWN | |
FILE_ZAP | |
FILE_CHANNEL | |
FILE_DVBV5 |
Definition at line 201 of file dvb-file.h.
|
inlinestatic |
Deallocates memory associated with a struct dvb_file.
This function assumes that several functions were dynamically allocated by the library file functions.
Definition at line 223 of file dvb-file.h.
References dvb_entry::audio_pid, dvb_entry::channel, dvb_file::first_entry, dvb_entry::lnb, dvb_entry::location, dvb_entry::next, dvb_entry::other_el_pid, dvb_entry::vchannel, and dvb_entry::video_pid.
int dvb_parse_delsys | ( | const char * | name | ) |
Ancillary function that seeks for a delivery system.
name | string containing the name of the Delivery System to seek |
If the name is found, this function returns the DVBv5 property that corresponds to the string given. The function is case-insensitive, and it can check for alternate ways to write the name of a Delivery System. Currently, it supports: DVB-C, DVB-H, DVB-S, DVB-S2, DVB-T, DVB-T2, ISDB-C, ISDB-S, ISDB-T, ATSC-MH, DVBC/ANNEX_A, DVBC/ANNEX_B, DVBT, DSS, DVBS, DVBS2, DVBH, ISDBT, ISDBS, ISDBC, ATSC, ATSCMH, DTMB, CMMB, DAB, DVBT2, TURBO, DVBC/ANNEX_C. Please notice that this doesn't mean that all those standards are properly supported by the library.
enum dvb_file_formats dvb_parse_format | ( | const char * | name | ) |
Ancillary function that parses the name of a file format.
name | string containing the name of the format Current valid names are: ZAP, CHANNEL and DVBV5. The name is case-insensitive. |
It returns FILE_ZAP, FILE_CHANNEL, FILE_DVBV5 if the name was translated, or FILE_UNKNOWN otherwise.
struct dvb_file * dvb_read_file | ( | const char * | fname | ) |
Read a file at libdvbv5 format.
fname | file name |
struct dvb_file * dvb_read_file_format | ( | const char * | fname, |
uint32_t | delsys, | ||
enum dvb_file_formats | format | ||
) |
Read a file on any format natively supported by the library.
fname | file name |
delsys | Delivery system, as specified by enum fe_delivery_system |
format | Name of the format to be read |
int dvb_retrieve_entry_prop | ( | struct dvb_entry * | entry, |
uint32_t | cmd, | ||
uint32_t * | value | ||
) |
Retrieves the value associated witha key on a DVB file entry.
entry | entry to be used |
cmd | key for the property to be found. It be one of the DVBv5 properties, plus the libdvbv5 ones, as defined at dvb-v5-std.h |
value | pointer to store the value associated with the property. |
This function seeks for a property with the name specified by cmd and fills value with its contents.
int dvb_store_channel | ( | struct dvb_file ** | dvb_file, |
struct dvb_v5_fe_parms * | parms, | ||
struct dvb_v5_descriptors * | dvb_desc, | ||
int | get_detected, | ||
int | get_nit | ||
) |
stored a new scanned channel into a dvb_file struct
dvb_file | file struct to be filled |
parms | struct dvb_v5_fe_parms used by libdvbv5 frontend |
dvb_desc | struct dvb_desc as described at descriptors.h, filled with the descriptors associated with a DVB channel. those descriptors can be filled by calling one of the scan functions defined at dvb-sat.h. |
get_detected | if different than zero, uses the frontend parameters obtained from the device driver (such as modulation, FEC, etc) |
get_nit | if true, uses the parameters obtained from the MPEG-TS NIT table to add newly detected transponders. |
This function should be used to store the services found on a scanned transponder. Initially, it copies the same parameters used to set the frontend, that came from a file where the Service ID and Elementary Stream PIDs are unknown. At tuning time, it is common to set the device to tune on auto-detection mode (e. g. using QAM/AUTO, for example, to autodetect the QAM modulation). The libdvbv5's logic will be to check the detected values. So, the modulation might, for example, have changed to QAM/256. In such case, if get_detected is 0, it will store QAM/AUTO at the struct. If get_detected is different than zero, it will store QAM/256. If get_nit is different than zero, and if the MPEG-TS has info about other physical channels/transponders, this function will add newer entries to dvb_file, for it to seek for new transponders. This is very useful especially for DVB-C, where all transponders belong to the same operator. Knowing one frequency is generally enough to get all DVB-C transponders.
int dvb_store_entry_prop | ( | struct dvb_entry * | entry, |
uint32_t | cmd, | ||
uint32_t | value | ||
) |
Stores a key/value pair on a DVB file entry.
entry | entry to be filled |
cmd | key for the property to be used. It be one of the DVBv5 properties, plus the libdvbv5 ones, as defined at dvb-v5-std.h |
value | value for the property. |
This function seeks for a property with the name specified by cmd and fills it with value. If the entry doesn't exist, it creates a new key.
int dvb_write_file | ( | const char * | fname, |
struct dvb_file * | dvb_file | ||
) |
Write a file at libdvbv5 format.
fname | file name |
dvb_file | contents of the file to be written |
int dvb_write_file_format | ( | const char * | fname, |
struct dvb_file * | dvb_file, | ||
uint32_t | delsys, | ||
enum dvb_file_formats | format | ||
) |
const struct dvb_parse_file channel_file_format |
File format definitions for dvb-apps channel format.
const struct dvb_parse_file channel_file_zap_format |
File format definitions for dvb-apps zap format.