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