dvb-dev.h
Go to the documentation of this file.
/*
* Copyright (c) 2016 - Mauro Carvalho Chehab
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation version 2.1 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
#ifndef _DVB_DEV_H
#define _DVB_DEV_H
#include "dvb-fe.h"
#include "dvb-scan.h"
#include <linux/dvb/dmx.h>
enum dvb_dev_type {
DVB_DEVICE_FRONTEND,
DVB_DEVICE_DEMUX,
DVB_DEVICE_DVR,
DVB_DEVICE_NET,
DVB_DEVICE_CA,
DVB_DEVICE_CA_SEC,
DVB_DEVICE_VIDEO,
DVB_DEVICE_AUDIO,
};
struct dvb_dev_list {
char *syspath;
char *path;
char *sysname;
enum dvb_dev_type dvb_type;
char *bus_addr;
char *bus_id;
char *manufacturer;
char *product;
char *serial;
};
enum dvb_dev_change_type {
DVB_DEV_ADD,
DVB_DEV_CHANGE,
DVB_DEV_REMOVE,
};
typedef int (*dvb_dev_change_t)(char *sysname,
enum dvb_dev_change_type type, void *priv);
struct dvb_open_descriptor;
struct dvb_device {
/* Digital TV device lists */
struct dvb_dev_list *devices;
int num_devices;
/* Digital TV frontend access */
struct dvb_v5_fe_parms *fe_parms;
};
struct dvb_device *dvb_dev_alloc(void);
void dvb_dev_free(struct dvb_device *dvb);
int dvb_dev_find(struct dvb_device *dvb, dvb_dev_change_t handler,
void *user_priv);
struct dvb_dev_list *dvb_dev_seek_by_adapter(struct dvb_device *dvb,
unsigned int adapter,
unsigned int num,
enum dvb_dev_type type);
struct dvb_dev_list *dvb_get_dev_info(struct dvb_device *dvb,
const char *sysname);
void dvb_dev_stop_monitor(struct dvb_device *dvb);
void dvb_dev_set_logpriv(struct dvb_device *dvb,
unsigned verbose,
dvb_logfunc_priv logfunc, void *logpriv);
void dvb_dev_set_log(struct dvb_device *dvb,
unsigned verbose,
dvb_logfunc logfunc);
struct dvb_open_descriptor *dvb_dev_open(struct dvb_device *dvb,
const char *sysname, int flags);
void dvb_dev_close(struct dvb_open_descriptor *open_dev);
int dvb_dev_get_fd(struct dvb_open_descriptor *open_dev);
ssize_t dvb_dev_read(struct dvb_open_descriptor *open_dev,
void *buf, size_t count);
void dvb_dev_dmx_stop(struct dvb_open_descriptor *open_dev);
int dvb_dev_set_bufsize(struct dvb_open_descriptor *open_dev,
int buffersize);
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);
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);
int dvb_dev_dmx_get_pmt_pid(struct dvb_open_descriptor *open_dev, int sid);
struct dvb_v5_descriptors *dvb_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);
/* From dvb-dev-remote.c */
#ifdef HAVE_DVBV5_REMOTE
#define REMOTE_BUF_SIZE (87 * 188) /* 16356 bytes */
int dvb_dev_remote_init(struct dvb_device *d, char *server, int port);
#else
static inline int dvb_dev_remote_init(struct dvb_device *d, char *server,
int port)
{
return -1;
};
#endif
#endif
dvb_dev_remote_init
static int dvb_dev_remote_init(struct dvb_device *d, char *server, int port)
Definition dvb-dev.h:498
dvb_get_dev_info
struct dvb_dev_list * dvb_get_dev_info(struct dvb_device *dvb, const char *sysname)
Return data about a device from its sysname.
dvb_dev_change_type
dvb_dev_change_type
Describes the type of change to be notifier_delay.
Definition dvb-dev.h:106
DVB_DEV_REMOVE
@ DVB_DEV_REMOVE
Definition dvb-dev.h:109
DVB_DEV_ADD
@ DVB_DEV_ADD
Definition dvb-dev.h:107
DVB_DEV_CHANGE
@ DVB_DEV_CHANGE
Definition dvb-dev.h:108
dvb_dev_seek_by_adapter
struct dvb_dev_list * dvb_dev_seek_by_adapter(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.
dvb_dev_change_t
int(* dvb_dev_change_t)(char *sysname, enum dvb_dev_change_type type, void *priv)
Describes a callback for dvb_dev_find()
Definition dvb-dev.h:121
dvb_dev_type
dvb_dev_type
Definition dvb-dev.h:58
DVB_DEVICE_AUDIO
@ DVB_DEVICE_AUDIO
Definition dvb-dev.h:66
DVB_DEVICE_NET
@ DVB_DEVICE_NET
Definition dvb-dev.h:62
DVB_DEVICE_CA_SEC
@ DVB_DEVICE_CA_SEC
Definition dvb-dev.h:64
DVB_DEVICE_DEMUX
@ DVB_DEVICE_DEMUX
Definition dvb-dev.h:60
DVB_DEVICE_FRONTEND
@ DVB_DEVICE_FRONTEND
Definition dvb-dev.h:59
DVB_DEVICE_DVR
@ DVB_DEVICE_DVR
Definition dvb-dev.h:61
DVB_DEVICE_CA
@ DVB_DEVICE_CA
Definition dvb-dev.h:63
DVB_DEVICE_VIDEO
@ DVB_DEVICE_VIDEO
Definition dvb-dev.h:65
dvb-fe.h
Provides interfaces to deal with DVB frontend.
dvb_logfunc_priv
void(* dvb_logfunc_priv)(void *logpriv, int level, const char *fmt,...)
Definition dvb-log.h:52
dvb_logfunc
void(* dvb_logfunc)(int level, const char *fmt,...)
Definition dvb-log.h:44
dvb-scan.h
Provides interfaces to scan programs inside MPEG-TS digital TV streams.
dvb_dev_free
void dvb_dev_free(struct dvb_device *dvb)
free a struct dvb_device
dvb_dev_open
struct dvb_open_descriptor * dvb_dev_open(struct dvb_device *dvb, const char *sysname, int flags)
Opens a dvb device.
dvb_dev_stop_monitor
void dvb_dev_stop_monitor(struct dvb_device *dvb)
Stop the dvb_dev_find loop.
dvb_dev_dmx_get_pmt_pid
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
dvb_dev_dmx_set_pesfilter
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)
dvb_dev_dmx_stop
void dvb_dev_dmx_stop(struct dvb_open_descriptor *open_dev)
Stops the demux filter for a given file descriptor.
dvb_dev_dmx_set_section_filter
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.
dvb_dev_find
int dvb_dev_find(struct dvb_device *dvb, dvb_dev_change_t handler, void *user_priv)
finds all DVB devices on the local machine
dvb_dev_set_bufsize
int dvb_dev_set_bufsize(struct dvb_open_descriptor *open_dev, int buffersize)
Start a demux or dvr buffer size.
dvb_dev_get_fd
int dvb_dev_get_fd(struct dvb_open_descriptor *open_dev)
returns fd from a local device This will not work for remote devices.
dvb_dev_set_log
void dvb_dev_set_log(struct dvb_device *dvb, unsigned verbose, dvb_logfunc logfunc)
Sets the DVB verbosity and log function.
dvb_dev_read
ssize_t dvb_dev_read(struct dvb_open_descriptor *open_dev, void *buf, size_t count)
read from a dvb demux or dvr file
dvb_dev_alloc
struct dvb_device * dvb_dev_alloc(void)
Allocate a struct dvb_device.
dvb_dev_close
void dvb_dev_close(struct dvb_open_descriptor *open_dev)
Closes a dvb device.
dvb_dev_set_logpriv
void dvb_dev_set_logpriv(struct dvb_device *dvb, unsigned verbose, dvb_logfunc_priv logfunc, void *logpriv)
Sets the DVB verbosity and log function with context private data.
dvb_dev_scan
struct dvb_v5_descriptors * dvb_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.
check_frontend_t
int() check_frontend_t(void *args, struct dvb_v5_fe_parms *parms)
Callback for the application to show the frontend status.
Definition dvb-scan.h:293
dvb_dev_list
Digital TV device node properties.
Definition dvb-dev.h:86
dvb_dev_list::bus_addr
char * bus_addr
Definition dvb-dev.h:91
dvb_dev_list::dvb_type
enum dvb_dev_type dvb_type
Definition dvb-dev.h:90
dvb_dev_list::syspath
char * syspath
Definition dvb-dev.h:87
dvb_dev_list::serial
char * serial
Definition dvb-dev.h:95
dvb_dev_list::bus_id
char * bus_id
Definition dvb-dev.h:92
dvb_dev_list::product
char * product
Definition dvb-dev.h:94
dvb_dev_list::sysname
char * sysname
Definition dvb-dev.h:89
dvb_dev_list::path
char * path
Definition dvb-dev.h:88
dvb_dev_list::manufacturer
char * manufacturer
Definition dvb-dev.h:93
dvb_device
Digital TV list of devices.
Definition dvb-dev.h:140
dvb_device::fe_parms
struct dvb_v5_fe_parms * fe_parms
Definition dvb-dev.h:146
dvb_device::num_devices
int num_devices
Definition dvb-dev.h:143
dvb_device::devices
struct dvb_dev_list * devices
Definition dvb-dev.h:142
dvb_entry
Represents one entry on a DTV file.
Definition dvb-file.h:104
dvb_open_descriptor
Opaque struct with a DVB open file descriptor.
dvb_v5_descriptors
Contains the descriptors needed to scan the Service ID and other relevant info at a MPEG-TS Digital T...
Definition dvb-scan.h:87
dvb_v5_descriptors::entry
struct dvb_entry * entry
Definition dvb-scan.h:90
dvb_v5_fe_parms
Keeps data needed to handle the DVB frontend.
Definition dvb-fe.h:117