libdvbv5
1.11.0
Library to work with Digital TV devices on Linux
|
Files | |
file | dvb-dev.h |
Provides interfaces to handle Digital TV devices. | |
Data Structures | |
struct | dvb_dev_list |
Digital TV device node properties. More... | |
struct | dvb_device |
Digital TV list of devices. More... | |
Enumerations | |
enum | dvb_dev_type { DVB_DEVICE_FRONTEND, DVB_DEVICE_DEMUX, DVB_DEVICE_DVR, DVB_DEVICE_NET, DVB_DEVICE_CA, DVB_DEVICE_CA_SEC } |
Type of a device entry to search. More... | |
Functions | |
struct dvb_device * | dvb_dev_alloc (void) |
Allocate a struct dvb_device. More... | |
void | dvb_dev_free (struct dvb_device *dvb) |
free a struct dvb_device More... | |
int | dvb_dev_find (struct dvb_device *dvb, int enable_monitor) |
finds all DVB devices on the local machine More... | |
void | dvb_dev_stop_monitor (struct dvb_device *dvb) |
Stop the dvb_dev_find loop. More... | |
void | dvb_dev_set_log (struct dvb_device *dvb, unsigned verbose, dvb_logfunc logfunc) |
Sets the DVB verbosity and log function. More... | |
struct dvb_open_descriptor * | dvb_dev_open (struct dvb_device *dvb, char *sysname, int flags) |
Opens a dvb device. More... | |
void | dvb_dev_close (struct dvb_open_descriptor *open_dev) |
Closes a dvb device. More... | |
ssize_t | dvb_dev_read (struct dvb_open_descriptor *open_dev, void *buf, size_t count) |
read from a dvb demux or dvr file More... | |
void | dvb_dev_dmx_stop (struct dvb_open_descriptor *open_dev) |
Stops the demux filter for a given file descriptor. More... | |
int | dvb_dev_set_bufsize (struct dvb_open_descriptor *open_dev, int buffersize) |
Start a demux or dvr buffer size. More... | |
int | dvb_dev_dmx_set_pesfilter (struct dvb_open_descriptor *open_dev, int pid, dmx_pes_type_t type, dmx_output_t output, int buffersize) |
Start a filter for a MPEG-TS Packetized Elementary Stream (PES) More... | |
int | dvb_dev_dmx_set_section_filter (struct dvb_open_descriptor *open_dev, int pid, unsigned filtsize, unsigned char *filter, unsigned char *mask, unsigned char *mode, unsigned int flags) |
Sets a MPEG-TS section filter. More... | |
int | dvb_dev_dmx_get_pmt_pid (struct dvb_open_descriptor *open_dev, int sid) |
read the contents of the MPEG-TS PAT table, seeking for an specific service ID More... | |
enum dvb_dev_type |
Type of a device entry to search.
DVB_DEVICE_FRONTEND | Digital TV frontend |
DVB_DEVICE_DEMUX | Digital TV demux |
DVB_DEVICE_DVR | Digital TV Digital Video Record |
DVB_DEVICE_NET | Digital TV network interface control |
DVB_DEVICE_CA | Digital TV Conditional Access |
DVB_DEVICE_CA_SEC | Digital TV Conditional Access serial |
Enumerator | |
---|---|
DVB_DEVICE_FRONTEND | |
DVB_DEVICE_DEMUX | |
DVB_DEVICE_DVR | |
DVB_DEVICE_NET | |
DVB_DEVICE_CA | |
DVB_DEVICE_CA_SEC |
struct dvb_device* dvb_dev_alloc | ( | void | ) |
Allocate a struct dvb_device.
void dvb_dev_close | ( | struct dvb_open_descriptor * | open_dev | ) |
Closes a dvb device.
open_dev | Points to the struct dvb_open_descriptor to be closed. |
int dvb_dev_dmx_get_pmt_pid | ( | struct dvb_open_descriptor * | open_dev, |
int | sid | ||
) |
read the contents of the MPEG-TS PAT table, seeking for an specific service ID
open_dev | Points to the struct dvb_open_descriptor |
sid | Session ID to seeking |
int dvb_dev_dmx_set_pesfilter | ( | struct dvb_open_descriptor * | open_dev, |
int | pid, | ||
dmx_pes_type_t | type, | ||
dmx_output_t | output, | ||
int | buffersize | ||
) |
Start a filter for a MPEG-TS Packetized Elementary Stream (PES)
open_dev | Points to the struct dvb_open_descriptor |
pid | Program ID to filter. Use 0x2000 to select all PIDs |
type | type of the PID (DMX_PES_VIDEO, DMX_PES_AUDIO, DMX_PES_OTHER, etc). |
output | Where the data will be output (DMX_OUT_TS_TAP, DMX_OUT_DECODER, etc). |
buffersize | Size of the buffer to be allocated to store the filtered data. |
This is a wrapper function for DMX_SET_PES_FILTER and DMX_SET_BUFFER_SIZE ioctls.
See http://linuxtv.org/downloads/v4l-dvb-apis/dvb_demux.html for more details.
int dvb_dev_dmx_set_section_filter | ( | struct dvb_open_descriptor * | open_dev, |
int | pid, | ||
unsigned | filtsize, | ||
unsigned char * | filter, | ||
unsigned char * | mask, | ||
unsigned char * | mode, | ||
unsigned int | flags | ||
) |
Sets a MPEG-TS section filter.
open_dev | Points to the struct dvb_open_descriptor |
pid | Program ID to filter. Use 0x2000 to select all PIDs |
filtsize | Size of the filter (up to 18 btyes) |
filter | data to filter. Can be NULL or should have filtsize length |
mask | filter mask. Can be NULL or should have filtsize length |
mode | mode mask. Can be NULL or should have filtsize length |
flags | flags for set filter (DMX_CHECK_CRC,DMX_ONESHOT, DMX_IMMEDIATE_START). |
This is a wrapper function for DMX_SET_FILTER ioctl.
See http://linuxtv.org/downloads/v4l-dvb-apis/dvb_demux.html for more details.
void dvb_dev_dmx_stop | ( | struct dvb_open_descriptor * | open_dev | ) |
Stops the demux filter for a given file descriptor.
open_dev | Points to the struct dvb_open_descriptor |
This is a wrapper function for DMX_STOP ioctl.
See http://linuxtv.org/downloads/v4l-dvb-apis/dvb_demux.html for more details.
int dvb_dev_find | ( | struct dvb_device * | dvb, |
int | enable_monitor | ||
) |
finds all DVB devices on the local machine
dvb | pointer to struct dvb_device to be filled |
enable_monitor | if different than zero put the routine into monitor mode |
This routine can be called on two modes: normal or monitor mode
In normal mode, it will seek for the local Digital TV devices, store them at the struct dvb_device and return.
In monitor mode, it will not only enumerate all devices, but it will also keep waiting for device changes. The device seek loop will only be interrupted after calling dvb_dev_stop_monitor().
Please notice that, in such mode, the function will wait forever. So, it is up to the application to put start a separate thread to handle it in monitor mode, and add the needed mutexes to make it thread safe.
void dvb_dev_free | ( | struct dvb_device * | dvb | ) |
free a struct dvb_device
dvb | pointer to struct dvb_device to be freed |
struct dvb_open_descriptor* dvb_dev_open | ( | struct dvb_device * | dvb, |
char * | sysname, | ||
int | flags | ||
) |
Opens a dvb device.
dvb | pointer to struct dvb_device to be used |
sysname | Kernel's name of the device to be opened, as obtained via dvb_dev_seek_by_sysname(). |
flags | Flags to be passed to open: O_RDONLY, O_RDWR and/or O_NONBLOCK |
This function is equivalent to open(2) system call: it opens a Digital TV given by the dev parameter, using the flags.
ssize_t dvb_dev_read | ( | struct dvb_open_descriptor * | open_dev, |
void * | buf, | ||
size_t | count | ||
) |
read from a dvb demux or dvr file
open_dev | Points to the struct dvb_open_descriptor to be closed. |
buf | Buffer to store the data |
count | number of bytes to read |
int dvb_dev_set_bufsize | ( | struct dvb_open_descriptor * | open_dev, |
int | buffersize | ||
) |
Start a demux or dvr buffer size.
open_dev | Points to the struct dvb_open_descriptor |
buffersize | Size of the buffer to be allocated to store the filtered data. |
This is a wrapper function for DMX_SET_BUFFER_SIZE ioctl.
See http://linuxtv.org/downloads/v4l-dvb-apis/dvb_demux.html for more details.
void dvb_dev_set_log | ( | struct dvb_device * | dvb, |
unsigned | verbose, | ||
dvb_logfunc | logfunc | ||
) |
Sets the DVB verbosity and log function.
dvb | pointer to struct dvb_device to be used |
verbose | Verbosity level of the messages that will be printed |
logfunc | Callback function to be called when a log event happens. Can either store the event into a file or to print it at the TUI/GUI. Can be null. |
Sets the function to report log errors and to set the verbosity level of debug report messages. If not called, or if logfunc is NULL, the libdvbv5 will report error and debug messages via stderr, and will use colors for the debug messages.
void dvb_dev_stop_monitor | ( | struct dvb_device * | dvb | ) |
Stop the dvb_dev_find loop.
dvb | pointer to struct dvb_device to be used |
This function stops dvb_dev_find() if it is running in monitor mode. It does nothing on other modes. Can be called even if the monitor mode was already stopped.