d3dx9: Unify calling parse_mesh helper functions.
[wine.git] / dlls / winegstreamer / unixlib.h
blob7a2a4a8da2fe3aa75d5eb2e1b8e647294c0c0f9e
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"
30 #include "wine/unixlib.h"
32 typedef UINT32 wg_major_type;
33 enum wg_major_type
35 WG_MAJOR_TYPE_UNKNOWN = 0,
36 WG_MAJOR_TYPE_AUDIO,
37 WG_MAJOR_TYPE_AUDIO_MPEG1,
38 WG_MAJOR_TYPE_AUDIO_MPEG4,
39 WG_MAJOR_TYPE_AUDIO_WMA,
40 WG_MAJOR_TYPE_VIDEO,
41 WG_MAJOR_TYPE_VIDEO_CINEPAK,
42 WG_MAJOR_TYPE_VIDEO_H264,
43 WG_MAJOR_TYPE_VIDEO_WMV,
44 WG_MAJOR_TYPE_VIDEO_INDEO,
45 WG_MAJOR_TYPE_VIDEO_MPEG1,
48 typedef UINT32 wg_audio_format;
49 enum wg_audio_format
51 WG_AUDIO_FORMAT_UNKNOWN,
53 WG_AUDIO_FORMAT_U8,
54 WG_AUDIO_FORMAT_S16LE,
55 WG_AUDIO_FORMAT_S24LE,
56 WG_AUDIO_FORMAT_S32LE,
57 WG_AUDIO_FORMAT_F32LE,
58 WG_AUDIO_FORMAT_F64LE,
61 typedef UINT32 wg_video_format;
62 enum wg_video_format
64 WG_VIDEO_FORMAT_UNKNOWN,
66 WG_VIDEO_FORMAT_BGRA,
67 WG_VIDEO_FORMAT_BGRx,
68 WG_VIDEO_FORMAT_BGR,
69 WG_VIDEO_FORMAT_RGB15,
70 WG_VIDEO_FORMAT_RGB16,
72 WG_VIDEO_FORMAT_AYUV,
73 WG_VIDEO_FORMAT_I420,
74 WG_VIDEO_FORMAT_NV12,
75 WG_VIDEO_FORMAT_UYVY,
76 WG_VIDEO_FORMAT_YUY2,
77 WG_VIDEO_FORMAT_YV12,
78 WG_VIDEO_FORMAT_YVYU,
81 typedef UINT32 wg_wmv_video_format;
82 enum wg_wmv_video_format
84 WG_WMV_VIDEO_FORMAT_UNKNOWN,
85 WG_WMV_VIDEO_FORMAT_WMV1,
86 WG_WMV_VIDEO_FORMAT_WMV2,
87 WG_WMV_VIDEO_FORMAT_WMV3,
88 WG_WMV_VIDEO_FORMAT_WMVA,
89 WG_WMV_VIDEO_FORMAT_WVC1,
92 struct wg_format
94 wg_major_type major_type;
96 union
98 struct
100 wg_audio_format format;
102 uint32_t channels;
103 uint32_t channel_mask; /* In WinMM format. */
104 uint32_t rate;
105 } audio;
106 struct
108 uint32_t layer;
109 uint32_t rate;
110 uint32_t channels;
111 } audio_mpeg1;
112 struct
114 uint32_t payload_type;
115 uint32_t codec_data_len;
116 unsigned char codec_data[64];
117 } audio_mpeg4;
118 struct
120 uint32_t version;
121 uint32_t bitrate;
122 uint32_t rate;
123 uint32_t depth;
124 uint32_t channels;
125 uint32_t block_align;
126 uint32_t codec_data_len;
127 unsigned char codec_data[64];
128 } audio_wma;
130 struct
132 wg_video_format format;
133 /* Positive height indicates top-down video; negative height
134 * indicates bottom-up video. */
135 int32_t width, height;
136 uint32_t fps_n, fps_d;
137 RECT padding;
138 } video;
139 struct
141 uint32_t width;
142 uint32_t height;
143 uint32_t fps_n;
144 uint32_t fps_d;
145 } video_cinepak;
146 struct
148 int32_t width, height;
149 uint32_t fps_n, fps_d;
150 uint32_t profile;
151 uint32_t level;
152 uint32_t codec_data_len;
153 unsigned char codec_data[64];
154 } video_h264;
155 struct
157 wg_wmv_video_format format;
158 int32_t width, height;
159 uint32_t fps_n, fps_d;
160 } video_wmv;
161 struct
163 int32_t width, height;
164 uint32_t fps_n, fps_d;
165 uint32_t version;
166 } video_indeo;
167 struct
169 int32_t width, height;
170 uint32_t fps_n, fps_d;
171 } video_mpeg1;
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 UINT32 wg_parser_type;
207 enum wg_parser_type
209 WG_PARSER_DECODEBIN,
210 WG_PARSER_AVIDEMUX,
211 WG_PARSER_WAVPARSE,
214 typedef UINT64 wg_parser_t;
215 typedef UINT64 wg_parser_stream_t;
216 typedef UINT64 wg_transform_t;
217 typedef UINT64 wg_muxer_t;
219 struct wg_parser_create_params
221 wg_parser_t parser;
222 wg_parser_type type;
223 UINT8 output_compressed;
224 UINT8 err_on;
225 UINT8 warn_on;
228 struct wg_parser_connect_params
230 wg_parser_t parser;
231 UINT64 file_size;
234 struct wg_parser_get_next_read_offset_params
236 wg_parser_t parser;
237 UINT32 size;
238 UINT64 offset;
241 struct wg_parser_push_data_params
243 wg_parser_t parser;
244 const void *data;
245 UINT32 size;
248 struct wg_parser_get_stream_count_params
250 wg_parser_t parser;
251 UINT32 count;
254 struct wg_parser_get_stream_params
256 wg_parser_t parser;
257 UINT32 index;
258 wg_parser_stream_t stream;
261 struct wg_parser_stream_get_preferred_format_params
263 wg_parser_stream_t stream;
264 struct wg_format *format;
267 struct wg_parser_stream_get_codec_format_params
269 wg_parser_stream_t stream;
270 struct wg_format *format;
273 struct wg_parser_stream_enable_params
275 wg_parser_stream_t stream;
276 const struct wg_format *format;
279 struct wg_parser_stream_get_buffer_params
281 wg_parser_t parser;
282 wg_parser_stream_t stream;
283 struct wg_parser_buffer *buffer;
286 struct wg_parser_stream_copy_buffer_params
288 wg_parser_stream_t stream;
289 void *data;
290 UINT32 offset;
291 UINT32 size;
294 struct wg_parser_stream_notify_qos_params
296 wg_parser_stream_t stream;
297 UINT8 underflow;
298 DOUBLE proportion;
299 INT64 diff;
300 UINT64 timestamp;
303 struct wg_parser_stream_get_duration_params
305 wg_parser_stream_t stream;
306 UINT64 duration;
309 typedef UINT64 wg_parser_tag;
310 enum wg_parser_tag
312 WG_PARSER_TAG_LANGUAGE,
313 WG_PARSER_TAG_NAME,
314 WG_PARSER_TAG_COUNT
317 struct wg_parser_stream_get_tag_params
319 wg_parser_stream_t stream;
320 wg_parser_tag tag;
321 char *buffer;
322 UINT32 *size;
325 struct wg_parser_stream_seek_params
327 wg_parser_stream_t stream;
328 DOUBLE rate;
329 UINT64 start_pos, stop_pos;
330 DWORD start_flags, stop_flags;
333 struct wg_transform_attrs
335 UINT32 output_plane_align;
336 UINT32 input_queue_length;
337 BOOL low_latency;
340 struct wg_transform_create_params
342 wg_transform_t transform;
343 const struct wg_format *input_format;
344 const struct wg_format *output_format;
345 const 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 struct wg_format *format;
360 HRESULT result;
363 struct wg_transform_set_output_format_params
365 wg_transform_t transform;
366 const struct wg_format *format;
369 struct wg_transform_get_status_params
371 wg_transform_t transform;
372 UINT32 accepts_input;
375 struct wg_muxer_create_params
377 wg_muxer_t muxer;
378 const char *format;
381 struct wg_muxer_add_stream_params
383 wg_muxer_t muxer;
384 UINT32 stream_id;
385 const struct wg_format *format;
388 struct wg_muxer_push_sample_params
390 wg_muxer_t muxer;
391 struct wg_sample *sample;
392 UINT32 stream_id;
395 struct wg_muxer_read_data_params
397 wg_muxer_t muxer;
398 void *buffer;
399 UINT32 size;
400 UINT64 offset;
403 enum unix_funcs
405 unix_wg_init_gstreamer,
407 unix_wg_parser_create,
408 unix_wg_parser_destroy,
410 unix_wg_parser_connect,
411 unix_wg_parser_disconnect,
413 unix_wg_parser_get_next_read_offset,
414 unix_wg_parser_push_data,
416 unix_wg_parser_get_stream_count,
417 unix_wg_parser_get_stream,
419 unix_wg_parser_stream_get_preferred_format,
420 unix_wg_parser_stream_get_codec_format,
421 unix_wg_parser_stream_enable,
422 unix_wg_parser_stream_disable,
424 unix_wg_parser_stream_get_buffer,
425 unix_wg_parser_stream_copy_buffer,
426 unix_wg_parser_stream_release_buffer,
427 unix_wg_parser_stream_notify_qos,
429 unix_wg_parser_stream_get_duration,
430 unix_wg_parser_stream_get_tag,
431 unix_wg_parser_stream_seek,
433 unix_wg_transform_create,
434 unix_wg_transform_destroy,
435 unix_wg_transform_set_output_format,
437 unix_wg_transform_push_data,
438 unix_wg_transform_read_data,
439 unix_wg_transform_get_status,
440 unix_wg_transform_drain,
441 unix_wg_transform_flush,
443 unix_wg_muxer_create,
444 unix_wg_muxer_destroy,
445 unix_wg_muxer_add_stream,
446 unix_wg_muxer_start,
447 unix_wg_muxer_push_sample,
448 unix_wg_muxer_read_data,
450 unix_wg_funcs_count,
453 #endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */