MWCapture SDK Mac 3.4.62314

- Home
- Development Library
- Release Notes

MWUSBCaptureExtension.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 _MWUSB_CAPTURE_EXTENSION_H_
8#define _MWUSB_CAPTURE_EXTENSION_H_
9
10#include <stdlib.h>
11#include <stdint.h>
12#include "MWCaptureExtension.h"
13
14#ifdef __cplusplus
15 extern "C" {
16#endif
17
18#pragma pack(push,1)
19
20 typedef int8_t bool_t;
21 typedef void* HUSBCHANNEL;
22
23 enum _MWCAP_HID_EXTENSION {
24 // Product informations (General)
25 MWCAP_HID_CHANNEL_INFO = 1, // G, Data: uint8_t, MWCAP_CHANNEL_INFO
26 MWCAP_HID_FAMILY_INFO, // G, Data: uint8_t, MWCAP_USB_CAPTURE_INFO
27
28 MWCAP_HID_VIDEO_CAPS, // G, Data: uint8_t, MWCAP_VIDEO_CAPS
29 MWCAP_HID_AUDIO_CAPS, // G, Data: uint8_t, MWCAP_AUDIO_CAPS
30
31 // Device controls (General)
32 MWCAP_HID_LED_MODE, // S, Data: uint8_t, uint32_t
33 MWCAP_HID_POST_RECONFIG, // S, Data: uint8_t, uint32_t
34
35 // Notification (General)
36 MWCAP_HID_NOTIFY_ENABLE, // S, Data: uint8_t, MWCAP_NOTIFY_ENABLE
37 MWCAP_HID_NOITFY_STATUS, // G, Data: uint8_t, uint64_t
38
39 // Input source (General)
40 MWCAP_HID_VIDEO_INPUT_SOURCE_ARRAY, // G, Data: uint8_t, MWCAP_INPUT_SOURCE_ARRAY
41 MWCAP_HID_AUDIO_INPUT_SOURCE_ARRAY, // G, Data: uint8_t, MWCAP_INPUT_SOURCE_ARRAY
42
43 MWCAP_HID_INPUT_SOURCE_SCAN, // G/S, Data: uint8_t, bool_t
44 MWCAP_HID_INPUT_SOURCE_SCAN_STATE, // G, Data: uint8_t, bool_t
45 MWCAP_HID_AV_INPUT_SOURCE_LINK, // G/S, Data: uint8_t, bool_t
46 MWCAP_HID_VIDEO_INPUT_SOURCE, // G/S, Data: uint8_t, uint32_t
47 MWCAP_HID_AUDIO_INPUT_SOURCE, // G/S, Data: uint8_t, uint32_t
48
49 // Signal status (General)
50 MWCAP_HID_INPUT_SPECIFIC_STATUS, // G, Data: uint8_t, MWCAP_INPUT_SPECIFIC_STATUS
51 MWCAP_HID_VIDEO_SIGNAL_STATUS, // G, Data: uint8_t, MWCAP_VIDEO_SIGNAL_STATUS
52 MWCAP_HID_AUDIO_SIGNAL_STATUS, // G, Data: uint8_t, MWCAP_AUDIO_SIGNAL_STATUS
53
54 // Video processing (General)
55 MWCAP_HID_VIDEO_INPUT_ASPECT_RATIO, // G/S, Data: uint8_t, MWCAP_VIDEO_ASPECT_RATIO
56 MWCAP_HID_VIDEO_INPUT_COLOR_FORMAT, // G/S, Data: uint8_t, uint8_t
57 MWCAP_HID_VIDEO_INPUT_QUANTIZATION_RANGE, // G/S, Data: uint8_t, uint8_t
58
59 MWCAP_HID_VIDEO_CAPTURE_CONNECTION_FORMAT, // G, Data: uint8_t, MWCAP_VIDEO_CONNECTION_FORMAT
60 MWCAP_HID_VIDEO_CAPTURE_PROCESS_SETTINGS, // G/S, Data: uint8_t, MWCAP_VIDEO_PROCESS_SETTINGS
61
62 // Video output formats (General)
63 MWCAP_HID_VIDEO_OUTPUT_FOURCC, // G/S, Data: uint8_t, MWCAP_VIDEO_OUTPUT_FOURCC
64 MWCAP_HID_VIDEO_OUTPUT_FRAME_SIZE, // G/S, Data: uint8_t, MWCAP_VIDEO_OUTPUT_FRAME_SIZE
65 MWCAP_HID_VIDEO_OUTPUT_FRAME_INTERVAL, // G/S, Data: uint8_t, MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL
66
67 // VGA/Component timings (Timing) (0x90 - 0x99)
68 MWCAP_HID_VIDEO_AUTO_H_ALIGN = 0x90, // G/S, Data: uint8_t, bool_t
69 MWCAP_HID_VIDEO_SAMPLING_PHASE, // G/S, Data: uint8_t, uint8_t (0-31, 255 triger auto adjust once)
70 MWCAP_HID_VIDEO_SAMPLING_PHASE_AUTO, // G/S, Data: uint8_t, bool_t
71 MWCAP_HID_VIDEO_TIMING, // S, Data: uint8_t, MWCAP_VIDEO_TIMING
72 MWCAP_HID_VIDEO_PREFERRED_TIMING_ARRAY, // G, Data: uint8_t, MWCAP_VIDEO_TIMING_ARRAY
73 MWCAP_HID_VIDEO_CUSTOM_TIMING, // S, Data: uint8_t, MWCAP_VIDEO_CUSTOM_TIMING
74 MWCAP_HID_VIDEO_CUSTOM_TIMING_ARRAY, // G/S, Data: uint8_t, MWCAP_VIDEO_CUSTOM_TIMING_ARRAY
75 MWCAP_HID_VIDEO_CUSTOM_RESOLUTION_ARRAY, // G/S, Data: uint8_t, MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY
76
77 // HDMI related (HDMI) (0x9A - 0x9F)
78 MWCAP_HID_EDID, // G/S, Data: uint8_t, uint8_t[256]
79 MWCAP_HID_EDID_LOOP_THROUGH, // G, Data: uint8_t, uint8_t[256]
80 MWCAP_HID_EDID_MODE, // G/S, Data: uint8_t, uint8_t
81
82 MWCAP_HID_LOOP_THROUGH, // G, Data: uint8_t, bool_t
83
84 // HDMI status (HDMI) (0xA0 - 0xB0)
85 MWCAP_HID_HDMI_INFOFRAME_VALID = 0xA0, // G, Data: uint8_t, uint32_t
86 MWCAP_HID_HDMI_INFOFRAME_AVI, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
87 MWCAP_HID_HDMI_INFOFRAME_AUDIO, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
88 MWCAP_HID_HDMI_INFOFRAME_SPD, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
89 MWCAP_HID_HDMI_INFOFRAME_MS, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
90 MWCAP_HID_HDMI_INFOFRAME_VS, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
91 MWCAP_HID_HDMI_INFOFRAME_ACP, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
92 MWCAP_HID_HDMI_INFOFRAME_ISRC1, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
93 MWCAP_HID_HDMI_INFOFRAME_ISRC2, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
94 MWCAP_HID_HDMI_INFOFRAME_GAMUT, // G, Data: uint8_t, HDMI_INFOFRAME_PACKET
95
96 // Audio volumes (Volume) (0xB0 - 0xC0)
97 MWCAP_HID_AUDIO_VOLUME_MICROPHONE = 0xB0, // G/S, Data: uint8_t, MWCAP_AUDIO_VOLUME
98 MWCAP_HID_AUDIO_VOLUME_HEADPHONE, // G/S, Data: uint8_t, MWCAP_AUDIO_VOLUME
99 MWCAP_HID_AUDIO_VOLUME_LINE_IN, // G/S, Data: uint8_t, MWCAP_AUDIO_VOLUME
100 MWCAP_HID_AUDIO_VOLUME_LINE_OUT, // G/S, Data: uint8_t, MWCAP_AUDIO_VOLUME
101 MWCAP_HID_AUDIO_VOLUME_EMBEDDED_CAPTURE, // G/S, Data: uint8_t, MWCAP_AUDIO_VOLUME
102 MWCAP_HID_AUDIO_VOLUME_EMBEDDED_PLAYBACK, // G/S, Data: uint8_t, MWCAP_AUDIO_VOLUME
103 MWCAP_HID_AUDIO_VOLUME_USB_CAPTURE, // G/S, Data: uint8_t, MWCAP_AUDIO_VOLUME
104 MWCAP_HID_AUDIO_VOLUME_USB_PLAYBACK, // G/S, Data: uint8_t, MWCAP_AUDIO_VOLUME
105
106 // Reserved (0xC0 - 0xD0)
107
108 // Reserved for future (0xD0 - 0xE0)
109
110 // Firmware upgrade (General)
111 MWCAP_HID_FIRMWARE_STORAGE = 0xF0, // G, Data: uint8_t, MWCAP_FIRMWARE_STORAGE
112 MWCAP_HID_FIRMWARE_ERASE, // S, Data: uint8_t, MWCAP_FIRMWARE_ERASE
113 MWCAP_HID_FIRMWARE_READ_ADDRESS, // G/S, Data: uint8_t, uint32_t
114 MWCAP_HID_FIRMWARE_DATA, // G/S, Data: uint8_t, MWCAP_FIRMWARE_DATA
115 MWCAP_HID_FIRMWARE_WIP, // G, Data: uint8_t, bool_t
116
117 // Options
118 MWCAP_HID_STATUS_IMAGE_MODE = 0xFC, // G/S, Data: uint8_t, uint8_t
119 MWCAP_HID_DEVICE_NAME_MODE = 0xFD, // G/S, Data: uint8_t, uint8_t
120 MWCAP_HID_OPTIONS_CONTROL = 0xFE, // S, Data: uint8_t, uint8_t
121
122 // Extension sets supported (General)
123 MWCAP_HID_EXTENSION_SUPPORTED = 0xFF // G, Data: uint8_t, uint32_t
124};
125
126 typedef enum _MWUSBHOT_PLUG_EVETN {
127 USBHOT_PLUG_EVENT_DEVICE_ARRIVED = 1,
128 USBHOT_PLUG_EVENT_DEVICE_LEFT,
129}MWUSBHOT_PLUG_EVETN;
130
131 typedef void(*LPFN_HOT_PLUG_CALLBACK)(MWUSBHOT_PLUG_EVETN event, const char *pszDevicePath, void* pParam);
132
133#define MW_SERIAL_NO_LEN 16
134#define MW_FAMILY_NAME_LEN 64
135#define MW_PRODUCT_NAME_LEN 64
136#define MW_FIRMWARE_NAME_LEN 64
137
145 typedef struct _MWUSBCAP_CAPTURE_INFO {
146 uint8_t byUSBSpeed;
147 uint8_t byBoardIndex;
148 uint32_t cbTotalMemorySize;
149 uint32_t cbFreeMemorySize;
150} MWUSBCAP_CAPTURE_INFO;
151
152 typedef struct _MWCAP_USB_INPUT_SOURCE_ARRAY {
153 uint8_t byNumInputSource;
154 uint32_t adwInputSources[16];
155} MWCAP_USB_INPUT_SOURCE_ARRAY;
156
157 typedef struct _MWCAP_USB_FIRMWARE_DATA {
158 uint32_t offset;
159 int16_t size; /* data size */
160 uint8_t data[256]; /* (unsigned char * data) */
161} MWCAP_USB_FIRMWARE_DATA;
162
163
164 typedef enum _MWCAP_EDID_MODE {
165 MWCAP_EDID_MODE_FIXED = 0x01,
166 MWCAP_EDID_MODE_KEEP_LAST = 0x02,
167 MWCAP_EDID_MODE_ADD_AUDIO = 0x04,
168 MWCAP_EDID_MODE_LIMIT_PIXEL_CLOCK = 0x08
169} MWCAP_EDID_MODE;
170
171#define MWCAP_MAX_NUM_AUDIO_CHANNEL 16
172
173 typedef struct _MWCAP_AUDIO_VOLUME {
174 uint8_t byChannels;
175 uint8_t byReserved;
176 int16_t sVolumeMin;
177 int16_t sVolumeMax;
178 int16_t sVolumeStep;
179
180 bool_t abMute[MWCAP_MAX_NUM_AUDIO_CHANNEL];
181 int16_t asVolume[MWCAP_MAX_NUM_AUDIO_CHANNEL];
182} MWCAP_AUDIO_VOLUME;
183
184 typedef enum _MWCAP_USB_AUDIO_NODE {
185 MWCAP_USB_AUDIO_MICROPHONE,
186 MWCAP_USB_AUDIO_HEADPHONE,
187 MWCAP_USB_AUDIO_LINE_IN,
188 MWCAP_USB_AUDIO_LINE_OUT,
189 MWCAP_USB_AUDIO_EMBEDDED_CAPTURE,
190 MWCAP_USB_AUDIO_EMBEDDED_PLAYBACK,
191 MWCAP_USB_AUDIO_USB_CAPTURE,
192 MWCAP_USB_AUDIO_USB_PLAYBACK
193} MWCAP_USB_AUDIO_NODE ;
194
195 typedef struct _MWRECT {
196 int16_t left;
197 int16_t top;
198 int16_t right;
199 int16_t bottom;
200} MWRECT;
201
202#define MWCAP_MAX_NUM_VIDEO_OUTPUT_FOURCC 3
203#define MWCAP_MAX_NUM_VIDEO_OUTPUT_FRAME_SIZE 24
204#define MWCAP_MAX_NUM_VIDEO_OUTPUT_FRAME_INTERVAL 8
205
206 typedef struct _MWCAP_VIDEO_OUTPUT_FOURCC {
207 uint8_t byCount;
208 uint32_t adwFOURCCs[MWCAP_MAX_NUM_VIDEO_OUTPUT_FOURCC];
209} MWCAP_VIDEO_OUTPUT_FOURCC;
210
211 typedef struct _MWSIZE {
212 int16_t cx;
213 int16_t cy;
214} MWSIZE;
215
216 typedef struct _MWCAP_VIDEO_OUTPUT_FRAME_SIZE {
217 uint8_t byCount;
218 uint8_t byDefault;
219 MWSIZE aSizes[MWCAP_MAX_NUM_VIDEO_OUTPUT_FRAME_SIZE];
220} MWCAP_VIDEO_OUTPUT_FRAME_SIZE;
221
222 typedef struct _MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL {
223 uint8_t byCount;
224 uint8_t byDefault;
225 uint32_t adwIntervals[MWCAP_MAX_NUM_VIDEO_OUTPUT_FRAME_INTERVAL];
226} MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL;
227
228 typedef enum _MWCAP_STATUS_IMAGE_MODE {
229 MWCAP_STATUS_IMAGE_DEFAULT,
230 MWCAP_STATUS_IMAGE_BLUE,
231 MWCAP_STATUS_IMAGE_BLACK
232}MWCAP_STATUS_IMAGE_MODE;
233
234 typedef enum _MWCAP_DEVICE_NAME_MODE {
235 MWCAP_DEVICE_NAME_DEFAULT,
236 MWCAP_DEVICE_NAME_SERIAL_NUMBER
237} MWCAP_DEVICE_NAME_MODE;
238
239 typedef enum _MWCAP_OPTIONS_CONTROL {
240 MWCAP_OPTIONS_RESET, // Reset options to default value
241 MWCAP_OPTIONS_LOAD, // Load from flash/eeprom storage
242 MWCAP_OPTIONS_SAVE // Save to flash/eeprom storage
243} MWCAP_OPTIONS_CONTROL;
244
245 typedef struct _MWCAP_VIDEO_TIMING_ARRAY {
246 uint8_t byNumTimings;
247 MWCAP_VIDEO_TIMING aTimings[8];
248} MWCAP_VIDEO_TIMING_ARRAY;
249
250 typedef struct _MWCAP_VIDEO_CUSTOM_TIMING_ARRAY {
251 uint8_t byNumCustomTimings;
252 MWCAP_VIDEO_CUSTOM_TIMING aCustomTimings[8];
253} MWCAP_VIDEO_CUSTOM_TIMING_ARRAY;
254
255 typedef struct _MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY {
256 uint8_t byNumCustomResolutions;
257 MWSIZE aCustomResolutions[16];
258} MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY;
259
260 typedef struct _MWCAP_VIDEO_FRAMERATE{
261 int nFrameDuration;
262 float fFPS;
263}MWCAP_VIDEO_FRAMERATE;
264
265
266 typedef struct _MWCAP_VIDEO_FRAMERATE_EX{
267 int nFrameDurationDen;
268 int nFrameDurationNum;
269}MWCAP_VIDEO_FRAMERATE_EX;
270
271
272// USB additional capabilities
273#define MWCAP_USB_VIDEO_CAP_HDMI_LOOP_THROUGH 0x00000001
274#define MWCAP_USB_VIDEO_CAP_SDI_LOOP_THROUGH 0x00000002
275#define MWCAP_USB_VIDEO_CAP_PLANAR_FORMAT 0x00000004
276
277#define MWCAP_USB_AUDIO_CAP_MICROPHONE (1 << MWCAP_USB_AUDIO_MICROPHONE)
278#define MWCAP_USB_AUDIO_CAP_HEADPHONE (1 << MWCAP_USB_AUDIO_HEADPHONE)
279#define MWCAP_USB_AUDIO_CAP_LINE_IN (1 << MWCAP_USB_AUDIO_LINE_IN)
280#define MWCAP_USB_AUDIO_CAP_LINE_OUT (1 << MWCAP_USB_AUDIO_LINE_OUT)
281#define MWCAP_USB_AUDIO_CAP_EMBEDDED_CAPTURE (1 << MWCAP_USB_AUDIO_EMBEDDED_CAPTURE)
282#define MWCAP_USB_AUDIO_CAP_EMBEDDED_PLAYBACK (1 << MWCAP_USB_AUDIO_EMBEDDED_PLAYBACK)
283#define MWCAP_USB_AUDIO_CAP_USB_CAPTURE (1 << MWCAP_USB_AUDIO_USB_CAPTURE)
284#define MWCAP_USB_AUDIO_CAP_USB_PLAYBACK (1 << MWCAP_USB_AUDIO_USB_PLAYBACK)
285
286#define MWCAP_NOTIFY_VOLUME_MICROPHONE (1ULL << (48 + MWCAP_USB_AUDIO_MICROPHONE))
287#define MWCAP_NOTIFY_VOLUME_HEADPHONE (1ULL << (48 + MWCAP_USB_AUDIO_HEADPHONE))
288#define MWCAP_NOTIFY_VOLUME_LINE_IN (1ULL << (48 + MWCAP_USB_AUDIO_LINE_IN))
289#define MWCAP_NOTIFY_VOLUME_LINE_OUT (1ULL << (48 + MWCAP_USB_AUDIO_LINE_OUT))
290#define MWCAP_NOTIFY_VOLUME_EMBEDDED_CAPTURE (1ULL << (48 + MWCAP_USB_AUDIO_EMBEDDED_CAPTURE))
291#define MWCAP_NOTIFY_VOLUME_EMBEDDED_PLAYBACK (1ULL << (48 + MWCAP_USB_AUDIO_EMBEDDED_PLAYBACK))
292#define MWCAP_NOTIFY_VOLUME_USB_CAPTURE (1ULL << (48 + MWCAP_USB_AUDIO_USB_CAPTURE))
293#define MWCAP_NOTIFY_VOLUME_USB_PLAYBACK (1ULL << (48 + MWCAP_USB_AUDIO_USB_PLAYBACK))
294
295 enum _MWCAP_USB_SPEED_TYPE {
296 MWCAP_USB_FULL_SPEED = 0x01,
297 MWCAP_USB_HIGH_SPEED = 0x02,
298 MWCAP_USB_SUPER_SPEED_GEN1 = 0x03,
299 MWCAP_USB_SUPER_SPEED_GEN2 = 0x04
300};
301
302// MWCAP_HID_EXTENSION_SET
303#define MWCAP_HID_EXTENSION_HDMI 0x00000001
304#define MWCAP_HID_EXTENSION_TIMING 0x00000002
305#define MWCAP_HID_EXTENSION_VOLUME 0x00000004
306
307#define MWCAP_MAX_NUM_AUDIO_CHANNEL 16
308
309#define MWCAP_MAX_NUM_VIDEO_OUTPUT_FOURCC 3
310#define MWCAP_MAX_NUM_VIDEO_OUTPUT_FRAME_SIZE 24
311#define MWCAP_MAX_NUM_VIDEO_OUTPUT_FRAME_INTERVAL 8
312
313#pragma pack(pop)
314
315#ifdef __cplusplus
316}
317#endif
318
319
320#endif //_MWUSB_CAPTURE_EXTENSION_H_
MWUSBCAP_CAPTURE_INFO
struct _MWUSBCAP_CAPTURE_INFO MWUSBCAP_CAPTURE_INFO
MWUSBCAP_CAPTURE_INFO.
_MWCAP_AUDIO_VOLUME
Definition: MWUSBCaptureExtension.h:173
_MWCAP_USB_FIRMWARE_DATA
Definition: MWUSBCaptureExtension.h:157
_MWCAP_USB_INPUT_SOURCE_ARRAY
Definition: MWUSBCaptureExtension.h:152
_MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY
Definition: MWUSBCaptureExtension.h:255
_MWCAP_VIDEO_CUSTOM_TIMING_ARRAY
Definition: MWUSBCaptureExtension.h:250
_MWCAP_VIDEO_CUSTOM_TIMING
MWCAP_VIDEO_CUSTOM_TIMING.
Definition: MWCaptureExtension.h:1547
_MWCAP_VIDEO_FRAMERATE_EX
Definition: MWUSBCaptureExtension.h:266
_MWCAP_VIDEO_FRAMERATE
Definition: MWUSBCaptureExtension.h:260
_MWCAP_VIDEO_OUTPUT_FOURCC
Definition: MWUSBCaptureExtension.h:206
_MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL
Definition: MWUSBCaptureExtension.h:222
_MWCAP_VIDEO_OUTPUT_FRAME_SIZE
Definition: MWUSBCaptureExtension.h:216
_MWCAP_VIDEO_TIMING_ARRAY
Definition: MWUSBCaptureExtension.h:245
_MWCAP_VIDEO_TIMING
MWCAP_VIDEO_TIMING.
Definition: MWCaptureExtension.h:330
_MWRECT
Definition: MWUSBCaptureExtension.h:195
_MWSIZE
Definition: MWUSBCaptureExtension.h:211
_MWUSBCAP_CAPTURE_INFO
MWUSBCAP_CAPTURE_INFO.
Definition: MWUSBCaptureExtension.h:145
_MWUSBCAP_CAPTURE_INFO::cbFreeMemorySize
uint32_t cbFreeMemorySize
Free memory size.
Definition: MWUSBCaptureExtension.h:149
_MWUSBCAP_CAPTURE_INFO::cbTotalMemorySize
uint32_t cbTotalMemorySize
Total memory size.
Definition: MWUSBCaptureExtension.h:148
_MWUSBCAP_CAPTURE_INFO::byUSBSpeed
uint8_t byUSBSpeed
USB speed: 1.0, 2.0, 3.0.
Definition: MWUSBCaptureExtension.h:146
_MWUSBCAP_CAPTURE_INFO::byBoardIndex
uint8_t byBoardIndex
The value is 0.
Definition: MWUSBCaptureExtension.h:147