1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef __LINUX_MEDIA_H 20 #define __LINUX_MEDIA_H 21 #include <stdint.h> 22 #include <linux/ioctl.h> 23 #include <linux/types.h> 24 struct media_device_info { 25 char driver[16]; 26 char model[32]; 27 char serial[40]; 28 char bus_info[32]; 29 __u32 media_version; 30 __u32 hw_revision; 31 __u32 driver_version; 32 __u32 reserved[31]; 33 }; 34 #define MEDIA_ENT_F_BASE 0x00000000 35 #define MEDIA_ENT_F_OLD_BASE 0x00010000 36 #define MEDIA_ENT_F_OLD_SUBDEV_BASE 0x00020000 37 #define MEDIA_ENT_F_UNKNOWN MEDIA_ENT_F_BASE 38 #define MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_F_OLD_SUBDEV_BASE 39 #define MEDIA_ENT_F_DTV_DEMOD (MEDIA_ENT_F_BASE + 0x00001) 40 #define MEDIA_ENT_F_TS_DEMUX (MEDIA_ENT_F_BASE + 0x00002) 41 #define MEDIA_ENT_F_DTV_CA (MEDIA_ENT_F_BASE + 0x00003) 42 #define MEDIA_ENT_F_DTV_NET_DECAP (MEDIA_ENT_F_BASE + 0x00004) 43 #define MEDIA_ENT_F_IO_V4L (MEDIA_ENT_F_OLD_BASE + 1) 44 #define MEDIA_ENT_F_IO_DTV (MEDIA_ENT_F_BASE + 0x01001) 45 #define MEDIA_ENT_F_IO_VBI (MEDIA_ENT_F_BASE + 0x01002) 46 #define MEDIA_ENT_F_IO_SWRADIO (MEDIA_ENT_F_BASE + 0x01003) 47 #define MEDIA_ENT_F_CAM_SENSOR (MEDIA_ENT_F_OLD_SUBDEV_BASE + 1) 48 #define MEDIA_ENT_F_FLASH (MEDIA_ENT_F_OLD_SUBDEV_BASE + 2) 49 #define MEDIA_ENT_F_LENS (MEDIA_ENT_F_OLD_SUBDEV_BASE + 3) 50 #define MEDIA_ENT_F_TUNER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 5) 51 #define MEDIA_ENT_F_IF_VID_DECODER (MEDIA_ENT_F_BASE + 0x02001) 52 #define MEDIA_ENT_F_IF_AUD_DECODER (MEDIA_ENT_F_BASE + 0x02002) 53 #define MEDIA_ENT_F_AUDIO_CAPTURE (MEDIA_ENT_F_BASE + 0x03001) 54 #define MEDIA_ENT_F_AUDIO_PLAYBACK (MEDIA_ENT_F_BASE + 0x03002) 55 #define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003) 56 #define MEDIA_ENT_F_PROC_VIDEO_COMPOSER (MEDIA_ENT_F_BASE + 0x4001) 57 #define MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER (MEDIA_ENT_F_BASE + 0x4002) 58 #define MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV (MEDIA_ENT_F_BASE + 0x4003) 59 #define MEDIA_ENT_F_PROC_VIDEO_LUT (MEDIA_ENT_F_BASE + 0x4004) 60 #define MEDIA_ENT_F_PROC_VIDEO_SCALER (MEDIA_ENT_F_BASE + 0x4005) 61 #define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006) 62 #define MEDIA_ENT_F_PROC_VIDEO_ENCODER (MEDIA_ENT_F_BASE + 0x4007) 63 #define MEDIA_ENT_F_PROC_VIDEO_DECODER (MEDIA_ENT_F_BASE + 0x4008) 64 #define MEDIA_ENT_F_PROC_VIDEO_ISP (MEDIA_ENT_F_BASE + 0x4009) 65 #define MEDIA_ENT_F_VID_MUX (MEDIA_ENT_F_BASE + 0x5001) 66 #define MEDIA_ENT_F_VID_IF_BRIDGE (MEDIA_ENT_F_BASE + 0x5002) 67 #define MEDIA_ENT_F_ATV_DECODER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 4) 68 #define MEDIA_ENT_F_DV_DECODER (MEDIA_ENT_F_BASE + 0x6001) 69 #define MEDIA_ENT_F_DV_ENCODER (MEDIA_ENT_F_BASE + 0x6002) 70 #define MEDIA_ENT_FL_DEFAULT (1 << 0) 71 #define MEDIA_ENT_FL_CONNECTOR (1 << 1) 72 #define MEDIA_ENT_ID_FLAG_NEXT (1U << 31) 73 struct media_entity_desc { 74 __u32 id; 75 char name[32]; 76 __u32 type; 77 __u32 revision; 78 __u32 flags; 79 __u32 group_id; 80 __u16 pads; 81 __u16 links; 82 __u32 reserved[4]; 83 union { 84 struct { 85 __u32 major; 86 __u32 minor; 87 } dev; 88 struct { 89 __u32 card; 90 __u32 device; 91 __u32 subdevice; 92 } alsa; 93 struct { 94 __u32 major; 95 __u32 minor; 96 } v4l; 97 struct { 98 __u32 major; 99 __u32 minor; 100 } fb; 101 int dvb; 102 __u8 raw[184]; 103 }; 104 }; 105 #define MEDIA_PAD_FL_SINK (1 << 0) 106 #define MEDIA_PAD_FL_SOURCE (1 << 1) 107 #define MEDIA_PAD_FL_MUST_CONNECT (1 << 2) 108 struct media_pad_desc { 109 __u32 entity; 110 __u16 index; 111 __u32 flags; 112 __u32 reserved[2]; 113 }; 114 #define MEDIA_LNK_FL_ENABLED (1 << 0) 115 #define MEDIA_LNK_FL_IMMUTABLE (1 << 1) 116 #define MEDIA_LNK_FL_DYNAMIC (1 << 2) 117 #define MEDIA_LNK_FL_LINK_TYPE (0xf << 28) 118 #define MEDIA_LNK_FL_DATA_LINK (0 << 28) 119 #define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28) 120 struct media_link_desc { 121 struct media_pad_desc source; 122 struct media_pad_desc sink; 123 __u32 flags; 124 __u32 reserved[2]; 125 }; 126 struct media_links_enum { 127 __u32 entity; 128 struct media_pad_desc __user * pads; 129 struct media_link_desc __user * links; 130 __u32 reserved[4]; 131 }; 132 #define MEDIA_INTF_T_DVB_BASE 0x00000100 133 #define MEDIA_INTF_T_V4L_BASE 0x00000200 134 #define MEDIA_INTF_T_DVB_FE (MEDIA_INTF_T_DVB_BASE) 135 #define MEDIA_INTF_T_DVB_DEMUX (MEDIA_INTF_T_DVB_BASE + 1) 136 #define MEDIA_INTF_T_DVB_DVR (MEDIA_INTF_T_DVB_BASE + 2) 137 #define MEDIA_INTF_T_DVB_CA (MEDIA_INTF_T_DVB_BASE + 3) 138 #define MEDIA_INTF_T_DVB_NET (MEDIA_INTF_T_DVB_BASE + 4) 139 #define MEDIA_INTF_T_V4L_VIDEO (MEDIA_INTF_T_V4L_BASE) 140 #define MEDIA_INTF_T_V4L_VBI (MEDIA_INTF_T_V4L_BASE + 1) 141 #define MEDIA_INTF_T_V4L_RADIO (MEDIA_INTF_T_V4L_BASE + 2) 142 #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3) 143 #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4) 144 #define MEDIA_INTF_T_V4L_TOUCH (MEDIA_INTF_T_V4L_BASE + 5) 145 #define MEDIA_INTF_T_ALSA_BASE 0x00000300 146 #define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE) 147 #define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1) 148 #define MEDIA_INTF_T_ALSA_CONTROL (MEDIA_INTF_T_ALSA_BASE + 2) 149 #define MEDIA_V2_ENTITY_HAS_FLAGS(media_version) ((media_version) >= ((4 << 16) | (19 << 8) | 0)) 150 struct media_v2_entity { 151 __u32 id; 152 char name[64]; 153 __u32 function; 154 __u32 flags; 155 __u32 reserved[5]; 156 } __attribute__((packed)); 157 struct media_v2_intf_devnode { 158 __u32 major; 159 __u32 minor; 160 } __attribute__((packed)); 161 struct media_v2_interface { 162 __u32 id; 163 __u32 intf_type; 164 __u32 flags; 165 __u32 reserved[9]; 166 union { 167 struct media_v2_intf_devnode devnode; 168 __u32 raw[16]; 169 }; 170 } __attribute__((packed)); 171 #define MEDIA_V2_PAD_HAS_INDEX(media_version) ((media_version) >= ((4 << 16) | (19 << 8) | 0)) 172 struct media_v2_pad { 173 __u32 id; 174 __u32 entity_id; 175 __u32 flags; 176 __u32 index; 177 __u32 reserved[4]; 178 } __attribute__((packed)); 179 struct media_v2_link { 180 __u32 id; 181 __u32 source_id; 182 __u32 sink_id; 183 __u32 flags; 184 __u32 reserved[6]; 185 } __attribute__((packed)); 186 struct media_v2_topology { 187 __u64 topology_version; 188 __u32 num_entities; 189 __u32 reserved1; 190 __u64 ptr_entities; 191 __u32 num_interfaces; 192 __u32 reserved2; 193 __u64 ptr_interfaces; 194 __u32 num_pads; 195 __u32 reserved3; 196 __u64 ptr_pads; 197 __u32 num_links; 198 __u32 reserved4; 199 __u64 ptr_links; 200 } __attribute__((packed)); 201 #define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info) 202 #define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc) 203 #define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum) 204 #define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc) 205 #define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology) 206 #define MEDIA_IOC_REQUEST_ALLOC _IOR('|', 0x05, int) 207 #define MEDIA_REQUEST_IOC_QUEUE _IO('|', 0x80) 208 #define MEDIA_REQUEST_IOC_REINIT _IO('|', 0x81) 209 #define MEDIA_ENT_TYPE_SHIFT 16 210 #define MEDIA_ENT_TYPE_MASK 0x00ff0000 211 #define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff 212 #define MEDIA_ENT_T_DEVNODE_UNKNOWN (MEDIA_ENT_F_OLD_BASE | MEDIA_ENT_SUBTYPE_MASK) 213 #define MEDIA_ENT_T_DEVNODE MEDIA_ENT_F_OLD_BASE 214 #define MEDIA_ENT_T_DEVNODE_V4L MEDIA_ENT_F_IO_V4L 215 #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_F_OLD_BASE + 2) 216 #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_F_OLD_BASE + 3) 217 #define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_F_OLD_BASE + 4) 218 #define MEDIA_ENT_T_UNKNOWN MEDIA_ENT_F_UNKNOWN 219 #define MEDIA_ENT_T_V4L2_VIDEO MEDIA_ENT_F_IO_V4L 220 #define MEDIA_ENT_T_V4L2_SUBDEV MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN 221 #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR MEDIA_ENT_F_CAM_SENSOR 222 #define MEDIA_ENT_T_V4L2_SUBDEV_FLASH MEDIA_ENT_F_FLASH 223 #define MEDIA_ENT_T_V4L2_SUBDEV_LENS MEDIA_ENT_F_LENS 224 #define MEDIA_ENT_T_V4L2_SUBDEV_DECODER MEDIA_ENT_F_ATV_DECODER 225 #define MEDIA_ENT_T_V4L2_SUBDEV_TUNER MEDIA_ENT_F_TUNER 226 #define MEDIA_ENT_F_DTV_DECODER MEDIA_ENT_F_DV_DECODER 227 #define MEDIA_INTF_T_ALSA_COMPRESS (MEDIA_INTF_T_ALSA_BASE + 3) 228 #define MEDIA_INTF_T_ALSA_RAWMIDI (MEDIA_INTF_T_ALSA_BASE + 4) 229 #define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5) 230 #define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6) 231 #define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7) 232 #define MEDIA_API_VERSION ((0 << 16) | (1 << 8) | 0) 233 #endif 234