MWCapture SDK Mac 3.4.62314

- Home
- Development Library
- Release Notes

MWLinux.h
1
2// CONFIDENTIAL and PROPRIETARY software of Magewell Electronics Co., Ltd.
3// Copyright (c) 2011-2014 Magewell Electronics Co., Ltd. (Nanjing)
4// All rights reserved.
5// This copyright notice MUST be reproduced on all authorized copies.
7#ifndef __MW_LINUX__
8#define __MW_LINUX__
9
10#define MW_MAX_PROCESS_NAME_LEN (64)
11
12#include <sys/types.h>
13#include "MWCaptureExtension.h"
14
15#define MW_MAC_IOC(x) (x)
16#define MW_MAC_IOCR(x) (0x01000000 | (x))
17#define MW_MAC_IOCW(x) (0x02000000 | (x))
18#define MW_MAC_IOCRW(x) (0x03000000 | (x))
19
20#define MW_MAC_IOC_DIR(x) (((x) >> 24) & 0x3)
21#define MW_MAC_IOC_READ (0x1)
22#define MW_MAC_IOC_WRITE (0x2)
23
24
25 enum ProCaptureDriverIoctl{
26 MWCAP_IOCTL_GET_STREAMS_COUNT,
27 MWCAP_IOCTL_GET_STREAMS_INFO,
28 MWCAP_IOCTL_GET_CTRL_STREAM_ID,
29 MWCAP_IOCTL_SET_CTRL_STREAM_ID,
30 MWCAP_IOCTL_GET_SELF_STREAM_ID,
31
32 MWCAP_IOCTL_GET_CHANNEL_INFO = MW_MAC_IOCR(0x10),
33 MWCAP_IOCTL_GET_FAMILY_INFO = MW_MAC_IOCR(0x11),
34 MWCAP_IOCTL_GET_VIDEO_CAPS = MW_MAC_IOCR(0x12),
35 MWCAP_IOCTL_GET_AUDIO_CAPS = MW_MAC_IOCR(0x13),
36
37 // Firmware upgrade
38 MWCAP_IOCTL_GET_FIRMWARE_STORAGE,
39 MWCAP_IOCTL_SET_FIRMWARE_ERASE,
40 MWCAP_IOCTL_SET_FIRMWARE_DATA,
41 MWCAP_IOCTL_GET_FIRMWARE_DATA,
42
43 // Device misc controls
44 MWCAP_IOCTL_SET_LED_MODE = MW_MAC_IOCW(0x20),
45 MWCAP_IOCTL_SET_POST_RECONFIG = MW_MAC_IOCW(0x21),
46 MWCAP_IOCTL_GET_CORE_TEMPERATURE = MW_MAC_IOCR(0x22),
47
48 // Hardware timer
49 MWCAP_IOCTL_GET_TIME = MW_MAC_IOCR(0x23),
50 MWCAP_IOCTL_SET_TIME = MW_MAC_IOCW(0x24),
51 MWCAP_IOCTL_TIME_REGULATION = MW_MAC_IOCW(0x25),
52
53 MWCAP_IOCTL_TIMER_REGISTRATION = MW_MAC_IOCRW(0x26),
54 MWCAP_IOCTL_TIMER_DEREGISTRATION = MW_MAC_IOCW(0x27),
55 MWCAP_IOCTL_TIMER_EXPIRE_TIME = MW_MAC_IOCW(0x28),
56
57 // Notifications
58 MWCAP_IOCTL_NOTIFY_REGISTRATION = MW_MAC_IOCRW(0x29),
59 MWCAP_IOCTL_NOTIFY_DEREGISTRATION = MW_MAC_IOCW(0x2A),
60 MWCAP_IOCTL_NOTIFY_STATUS = MW_MAC_IOCRW(0x2B),
61 MWCAP_IOCTL_NOTIFY_ENABLE = MW_MAC_IOCW(0x2C),
62
63 // Video frame information
64 MWCAP_IOCTL_GET_VIDEO_BUFFER_INFO = MW_MAC_IOCR(0x2E),
65 MWCAP_IOCTL_GET_VIDEO_FRAME_INFO = MW_MAC_IOCRW(0x2F),
66
67 // Video capture
68 MWCAP_IOCTL_VIDEO_CAPTURE_OPEN = MW_MAC_IOC(0x30),
69 MWCAP_IOCTL_VIDEO_CAPTURE_FRAME = MW_MAC_IOCW(0x31),
70 MWCAP_IOCTL_VIDEO_CAPTURE_CLOSE = MW_MAC_IOC(0x32),
71 MWCAP_IOCTL_VIDEO_CAPTURE_STATUS = MW_MAC_IOCR(0x36),
72
73 // Audio capture
74 MWCAP_IOCTL_AUDIO_CAPTURE_OPEN = MW_MAC_IOC(0x33),
75 MWCAP_IOCTL_AUDIO_CAPTURE_FRAME = MW_MAC_IOCR(0x34),
76 MWCAP_IOCTL_AUDIO_CAPTURE_CLOSE = MW_MAC_IOC(0x35),
77
78 // Input source
79 MWCAP_IOCTL_VIDEO_INPUT_SOURCE_COUNT = MW_MAC_IOCR(0x40),
80 MWCAP_IOCTL_VIDEO_INPUT_SOURCE_ARRAY = MW_MAC_IOCRW(0x41),
81
82 MWCAP_IOCTL_AUDIO_INPUT_SOURCE_COUNT = MW_MAC_IOCR(0x42),
83 MWCAP_IOCTL_AUDIO_INPUT_SOURCE_ARRAY = MW_MAC_IOCRW(0x43),
84
85 MWCAP_IOCTL_SET_INPUT_SOURCE_SCAN = MW_MAC_IOCW(0x44),
86 MWCAP_IOCTL_GET_INPUT_SOURCE_SCAN = MW_MAC_IOCR(0x45),
87 MWCAP_IOCTL_GET_INPUT_SOURCE_SCAN_STATE = MW_MAC_IOCR(0x46),
88 MWCAP_IOCTL_SET_AV_INPUT_SOURCE_LINK = MW_MAC_IOCW(0x47),
89 MWCAP_IOCTL_GET_AV_INPUT_SOURCE_LINK = MW_MAC_IOCR(0x48),
90 MWCAP_IOCTL_SET_VIDEO_INPUT_SOURCE = MW_MAC_IOCW(0x49),
91 MWCAP_IOCTL_GET_VIDEO_INPUT_SOURCE = MW_MAC_IOCR(0x4A),
92 MWCAP_IOCTL_SET_AUDIO_INPUT_SOURCE = MW_MAC_IOCW(0x4B),
93 MWCAP_IOCTL_GET_AUDIO_INPUT_SOURCE = MW_MAC_IOCR(0x4C),
94
95 // EDID
96 MWCAP_IOCTL_GET_EDID_DATA = MW_MAC_IOCRW(0x50),
97 MWCAP_IOCTL_SET_EDID_DATA = MW_MAC_IOCW(0x51),
98
99 // Signal status
100 MWCAP_IOCTL_GET_INPUT_SPECIFIC_STATUS = MW_MAC_IOCR(0x52),
101 MWCAP_IOCTL_GET_VIDEO_SIGNAL_STATUS = MW_MAC_IOCR(0x53),
102 MWCAP_IOCTL_GET_AUDIO_SIGNAL_STATUS = MW_MAC_IOCR(0x54),
103
104 // HDMI status
105 MWCAP_IOCTL_GET_HDMI_INFOFRAME_VALID = MW_MAC_IOCR(0x55),
106 MWCAP_IOCTL_GET_HDMI_INFOFRAME_PACKET = MW_MAC_IOCR(0x56),
107
108 // Video processing
109 MWCAP_IOCTL_GET_VIDEO_INPUT_ASPECT_RATIO = MW_MAC_IOCR(0x57),
110 MWCAP_IOCTL_SET_VIDEO_INPUT_ASPECT_RATIO = MW_MAC_IOCW(0x58),
111 MWCAP_IOCTL_GET_VIDEO_INPUT_COLOR_FORMAT = MW_MAC_IOCR(0x59),
112 MWCAP_IOCTL_SET_VIDEO_INPUT_COLOR_FORMAT = MW_MAC_IOCW(0x5A),
113 MWCAP_IOCTL_GET_VIDEO_INPUT_QUANTIZATION_RANGE = MW_MAC_IOCR(0x5B),
114 MWCAP_IOCTL_SET_VIDEO_INPUT_QUANTIZATION_RANGE = MW_MAC_IOCW(0x5C),
115
116 // Image upload, can be use as source image or OSD image
117 MWCAP_IOCTL_VIDEO_CREATE_IMAGE,
118 MWCAP_IOCTL_VIDEO_OPEN_IMAGE,
119 MWCAP_IOCTL_VIDEO_CLOSE_IMAGE,
120 MWCAP_IOCTL_VIDEO_UPLOAD_IMAGE,
121
122 // VGA/Component timings
123 MWCAP_IOCTL_GET_VIDEO_AUTO_H_ALIGN = MW_MAC_IOCR(0x70),
124 MWCAP_IOCTL_SET_VIDEO_AUTO_H_ALIGN = MW_MAC_IOCW(0x71),
125 /* (0-31, 255 triger auto adjust once) */
126 MWCAP_IOCTL_GET_VIDEO_SAMPLING_PHASE = MW_MAC_IOCR(0x72),
127 MWCAP_IOCTL_SET_VIDEO_SAMPLING_PHASE = MW_MAC_IOCW(0x73),
128 MWCAP_IOCTL_GET_VIDEO_SAMPLING_PHASE_AUTO = MW_MAC_IOCR(0x74),
129 MWCAP_IOCTL_SET_VIDEO_SAMPLING_PHASE_AUTO = MW_MAC_IOCW(0x75),
130 MWCAP_IOCTL_SET_VIDEO_TIMING = MW_MAC_IOCW(0x76),
131 MWCAP_IOCTL_GET_VIDEO_PREFERRED_TIMING_ARRAY = MW_MAC_IOCRW(0x77),
132 MWCAP_IOCTL_SET_VIDEO_CUSTOM_TIMING = MW_MAC_IOCW(0x78),
133 MWCAP_IOCTL_GET_VIDEO_CUSTOM_TIMING_COUNT = MW_MAC_IOCR(0x79),
134 MWCAP_IOCTL_GET_VIDEO_CUSTOM_TIMING_ARRAY = MW_MAC_IOCRW(0x7A),
135 MWCAP_IOCTL_SET_VIDEO_CUSTOM_TIMING_ARRAY = MW_MAC_IOCW(0x7B),
136 MWCAP_IOCTL_GET_VIDEO_CUSTOM_RESOLUTION_COUNT = MW_MAC_IOCR(0x7C),
137 MWCAP_IOCTL_GET_VIDEO_CUSTOM_RESOLUTION_ARRAY = MW_MAC_IOCRW(0x7D),
138 MWCAP_IOCTL_SET_VIDEO_CUSTOM_RESOLUTION_ARRAY = MW_MAC_IOCW(0x7E),
139
140
141 /* Video capture enhancement */
142 MWCAP_IOCTL_VIDEO_PIN_BUFFER = MW_MAC_IOCW(0x80),
143 MWCAP_IOCTL_VIDEO_UNPIN_BUFFER = MW_MAC_IOCW(0x81),
144
145
146 /* save current process settings and osd settings as default for this device */
147 MWCAP_IOCTL_SETTINGS_SAVE_AS_PRESET,
148 /* reload default settings to overwrite current process settings and osd settings */
149 MWCAP_IOCTL_SETTINGS_RELOAD_PRESET,
150
151 // Video processing (NOT functional for mwcap stream)
152 MWCAP_IOCTL_GET_VIDEO_CONNECTION_FORMAT,
153 MWCAP_IOCTL_GET_VIDEO_PROCESS_SETTINGS,
154 MWCAP_IOCTL_SET_VIDEO_PROCESS_SETTINGS,
155 MWCAP_IOCTL_GET_VIDEO_OSD_SETTINGS,
156 MWCAP_IOCTL_SET_VIDEO_OSD_SETTINGS,
157 MWCAP_IOCTL_GET_VIDEO_OSD_IMAGE,
158 MWCAP_IOCTL_SET_VIDEO_OSD_IMAGE,
159
160 // Video AMP
161 MWCAP_IOCTL_GET_BRIGHTNESS,
162 MWCAP_IOCTL_SET_BRIGHTNESS,
163 MWCAP_IOCTL_GET_CONTRAST,
164 MWCAP_IOCTL_SET_CONTRAST,
165 MWCAP_IOCTL_GET_HUE,
166 MWCAP_IOCTL_SET_HUE,
167 MWCAP_IOCTL_GET_SATURATION,
168 MWCAP_IOCTL_SET_SATURATION,
169
170 // SDI ANC Packet
171 MWCAP_IOCTL_SET_SDI_ANC_TYPE = MW_MAC_IOCW(0x82),
172 MWCAP_IOCTL_GET_SDI_ANC_PACKET = MW_MAC_IOCR(0x83),
173
174
175 /* Get SDI ANC Packats binding to currently dequeued frame via V4L2.
176 * This is conflicting with MWCAP_IOCTL_GET_SDI_ANC_PACKET. You can
177 * use only one of them at the same time.,
178 */
179 MWCAP_IOCTL_GET_V4L2_FRAME_SDI_ANC_PACKETS,
180 MWCAP_IOCTL_GET_ENABLE_V4L2_FRAME_SDI_ANC,
181 MWCAP_IOCTL_SET_ENABLE_V4L2_FRAME_SDI_ANC,
182
183 MWCAP_IOCTL_VIDEO_ECO_CAPTURE_OPEN,
184 MWCAP_IOCTL_VIDEO_ECO_CAPTURE_GET_SETTINGS,
185 MWCAP_IOCTL_VIDEO_ECO_CAPTURE_SET_SETTINGS,
186 MWCAP_IOCTL_VIDEO_ECO_CAPTURE_FRAME,
187 MWCAP_IOCTL_VIDEO_ECO_CAPTURE_STATUS,
188 MWCAP_IOCTL_VIDEO_ECO_CAPTURE_CLOSE,
189
190 MWCAP_IOCTL_VIDEO_UPLOAD_STATUS_IMAGE = MW_MAC_IOCW(0x8F),
191
192};
193
194#pragma pack(push)
195#pragma pack(1)
196
197 typedef struct _MWCAP_IOCTL_VIDEO_UPLOAD_STATUS_IMAGE {
198 uint8_t type; // 0: Nosignal, 1: Locking, 2: Unsupported
199 uint16_t width;
200 uint16_t height;
201 uint64_t buf_addr;
202 uint32_t buf_size;
203} MWCAP_VIDEO_UPLOAD_STATUS_IMAGE;
204
205 typedef struct _MWCAP_STREAM_INFO {
206 int stream_id; /* >1 */
207// pid_t pid; /* proc id */
208 char comm[MW_MAX_PROCESS_NAME_LEN]; /* executable name excluding path */
209 bool streaming; /* ONLY for os local function, not mwcap */
210} MWCAP_STREAM_INFO;
211
212 typedef struct _MWCAP_STREAMS_INFO {
213 int count;
214 MWCAP_PTR infos; /* (MWCAP_STREAM_INFO, infos) */
215} MWCAP_STREAMS_INFO;
216
217 typedef struct _MWCAP_FIRMWARE_DATA {
218 unsigned int offset;
219 unsigned int size; /* data size */
220 MWCAP_PTR data; /* (unsigned char * data) */
221} MWCAP_FIRMWARE_DATA;
222
223 typedef struct _MWCAP_INPUT_SOURCE_ARRAY {
224 unsigned int count; /* count of element, user set */
225 MWCAP_PTR data; /* (unsigned int * data) */
226} MWCAP_INPUT_SOURCE_ARRAY;
227
228 typedef struct _MWCAP_EDID_DATA {
229 int size;
230 MWCAP_PTR data; /* (unsigned char * data) */
231} MWCAP_EDID_DATA;
232
233 typedef struct _MWCAP_HDMI_INFOFRAME_PACKET {
234 unsigned int id;
235 HDMI_INFOFRAME_PACKET pkt;
236} MWCAP_HDMI_INFOFRAME_PACKET;
237
238 typedef struct _MWCAP_VIDEO_TIMING_PAR {
239 int count; // max: MWCAP_VIDEO_MAX_NUM_PREFERRED_TIMINGS
240 MWCAP_PTR timings; /* (MWCAP_VIDEO_TIMING * timings) */
241} MWCAP_VIDEO_TIMING_PAR;
242
243 typedef struct _MWCAP_VIDEO_CUSTOM_TIMING_PAR {
244 int count;
245 MWCAP_PTR timings; /* (MWCAP_VIDEO_CUSTOM_TIMING * timings) */
246} MWCAP_VIDEO_CUSTOM_TIMING_PAR;
247
248 typedef struct _MWCAP_VIDEO_CUSTOM_RESOLUTION_PAR {
249 int count;
250 MWCAP_PTR resolutions; /* (MWCAP_SIZE * resolutions) */
251} MWCAP_VIDEO_CUSTOM_RESOLUTION_PAR;
252
253 typedef struct _MWCAP_VIDEO_FRAME_INFO_PAR {
254 int iframe; // set
255 MWCAP_VIDEO_FRAME_INFO info; // get
256} MWCAP_VIDEO_FRAME_INFO_PAR;
257
258#pragma pack(pop)
259
260#endif /* __MW_LINUX__ */
_HDMI_INFOFRAME_PACKET
HDMI_INFOFRAME_PACKET.
Definition: MWHDMIPackets.h:361
_MWCAP_EDID_DATA
Definition: MWLinux.h:228
_MWCAP_FIRMWARE_DATA
Definition: MWLinux.h:217
_MWCAP_HDMI_INFOFRAME_PACKET
Definition: MWLinux.h:233
_MWCAP_INPUT_SOURCE_ARRAY
Definition: MWLinux.h:223
_MWCAP_IOCTL_VIDEO_UPLOAD_STATUS_IMAGE
Definition: MWLinux.h:197
_MWCAP_STREAM_INFO
Definition: MWLinux.h:205
_MWCAP_STREAMS_INFO
Definition: MWLinux.h:212
_MWCAP_VIDEO_CUSTOM_RESOLUTION_PAR
Definition: MWLinux.h:248
_MWCAP_VIDEO_CUSTOM_TIMING_PAR
Definition: MWLinux.h:243
_MWCAP_VIDEO_FRAME_INFO_PAR
Definition: MWLinux.h:253
_MWCAP_VIDEO_FRAME_INFO
MWCAP_VIDEO_FRAME_INFO.
Definition: MWCaptureExtension.h:1136
_MWCAP_VIDEO_TIMING_PAR
Definition: MWLinux.h:238