libdvbv5  1.11.0
Library to work with Digital TV devices on Linux
dvb-dev.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 - Mauro Carvalho Chehab
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation version 2.1 of the License.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
17  */
18 
19 #ifndef _DVB_DEV_H
20 #define _DVB_DEV_H
21 
22 #include "dvb-fe.h"
23 #include "dvb-scan.h"
24 
25 #include <linux/dvb/dmx.h>
26 
65 };
66 
84 struct dvb_dev_list {
85  char *syspath;
86  char *path;
87  char *sysname;
89  char *bus_addr;
90  char *bus_id;
91  char *manufacturer;
92  char *product;
93  char *serial;
94 };
95 
101 struct dvb_open_descriptor;
102 
112 struct dvb_device {
113  /* Digital TV device lists */
116 
117  /* Digital TV frontend access */
119 };
120 
131 struct dvb_device *dvb_dev_alloc(void);
132 
139 void dvb_dev_free(struct dvb_device *dvb);
140 
164 int dvb_dev_find(struct dvb_device *dvb, int enable_monitor);
165 
180  unsigned int adapter,
181  unsigned int num,
182  enum dvb_dev_type type);
183 
194 void dvb_dev_stop_monitor(struct dvb_device *dvb);
195 
212 void dvb_dev_set_log(struct dvb_device *dvb,
213  unsigned verbose,
214  dvb_logfunc logfunc);
215 
239 struct dvb_open_descriptor *dvb_dev_open(struct dvb_device *dvb,
240  char *sysname, int flags);
241 
249 void dvb_dev_close(struct dvb_open_descriptor *open_dev);
250 
263 ssize_t dvb_dev_read(struct dvb_open_descriptor *open_dev,
264  void *buf, size_t count);
265 
279 void dvb_dev_dmx_stop(struct dvb_open_descriptor *open_dev);
280 
297 int dvb_dev_set_bufsize(struct dvb_open_descriptor *open_dev,
298  int buffersize);
299 
324  int pid, dmx_pes_type_t type,
325  dmx_output_t output, int buffersize);
326 
350  int pid, unsigned filtsize,
351  unsigned char *filter,
352  unsigned char *mask,
353  unsigned char *mode,
354  unsigned int flags);
355 
371 int dvb_dev_dmx_get_pmt_pid(struct dvb_open_descriptor *open_dev, int sid);
372 
394 struct dvb_v5_descriptors *dvb_dev_scan(struct dvb_open_descriptor *open_dev,
395  struct dvb_entry *entry,
396  check_frontend_t *check_frontend,
397  void *args,
398  unsigned other_nit,
399  unsigned timeout_multiply);
400 
401 #endif
struct dvb_entry * entry
Definition: dvb-scan.h:90
void dvb_dev_stop_monitor(struct dvb_device *dvb)
Stop the dvb_dev_find loop.
char * manufacturer
Definition: dvb-dev.h:91
ssize_t dvb_dev_read(struct dvb_open_descriptor *open_dev, void *buf, size_t count)
read from a dvb demux or dvr file
int dvb_dev_find(struct dvb_device *dvb, int enable_monitor)
finds all DVB devices on the local machine
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_type
Type of a device entry to search.
Definition: dvb-dev.h:58
void(* dvb_logfunc)(int level, const char *fmt,...)
typedef used by dvb_fe_open2 for the log function
Definition: dvb-log.h:44
char * path
Definition: dvb-dev.h:86
char * product
Definition: dvb-dev.h:92
void dvb_dev_close(struct dvb_open_descriptor *open_dev)
Closes a dvb device.
int num_devices
Definition: dvb-dev.h:115
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.
char * serial
Definition: dvb-dev.h:93
struct dvb_device * dvb_dev_alloc(void)
Allocate a struct dvb_device.
void dvb_dev_dmx_stop(struct dvb_open_descriptor *open_dev)
Stops the demux filter for a given file descriptor.
void dvb_dev_set_log(struct dvb_device *dvb, unsigned verbose, dvb_logfunc logfunc)
Sets the DVB verbosity and log function.
Keeps data needed to handle the DVB frontend.
Definition: dvb-fe.h:117
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.
Provides interfaces to scan programs inside MPEG-TS digital TV streams.
void dvb_dev_free(struct dvb_device *dvb)
free a struct dvb_device
Digital TV device node properties.
Definition: dvb-dev.h:84
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.
struct dvb_dev_list * devices
Definition: dvb-dev.h:114
char * bus_id
Definition: dvb-dev.h:90
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
struct dvb_v5_fe_parms * fe_parms
Definition: dvb-dev.h:118
char * syspath
Definition: dvb-dev.h:85
Opaque struct with a DVB open file descriptor.
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
Represents one entry on a DTV file.
Definition: dvb-file.h:104
Contains the descriptors needed to scan the Service ID and other relevant info at a MPEG-TS Digital T...
Definition: dvb-scan.h:87
char * bus_addr
Definition: dvb-dev.h:89
Provides interfaces to deal with DVB frontend.
struct dvb_open_descriptor * dvb_dev_open(struct dvb_device *dvb, char *sysname, int flags)
Opens a dvb device.
char * sysname
Definition: dvb-dev.h:87
enum dvb_dev_type dvb_type
Definition: dvb-dev.h:88
int dvb_dev_set_bufsize(struct dvb_open_descriptor *open_dev, int buffersize)
Start a demux or dvr buffer size.
Digital TV list of devices.
Definition: dvb-dev.h:112