xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/common/mediactl/mediactl-priv.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Media controller interface library
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Copyright (C) 2010-2011 Ideas on board SPRL
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or modify
9*4882a593Smuzhiyun  * it under the terms of the GNU Lesser General Public License as published
10*4882a593Smuzhiyun  * by the Free Software Foundation; either version 2.1 of the License, or
11*4882a593Smuzhiyun  * (at your option) any later version.
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  * This program is distributed in the hope that it will be useful,
14*4882a593Smuzhiyun  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15*4882a593Smuzhiyun  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*4882a593Smuzhiyun  * GNU Lesser General Public License for more details.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  * You should have received a copy of the GNU Lesser General Public License
19*4882a593Smuzhiyun  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20*4882a593Smuzhiyun  */
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun #ifndef __MEDIA_PRIV_H__
23*4882a593Smuzhiyun #define __MEDIA_PRIV_H__
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun #include <linux/media.h>
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #include "mediactl.h"
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun struct media_entity {
30*4882a593Smuzhiyun     struct media_device *media;
31*4882a593Smuzhiyun     struct media_entity_desc info;
32*4882a593Smuzhiyun     struct media_pad *pads;
33*4882a593Smuzhiyun     struct media_link *links;
34*4882a593Smuzhiyun     unsigned int max_links;
35*4882a593Smuzhiyun     unsigned int num_links;
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun     char devname[32];
38*4882a593Smuzhiyun     int fd;
39*4882a593Smuzhiyun };
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun struct media_device {
42*4882a593Smuzhiyun     int fd;
43*4882a593Smuzhiyun     int refcount;
44*4882a593Smuzhiyun     char *devnode;
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun     struct media_device_info info;
47*4882a593Smuzhiyun     struct media_entity *entities;
48*4882a593Smuzhiyun     unsigned int entities_count;
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun     void (*debug_handler)(void *, ...);
51*4882a593Smuzhiyun     void *debug_priv;
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun     struct {
54*4882a593Smuzhiyun         struct media_entity *v4l;
55*4882a593Smuzhiyun         struct media_entity *fb;
56*4882a593Smuzhiyun         struct media_entity *alsa;
57*4882a593Smuzhiyun         struct media_entity *dvb;
58*4882a593Smuzhiyun     } def;
59*4882a593Smuzhiyun };
60*4882a593Smuzhiyun 
61*4882a593Smuzhiyun #define media_dbg(media, ...) \
62*4882a593Smuzhiyun     (media)->debug_handler((media)->debug_priv, __VA_ARGS__)
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun #endif /* __MEDIA_PRIV_H__ */
65