libdvbv5  1.16.1
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 
108 };
109 
119 typedef int (*dvb_dev_change_t)(char *sysname,
120  enum dvb_dev_change_type type, void *priv);
121 
127 struct dvb_open_descriptor;
128 
138 struct dvb_device {
139  /* Digital TV device lists */
142 
143  /* Digital TV frontend access */
145 };
146 
157 struct dvb_device *dvb_dev_alloc(void);
158 
165 void dvb_dev_free(struct dvb_device *dvb);
166 
191 int dvb_dev_find(struct dvb_device *dvb, dvb_dev_change_t handler,
192  void *user_priv);
193 
208  unsigned int adapter,
209  unsigned int num,
210  enum dvb_dev_type type);
211 
222 struct dvb_dev_list *dvb_get_dev_info(struct dvb_device *dvb,
223  const char *sysname);
224 
235 void dvb_dev_stop_monitor(struct dvb_device *dvb);
236 
254 void dvb_dev_set_logpriv(struct dvb_device *dvb,
255  unsigned verbose,
256  dvb_logfunc_priv logfunc, void *logpriv);
257 
274 void dvb_dev_set_log(struct dvb_device *dvb,
275  unsigned verbose,
276  dvb_logfunc logfunc);
277 
301 struct dvb_open_descriptor *dvb_dev_open(struct dvb_device *dvb,
302  const char *sysname, int flags);
303 
311 void dvb_dev_close(struct dvb_open_descriptor *open_dev);
312 
323 int dvb_dev_get_fd(struct dvb_open_descriptor *open_dev);
324 
337 ssize_t dvb_dev_read(struct dvb_open_descriptor *open_dev,
338  void *buf, size_t count);
339 
353 void dvb_dev_dmx_stop(struct dvb_open_descriptor *open_dev);
354 
371 int dvb_dev_set_bufsize(struct dvb_open_descriptor *open_dev,
372  int buffersize);
373 
398  int pid, dmx_pes_type_t type,
399  dmx_output_t output, int buffersize);
400 
424  int pid, unsigned filtsize,
425  unsigned char *filter,
426  unsigned char *mask,
427  unsigned char *mode,
428  unsigned int flags);
429 
445 int dvb_dev_dmx_get_pmt_pid(struct dvb_open_descriptor *open_dev, int sid);
446 
468 struct dvb_v5_descriptors *dvb_dev_scan(struct dvb_open_descriptor *open_dev,
469  struct dvb_entry *entry,
470  check_frontend_t *check_frontend,
471  void *args,
472  unsigned other_nit,
473  unsigned timeout_multiply);
474 
475 /* From dvb-dev-remote.c */
476 
477 #ifdef HAVE_DVBV5_REMOTE
478 
479 #define REMOTE_BUF_SIZE (87 * 188) /* 16356 bytes */
480 
481 
495 int dvb_dev_remote_init(struct dvb_device *d, char *server, int port);
496 
497 #else
498 
499 static inline int dvb_dev_remote_init(struct dvb_device *d, char *server,
500  int port)
501 {
502  return -1;
503 };
504 
505 #endif
506 
507 
508 #endif
struct dvb_entry * entry
Definition: dvb-scan.h:90
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:119
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&#39;s parameters.
int dvb_dev_get_fd(struct dvb_open_descriptor *open_dev)
returns fd from a local device This will not work for remote devices.
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
void(* dvb_logfunc)(int level, const char *fmt,...)
typedef used by dvb_fe_open2 for the log function
Definition: dvb-log.h:44
void(* dvb_logfunc_priv)(void *logpriv, int level, const char *fmt,...)
Definition: dvb-log.h:52
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_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.
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:141
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_dev_list * dvb_get_dev_info(struct dvb_device *dvb, const char *sysname)
Return data about a device from its sysname.
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.
int dvb_dev_find(struct dvb_device *dvb, dvb_dev_change_t handler, void *user_priv)
finds all DVB devices on the local machine
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
static int dvb_dev_remote_init(struct dvb_device *d, char *server, int port)
Definition: dvb-dev.h:499
Digital TV device node properties.
Definition: dvb-dev.h:84
dvb_dev_change_type
Describes the type of change to be notifier_delay.
Definition: dvb-dev.h:104
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_dev_list * devices
Definition: dvb-dev.h:140
char * bus_id
Definition: dvb-dev.h:90
struct dvb_v5_fe_parms * fe_parms
Definition: dvb-dev.h:144
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
struct dvb_open_descriptor * dvb_dev_open(struct dvb_device *dvb, const char *sysname, int flags)
Opens a dvb device.
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.
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:138