Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


media.h
001: /*
002:  * Multimedia device API
003:  *
004:  * Copyright (C) 2010 Nokia Corporation
005:  *
006:  * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
007:  *           Sakari Ailus <sakari.ailus@iki.fi>
008:  *
009:  * This program is free software; you can redistribute it and/or modify
010:  * it under the terms of the GNU General Public License version 2 as
011:  * published by the Free Software Foundation.
012:  *
013:  * This program is distributed in the hope that it will be useful,
014:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016:  * GNU General Public License for more details.
017:  *
018:  * You should have received a copy of the GNU General Public License
019:  * along with this program; if not, write to the Free Software
020:  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
021:  */
022: 
023: #ifndef __LINUX_MEDIA_H
024: #define __LINUX_MEDIA_H
025: 
026: #include <linux/ioctl.h>
027: #include <linux/types.h>
028: #include <linux/version.h>
029: 
030: #define MEDIA_API_VERSION       KERNEL_VERSION(0, 1, 0)
031: 
032: struct media_device_info {
033:         char driver[16];
034:         char model[32];
035:         char serial[40];
036:         char bus_info[32];
037:         __u32 media_version;
038:         __u32 hw_revision;
039:         __u32 driver_version;
040:         __u32 reserved[31];
041: };
042: 
043: #define MEDIA_ENT_ID_FLAG_NEXT          (1 << 31)
044: 
045: #define MEDIA_ENT_TYPE_SHIFT            16
046: #define MEDIA_ENT_TYPE_MASK             0x00ff0000
047: #define MEDIA_ENT_SUBTYPE_MASK          0x0000ffff
048: 
049: #define MEDIA_ENT_T_DEVNODE             (1 << MEDIA_ENT_TYPE_SHIFT)
050: #define MEDIA_ENT_T_DEVNODE_V4L         (MEDIA_ENT_T_DEVNODE + 1)
051: #define MEDIA_ENT_T_DEVNODE_FB          (MEDIA_ENT_T_DEVNODE + 2)
052: #define MEDIA_ENT_T_DEVNODE_ALSA        (MEDIA_ENT_T_DEVNODE + 3)
053: #define MEDIA_ENT_T_DEVNODE_DVB         (MEDIA_ENT_T_DEVNODE + 4)
054: 
055: #define MEDIA_ENT_T_V4L2_SUBDEV         (2 << MEDIA_ENT_TYPE_SHIFT)
056: #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR  (MEDIA_ENT_T_V4L2_SUBDEV + 1)
057: #define MEDIA_ENT_T_V4L2_SUBDEV_FLASH   (MEDIA_ENT_T_V4L2_SUBDEV + 2)
058: #define MEDIA_ENT_T_V4L2_SUBDEV_LENS    (MEDIA_ENT_T_V4L2_SUBDEV + 3)
059: 
060: #define MEDIA_ENT_FL_DEFAULT            (1 << 0)
061: 
062: struct media_entity_desc {
063:         __u32 id;
064:         char name[32];
065:         __u32 type;
066:         __u32 revision;
067:         __u32 flags;
068:         __u32 group_id;
069:         __u16 pads;
070:         __u16 links;
071: 
072:         __u32 reserved[4];
073: 
074:         union {
075:                 /* Node specifications */
076:                 struct {
077:                         __u32 major;
078:                         __u32 minor;
079:                 } v4l;
080:                 struct {
081:                         __u32 major;
082:                         __u32 minor;
083:                 } fb;
084:                 struct {
085:                         __u32 card;
086:                         __u32 device;
087:                         __u32 subdevice;
088:                 } alsa;
089:                 int dvb;
090: 
091:                 /* Sub-device specifications */
092:                 /* Nothing needed yet */
093:                 __u8 raw[184];
094:         };
095: };
096: 
097: #define MEDIA_PAD_FL_SINK               (1 << 0)
098: #define MEDIA_PAD_FL_SOURCE             (1 << 1)
099: 
100: struct media_pad_desc {
101:         __u32 entity;           /* entity ID */
102:         __u16 index;            /* pad index */
103:         __u32 flags;            /* pad flags */
104:         __u32 reserved[2];
105: };
106: 
107: #define MEDIA_LNK_FL_ENABLED            (1 << 0)
108: #define MEDIA_LNK_FL_IMMUTABLE          (1 << 1)
109: #define MEDIA_LNK_FL_DYNAMIC            (1 << 2)
110: 
111: struct media_link_desc {
112:         struct media_pad_desc source;
113:         struct media_pad_desc sink;
114:         __u32 flags;
115:         __u32 reserved[2];
116: };
117: 
118: struct media_links_enum {
119:         __u32 entity;
120:         /* Should have enough room for pads elements */
121:         struct media_pad_desc *pads;
122:         /* Should have enough room for links elements */
123:         struct media_link_desc *links;
124:         __u32 reserved[4];
125: };
126: 
127: #define MEDIA_IOC_DEVICE_INFO           _IOWR('|', 0x00, struct media_device_info)
128: #define MEDIA_IOC_ENUM_ENTITIES         _IOWR('|', 0x01, struct media_entity_desc)
129: #define MEDIA_IOC_ENUM_LINKS            _IOWR('|', 0x02, struct media_links_enum)
130: #define MEDIA_IOC_SETUP_LINK            _IOWR('|', 0x03, struct media_link_desc)
131: 
132: #endif /* __LINUX_MEDIA_H */
133: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/