libdvbv5  1.12.3
Library to work with Digital TV devices on Linux
Data Structures | Macros | Typedefs | Enumerations | Functions
dvb-dev.h File Reference

Provides interfaces to handle Digital TV devices. More...

#include "dvb-fe.h"
#include "dvb-scan.h"
#include <config.h>
#include <linux/dvb/dmx.h>
Include dependency graph for dvb-dev.h:

Go to the source code of this file.

Data Structures

struct  dvb_dev_list
 Digital TV device node properties. More...
 
struct  dvb_device
 Digital TV list of devices. More...
 

Macros

#define REMOTE_BUF_SIZE
 

Typedefs

typedef int(* dvb_dev_change_t) (char *sysname, enum dvb_dev_change_type type)
 Describes a callback for dvb_dev_find() 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...
 
enum  dvb_dev_change_type { DVB_DEV_ADD, DVB_DEV_CHANGE, DVB_DEV_REMOVE }
 Describes the type of change to be notifier_delay. More...
 

Functions

struct dvb_devicedvb_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, dvb_dev_change_t handler)
 finds all DVB devices on the local machine More...
 
struct dvb_dev_listdvb_dev_seek_by_sysname (struct dvb_device *dvb, unsigned int adapter, unsigned int num, enum dvb_dev_type type)
 Find a device that matches the search criteria given by this functions's parameters. 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_descriptordvb_dev_open (struct dvb_device *dvb, const 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...
 
struct dvb_v5_descriptorsdvb_dev_scan (struct dvb_open_descriptor *open_dev, struct dvb_entry *entry, check_frontend_t *check_frontend, void *args, unsigned other_nit, unsigned timeout_multiply)
 Scans a DVB dvb_add_scaned_transponder. More...
 
int dvb_dev_remote_init (struct dvb_device *d, char *server, int port)
 initialize the dvb-dev to use a remote device running the dvbv5-daemon. More...
 

Detailed Description

Provides interfaces to handle Digital TV devices.

Author
Mauro Carvalho Chehab

Digital TV device node file names depend on udev configuration. For example, while frontends are typically found at/dev/dvb/adapter?/frontend?, the actual file name can vary from system to system, depending on the udev ruleset.

The libdvbv5 provides a set of functions to allow detecting and getting the device paths in a sane way, via libudev.

Bug Report
Please submit bug reports and patches to linux.nosp@m.-med.nosp@m.ia@vg.nosp@m.er.k.nosp@m.ernel.nosp@m..org

Definition in file dvb-dev.h.

Macro Definition Documentation

§ REMOTE_BUF_SIZE

#define REMOTE_BUF_SIZE

Definition at line 432 of file dvb-dev.h.

Typedef Documentation

§ dvb_dev_change_t

typedef int(* dvb_dev_change_t) (char *sysname, enum dvb_dev_change_type type)

Describes a callback for dvb_dev_find()

sysname: Kernel's system name for the device (dvb?.frontend?, for example) : type of change, as defined by enum dvb_dev_change_type

Note
: the returned string should be freed with free().

Definition at line 120 of file dvb-dev.h.

Enumeration Type Documentation

§ dvb_dev_change_type

Describes the type of change to be notifier_delay.

Parameters
DVB_DEV_ADDNew device detected
DVB_DEV_CHANGEDevice has changed something
DVB_DEV_REMOVEA hot-pluggable device was removed
Enumerator
DVB_DEV_ADD 
DVB_DEV_CHANGE 
DVB_DEV_REMOVE 

Definition at line 105 of file dvb-dev.h.

Function Documentation

§ dvb_dev_remote_init()

int dvb_dev_remote_init ( struct dvb_device d,
char *  server,
int  port 
)

initialize the dvb-dev to use a remote device running the dvbv5-daemon.

Parameters
dvbpointer to struct dvb_device to be used
serverserver hostname or address
portserver port
Note
The protocol between the dvbv5-daemon and the dvb_dev library is highly experimental and is subject to changes in a near future. So, while this is not stable enough, you will only work if both the client and the server are running the same version of the v4l-utils library.
Examples:
dvb-fe-tool.c, and dvbv5-zap.c.

§ dvb_dev_seek_by_sysname()

struct dvb_dev_list* dvb_dev_seek_by_sysname ( struct dvb_device dvb,
unsigned int  adapter,
unsigned int  num,
enum dvb_dev_type  type 
)

Find a device that matches the search criteria given by this functions's parameters.

Parameters
dvbpointer to struct dvb_device to be used
adapterAdapter number, as defined internally at the Kernel. Always start with 0;
numDigital TV device number (e. g. frontend0, net0, etc);
typeType of the device, as given by enum dvb_dev_type;
Returns
returns a pointer to a struct dvb_dev_list object or NULL if the desired device was not found.
Examples:
dvb-fe-tool.c, dvbv5-scan.c, and dvbv5-zap.c.