Debian Codegraph @

utils/media-ctl/mediactl-priv.h

raw
1 /*
2 * Media controller interface library
3 *
4 * Copyright (C) 2010-2014 Ideas on board SPRL
5 *
6 * Contact: Laurent Pinchart <[email protected]>
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 bool supports_streams;
37
38 char devname[32];
39 int fd;
40 };
41
42 struct media_device {
43 int fd;
44 int refcount;
45 char *devnode;
46
47 struct media_device_info info;
48 struct media_entity *entities;
49 unsigned int entities_count;
50
51 void (*debug_handler)(void *, ...);
52 void *debug_priv;
53
54 struct {
55 struct media_entity *v4l;
56 struct media_entity *fb;
57 struct media_entity *alsa;
58 struct media_entity *dvb;
59 } def;
60 };
61
62 #define media_dbg(media, ...) \
63 (media)->debug_handler((media)->debug_priv, __VA_ARGS__)
64
65 #endif /* __MEDIA_PRIV_H__ */