• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2011-2014 - 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 
20 #ifndef __DVB_DEV_PRIV_H
21 #define __DVB_DEV_PRIV_H
22 
23 #include <libdvbv5/dvb-dev.h>
24 
25 struct dvb_device_priv;
26 
27 struct dvb_open_descriptor {
28 	int fd;
29 	struct dvb_dev_list *dev;
30 	struct dvb_device_priv *dvb;
31 	struct dvb_open_descriptor *next;
32 };
33 
34 struct dvb_dev_ops {
35 	int (*find)(struct dvb_device_priv *dvb, dvb_dev_change_t handler,
36 		    void *user_priv);
37 	struct dvb_dev_list * (*seek_by_adapter)(struct dvb_device_priv *dvb,
38 						 unsigned int adapter,
39 						 unsigned int num,
40 						 enum dvb_dev_type type);
41 	struct dvb_dev_list * (*get_dev_info)(struct dvb_device_priv *dvb,
42 					      const char *sysname);
43 	int (*stop_monitor)(struct dvb_device_priv *dvb);
44 	struct dvb_open_descriptor *(*open)(struct dvb_device_priv *dvb,
45 					    const char *sysname, int flags);
46 	int (*close)(struct dvb_open_descriptor *open_dev);
47 	int (*dmx_stop)(struct dvb_open_descriptor *open_dev);
48 	int (*set_bufsize)(struct dvb_open_descriptor *open_dev,
49 			   int buffersize);
50 	ssize_t (*read)(struct dvb_open_descriptor *open_dev,
51 			void *buf, size_t count);
52 	int (*dmx_set_pesfilter)(struct dvb_open_descriptor *open_dev,
53 				 int pid, dmx_pes_type_t type,
54 				 dmx_output_t output, int bufsize);
55 	int (*dmx_set_section_filter)(struct dvb_open_descriptor *open_dev,
56 				     int pid, unsigned filtsize,
57 				     unsigned char *filter,
58 				     unsigned char *mask,
59 				     unsigned char *mode,
60 				     unsigned int flags);
61 	int (*dmx_get_pmt_pid)(struct dvb_open_descriptor *open_dev, int sid);
62 	struct dvb_v5_descriptors *(*scan)(struct dvb_open_descriptor *open_dev,
63 					   struct dvb_entry *entry,
64 					   check_frontend_t *check_frontend,
65 					   void *args,
66 					   unsigned other_nit,
67 					   unsigned timeout_multiply);
68 
69 	int (*fe_set_sys)(struct dvb_v5_fe_parms *p, fe_delivery_system_t sys);
70 	int (*fe_get_parms)(struct dvb_v5_fe_parms *p);
71 	int (*fe_set_parms)(struct dvb_v5_fe_parms *p);
72 	int (*fe_get_stats)(struct dvb_v5_fe_parms *p);
73 
74 	void (*free)(struct dvb_device_priv *dvb);
75 	int (*get_fd)(struct dvb_open_descriptor *dvb);
76 };
77 
78 struct dvb_device_priv {
79 	struct dvb_device d;
80 	struct dvb_dev_ops ops;
81 
82 	struct dvb_open_descriptor open_list;
83 
84 	/* private data to be used by implementation, if needed */
85 	void *priv;
86 };
87 
88 
89 /* From dvb-dev.c */
90 extern const char * const dev_type_names[];
91 extern const unsigned int dev_type_names_size;
92 void dvb_dev_dump_device(char *msg,
93 			struct dvb_v5_fe_parms_priv *parms,
94 			struct dvb_dev_list *dev);
95 void free_dvb_dev(struct dvb_dev_list *dvb_dev);
96 void dvb_dev_free_devices(struct dvb_device_priv *dvb);
97 
98 /* From dvb-dev-local.c */
99 void dvb_dev_local_init(struct dvb_device_priv *dvb);
100 
101 #endif
102