include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / winegstreamer / unixlib.h
blob19270bd731bad1314a22bff30e3a0405df7257d2
1 /*
2 * winegstreamer Unix library interface
4 * Copyright 2020-2021 Zebediah Figura for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINEGSTREAMER_UNIXLIB_H
22 #define __WINE_WINEGSTREAMER_UNIXLIB_H
24 #include <stdint.h>
25 #include "windef.h"
26 #include "winternl.h"
27 #include "wtypes.h"
28 #include "mmreg.h"
29 #include "vfw.h"
30 #include "dshow.h"
31 #include "dvdmedia.h"
32 #include "mfobjects.h"
34 #include "wine/unixlib.h"
36 /* same as MPEG1VIDEOINFO / MPEG2VIDEOINFO but with MFVIDEOFORMAT */
37 struct mpeg_video_format
39 MFVIDEOFORMAT hdr;
40 UINT32 start_time_code;
41 UINT32 profile;
42 UINT32 level;
43 UINT32 flags;
44 UINT32 sequence_header_count;
45 UINT32 __pad;
46 BYTE sequence_header[];
49 C_ASSERT(sizeof(struct mpeg_video_format) == offsetof(struct mpeg_video_format, sequence_header[0]));
51 struct wg_media_type
53 GUID major;
54 UINT32 format_size;
55 union
57 void *format;
58 WAVEFORMATEX *audio;
59 MFVIDEOFORMAT *video;
60 } u;
63 typedef UINT32 wg_major_type;
64 enum wg_major_type
66 WG_MAJOR_TYPE_UNKNOWN = 0,
67 WG_MAJOR_TYPE_AUDIO,
68 WG_MAJOR_TYPE_AUDIO_MPEG1,
69 WG_MAJOR_TYPE_AUDIO_MPEG4,
70 WG_MAJOR_TYPE_AUDIO_WMA,
71 WG_MAJOR_TYPE_VIDEO,
72 WG_MAJOR_TYPE_VIDEO_CINEPAK,
73 WG_MAJOR_TYPE_VIDEO_H264,
74 WG_MAJOR_TYPE_VIDEO_WMV,
75 WG_MAJOR_TYPE_VIDEO_INDEO,
76 WG_MAJOR_TYPE_VIDEO_MPEG1,
79 typedef UINT32 wg_audio_format;
80 enum wg_audio_format
82 WG_AUDIO_FORMAT_UNKNOWN,
84 WG_AUDIO_FORMAT_U8,
85 WG_AUDIO_FORMAT_S16LE,
86 WG_AUDIO_FORMAT_S24LE,
87 WG_AUDIO_FORMAT_S32LE,
88 WG_AUDIO_FORMAT_F32LE,
89 WG_AUDIO_FORMAT_F64LE,
92 typedef UINT32 wg_video_format;
93 enum wg_video_format
95 WG_VIDEO_FORMAT_UNKNOWN,
97 WG_VIDEO_FORMAT_BGRA,
98 WG_VIDEO_FORMAT_BGRx,
99 WG_VIDEO_FORMAT_BGR,
100 WG_VIDEO_FORMAT_RGB15,
101 WG_VIDEO_FORMAT_RGB16,
102 WG_VIDEO_FORMAT_RGBA,
104 WG_VIDEO_FORMAT_AYUV,
105 WG_VIDEO_FORMAT_I420,
106 WG_VIDEO_FORMAT_NV12,
107 WG_VIDEO_FORMAT_UYVY,
108 WG_VIDEO_FORMAT_YUY2,
109 WG_VIDEO_FORMAT_YV12,
110 WG_VIDEO_FORMAT_YVYU,
112 WG_VIDEO_FORMAT_WMV1,
113 WG_VIDEO_FORMAT_WMV2,
114 WG_VIDEO_FORMAT_WMV3,
115 WG_VIDEO_FORMAT_WMVA,
116 WG_VIDEO_FORMAT_WVC1,
119 struct wg_format
121 wg_major_type major_type;
123 union
125 /* Valid members for different audio formats:
127 * Uncompressed(PCM): channels, channel_mask, rate.
128 * MPEG1: channels, rate, layer.
129 * MPEG4: payload_type, codec_data_len, codec_data.
130 * WMA: channels, rate, bitrate, depth, block_align, version, layer,
131 * payload_type, codec_data_len, codec_data */
132 struct
134 wg_audio_format format;
136 uint32_t channels;
137 uint32_t channel_mask; /* In WinMM format. */
138 uint32_t rate;
139 uint32_t bitrate;
140 uint32_t depth;
141 uint32_t block_align;
142 uint32_t version;
143 uint32_t layer;
144 uint32_t payload_type;
145 uint32_t codec_data_len;
146 unsigned char codec_data[64];
147 } audio;
149 /* Valid members for different video formats:
151 * Uncompressed(RGB and YUV): width, height, fps_n, fps_d, padding.
152 * CINEPAK: width, height, fps_n, fps_d.
153 * H264: width, height, fps_n, fps_d, profile, level, codec_data_len, codec_data.
154 * WMV: width, height, fps_n, fps_d, codec_data_len, codec_data.
155 * INDEO: width, height, fps_n, fps_d, version.
156 * MPEG1: width, height, fps_n, fps_d. */
157 struct
159 wg_video_format format;
161 /* Positive height indicates top-down video; negative height
162 * indicates bottom-up video. */
163 int32_t width, height;
164 uint32_t fps_n, fps_d;
165 RECT padding;
166 uint32_t profile;
167 uint32_t level;
168 uint32_t version;
169 uint32_t codec_data_len;
170 unsigned char codec_data[64];
171 } video;
172 } u;
175 enum wg_sample_flag
177 WG_SAMPLE_FLAG_INCOMPLETE = 1,
178 WG_SAMPLE_FLAG_HAS_PTS = 2,
179 WG_SAMPLE_FLAG_HAS_DURATION = 4,
180 WG_SAMPLE_FLAG_SYNC_POINT = 8,
181 WG_SAMPLE_FLAG_DISCONTINUITY = 0x10,
184 struct wg_sample
186 /* timestamp and duration are in 100-nanosecond units. */
187 UINT64 pts;
188 UINT64 duration;
189 LONG refcount; /* unix refcount */
190 UINT32 flags;
191 UINT32 max_size;
192 UINT32 size;
193 UINT64 data; /* pointer to user memory */
196 struct wg_parser_buffer
198 /* pts and duration are in 100-nanosecond units. */
199 UINT64 pts, duration;
200 UINT32 size;
201 UINT32 stream;
202 UINT8 discontinuity, preroll, delta, has_pts, has_duration;
204 C_ASSERT(sizeof(struct wg_parser_buffer) == 32);
206 typedef UINT64 wg_parser_t;
207 typedef UINT64 wg_parser_stream_t;
208 typedef UINT64 wg_transform_t;
209 typedef UINT64 wg_muxer_t;
211 struct wg_init_gstreamer_params
213 UINT8 trace_on;
214 UINT8 warn_on;
215 UINT8 err_on;
218 struct wg_parser_create_params
220 wg_parser_t parser;
221 UINT8 output_compressed;
222 UINT8 err_on;
223 UINT8 warn_on;
226 struct wg_parser_connect_params
228 wg_parser_t parser;
229 const WCHAR *uri;
230 UINT64 file_size;
233 struct wg_parser_get_next_read_offset_params
235 wg_parser_t parser;
236 UINT32 size;
237 UINT64 offset;
240 struct wg_parser_push_data_params
242 wg_parser_t parser;
243 const void *data;
244 UINT32 size;
247 struct wg_parser_get_stream_count_params
249 wg_parser_t parser;
250 UINT32 count;
253 struct wg_parser_get_stream_params
255 wg_parser_t parser;
256 UINT32 index;
257 wg_parser_stream_t stream;
260 struct wg_parser_stream_get_current_format_params
262 wg_parser_stream_t stream;
263 struct wg_format *format;
266 struct wg_parser_stream_get_codec_format_params
268 wg_parser_stream_t stream;
269 struct wg_format *format;
272 struct wg_parser_stream_enable_params
274 wg_parser_stream_t stream;
275 const struct wg_format *format;
278 struct wg_parser_stream_get_buffer_params
280 wg_parser_t parser;
281 wg_parser_stream_t stream;
282 struct wg_parser_buffer *buffer;
285 struct wg_parser_stream_copy_buffer_params
287 wg_parser_stream_t stream;
288 void *data;
289 UINT32 offset;
290 UINT32 size;
293 struct wg_parser_stream_notify_qos_params
295 wg_parser_stream_t stream;
296 UINT8 underflow;
297 DOUBLE proportion;
298 INT64 diff;
299 UINT64 timestamp;
302 struct wg_parser_stream_get_duration_params
304 wg_parser_stream_t stream;
305 UINT64 duration;
308 typedef UINT64 wg_parser_tag;
309 enum wg_parser_tag
311 WG_PARSER_TAG_LANGUAGE,
312 WG_PARSER_TAG_NAME,
313 WG_PARSER_TAG_COUNT
316 struct wg_parser_stream_get_tag_params
318 wg_parser_stream_t stream;
319 wg_parser_tag tag;
320 char *buffer;
321 UINT32 *size;
324 struct wg_parser_stream_seek_params
326 wg_parser_stream_t stream;
327 DOUBLE rate;
328 UINT64 start_pos, stop_pos;
329 DWORD start_flags, stop_flags;
332 struct wg_transform_attrs
334 UINT32 output_plane_align;
335 UINT32 input_queue_length;
336 BOOL allow_format_change;
337 BOOL low_latency;
340 struct wg_transform_create_params
342 wg_transform_t transform;
343 struct wg_media_type input_type;
344 struct wg_media_type output_type;
345 struct wg_transform_attrs attrs;
348 struct wg_transform_push_data_params
350 wg_transform_t transform;
351 struct wg_sample *sample;
352 HRESULT result;
355 struct wg_transform_read_data_params
357 wg_transform_t transform;
358 struct wg_sample *sample;
359 HRESULT result;
362 struct wg_transform_get_output_type_params
364 wg_transform_t transform;
365 struct wg_media_type media_type;
368 struct wg_transform_set_output_type_params
370 wg_transform_t transform;
371 struct wg_media_type media_type;
374 struct wg_transform_get_status_params
376 wg_transform_t transform;
377 UINT32 accepts_input;
380 struct wg_transform_notify_qos_params
382 wg_transform_t transform;
383 UINT8 underflow;
384 DOUBLE proportion;
385 INT64 diff;
386 UINT64 timestamp;
389 struct wg_muxer_create_params
391 wg_muxer_t muxer;
392 const char *format;
395 struct wg_muxer_add_stream_params
397 wg_muxer_t muxer;
398 UINT32 stream_id;
399 const struct wg_format *format;
402 struct wg_muxer_push_sample_params
404 wg_muxer_t muxer;
405 struct wg_sample *sample;
406 UINT32 stream_id;
409 struct wg_muxer_read_data_params
411 wg_muxer_t muxer;
412 void *buffer;
413 UINT32 size;
414 UINT64 offset;
417 enum unix_funcs
419 unix_wg_init_gstreamer,
421 unix_wg_parser_create,
422 unix_wg_parser_destroy,
424 unix_wg_parser_connect,
425 unix_wg_parser_disconnect,
427 unix_wg_parser_get_next_read_offset,
428 unix_wg_parser_push_data,
430 unix_wg_parser_get_stream_count,
431 unix_wg_parser_get_stream,
433 unix_wg_parser_stream_get_current_format,
434 unix_wg_parser_stream_get_codec_format,
435 unix_wg_parser_stream_enable,
436 unix_wg_parser_stream_disable,
438 unix_wg_parser_stream_get_buffer,
439 unix_wg_parser_stream_copy_buffer,
440 unix_wg_parser_stream_release_buffer,
441 unix_wg_parser_stream_notify_qos,
443 unix_wg_parser_stream_get_duration,
444 unix_wg_parser_stream_get_tag,
445 unix_wg_parser_stream_seek,
447 unix_wg_transform_create,
448 unix_wg_transform_destroy,
449 unix_wg_transform_get_output_type,
450 unix_wg_transform_set_output_type,
452 unix_wg_transform_push_data,
453 unix_wg_transform_read_data,
454 unix_wg_transform_get_status,
455 unix_wg_transform_drain,
456 unix_wg_transform_flush,
457 unix_wg_transform_notify_qos,
459 unix_wg_muxer_create,
460 unix_wg_muxer_destroy,
461 unix_wg_muxer_add_stream,
462 unix_wg_muxer_start,
463 unix_wg_muxer_push_sample,
464 unix_wg_muxer_read_data,
465 unix_wg_muxer_finalize,
467 unix_wg_funcs_count,
470 #endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */