dmime: Remove DECLSPEC_HIDDEN usage.
[wine.git] / dlls / winegstreamer / unixlib.h
bloba9892bf9d4f024c459725dbb60d8a6c8063e6609
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 <stdbool.h>
25 #include <stdint.h>
26 #include "windef.h"
27 #include "winternl.h"
28 #include "wtypes.h"
29 #include "mmreg.h"
31 #include "wine/unixlib.h"
33 struct wg_format
35 enum wg_major_type
37 WG_MAJOR_TYPE_UNKNOWN = 0,
38 WG_MAJOR_TYPE_AUDIO,
39 WG_MAJOR_TYPE_AUDIO_MPEG1,
40 WG_MAJOR_TYPE_AUDIO_MPEG4,
41 WG_MAJOR_TYPE_AUDIO_WMA,
42 WG_MAJOR_TYPE_VIDEO,
43 WG_MAJOR_TYPE_VIDEO_CINEPAK,
44 WG_MAJOR_TYPE_VIDEO_H264,
45 WG_MAJOR_TYPE_VIDEO_WMV,
46 WG_MAJOR_TYPE_VIDEO_INDEO,
47 } major_type;
49 union
51 struct
53 enum wg_audio_format
55 WG_AUDIO_FORMAT_UNKNOWN,
57 WG_AUDIO_FORMAT_U8,
58 WG_AUDIO_FORMAT_S16LE,
59 WG_AUDIO_FORMAT_S24LE,
60 WG_AUDIO_FORMAT_S32LE,
61 WG_AUDIO_FORMAT_F32LE,
62 WG_AUDIO_FORMAT_F64LE,
63 } format;
65 uint32_t channels;
66 uint32_t channel_mask; /* In WinMM format. */
67 uint32_t rate;
68 } audio;
69 struct
71 uint32_t layer;
72 uint32_t rate;
73 uint32_t channels;
74 } audio_mpeg1;
75 struct
77 uint32_t payload_type;
78 uint32_t codec_data_len;
79 unsigned char codec_data[64];
80 } audio_mpeg4;
81 struct
83 uint32_t version;
84 uint32_t bitrate;
85 uint32_t rate;
86 uint32_t depth;
87 uint32_t channels;
88 uint32_t block_align;
89 uint32_t codec_data_len;
90 unsigned char codec_data[64];
91 } audio_wma;
93 struct
95 enum wg_video_format
97 WG_VIDEO_FORMAT_UNKNOWN,
99 WG_VIDEO_FORMAT_BGRA,
100 WG_VIDEO_FORMAT_BGRx,
101 WG_VIDEO_FORMAT_BGR,
102 WG_VIDEO_FORMAT_RGB15,
103 WG_VIDEO_FORMAT_RGB16,
105 WG_VIDEO_FORMAT_AYUV,
106 WG_VIDEO_FORMAT_I420,
107 WG_VIDEO_FORMAT_NV12,
108 WG_VIDEO_FORMAT_UYVY,
109 WG_VIDEO_FORMAT_YUY2,
110 WG_VIDEO_FORMAT_YV12,
111 WG_VIDEO_FORMAT_YVYU,
112 } format;
113 /* Positive height indicates top-down video; negative height
114 * indicates bottom-up video. */
115 int32_t width, height;
116 uint32_t fps_n, fps_d;
117 RECT padding;
118 } video;
119 struct
121 uint32_t width;
122 uint32_t height;
123 uint32_t fps_n;
124 uint32_t fps_d;
125 } video_cinepak;
126 struct
128 int32_t width, height;
129 uint32_t fps_n, fps_d;
130 uint32_t profile;
131 uint32_t level;
132 } video_h264;
133 struct
135 enum wg_wmv_video_format
137 WG_WMV_VIDEO_FORMAT_UNKNOWN,
138 WG_WMV_VIDEO_FORMAT_WMV1,
139 WG_WMV_VIDEO_FORMAT_WMV2,
140 WG_WMV_VIDEO_FORMAT_WMV3,
141 WG_WMV_VIDEO_FORMAT_WMVA,
142 WG_WMV_VIDEO_FORMAT_WVC1,
143 } format;
144 int32_t width, height;
145 uint32_t fps_n, fps_d;
146 } video_wmv;
147 struct
149 int32_t width, height;
150 uint32_t fps_n, fps_d;
151 uint32_t version;
152 } video_indeo;
153 } u;
156 enum wg_sample_flag
158 WG_SAMPLE_FLAG_INCOMPLETE = 1,
159 WG_SAMPLE_FLAG_HAS_PTS = 2,
160 WG_SAMPLE_FLAG_HAS_DURATION = 4,
161 WG_SAMPLE_FLAG_SYNC_POINT = 8,
162 WG_SAMPLE_FLAG_DISCONTINUITY = 0x10,
165 struct wg_sample
167 /* timestamp and duration are in 100-nanosecond units. */
168 UINT64 pts;
169 UINT64 duration;
170 LONG refcount; /* unix refcount */
171 UINT32 flags;
172 UINT32 max_size;
173 UINT32 size;
174 BYTE *data;
177 struct wg_parser_buffer
179 /* pts and duration are in 100-nanosecond units. */
180 UINT64 pts, duration;
181 UINT32 size;
182 UINT32 stream;
183 bool discontinuity, preroll, delta, has_pts, has_duration;
185 C_ASSERT(sizeof(struct wg_parser_buffer) == 32);
187 enum wg_parser_type
189 WG_PARSER_DECODEBIN,
190 WG_PARSER_AVIDEMUX,
191 WG_PARSER_MPEGAUDIOPARSE,
192 WG_PARSER_WAVPARSE,
195 struct wg_parser_create_params
197 struct wg_parser *parser;
198 enum wg_parser_type type;
199 bool unlimited_buffering;
200 bool err_on;
201 bool warn_on;
204 struct wg_parser_connect_params
206 struct wg_parser *parser;
207 UINT64 file_size;
210 struct wg_parser_get_next_read_offset_params
212 struct wg_parser *parser;
213 UINT32 size;
214 UINT64 offset;
217 struct wg_parser_push_data_params
219 struct wg_parser *parser;
220 const void *data;
221 UINT32 size;
224 struct wg_parser_get_stream_count_params
226 struct wg_parser *parser;
227 UINT32 count;
230 struct wg_parser_get_stream_params
232 struct wg_parser *parser;
233 UINT32 index;
234 struct wg_parser_stream *stream;
237 struct wg_parser_stream_get_preferred_format_params
239 struct wg_parser_stream *stream;
240 struct wg_format *format;
243 struct wg_parser_stream_get_codec_format_params
245 struct wg_parser_stream *stream;
246 struct wg_format *format;
249 struct wg_parser_stream_enable_params
251 struct wg_parser_stream *stream;
252 const struct wg_format *format;
255 struct wg_parser_stream_get_buffer_params
257 struct wg_parser *parser;
258 struct wg_parser_stream *stream;
259 struct wg_parser_buffer *buffer;
262 struct wg_parser_stream_copy_buffer_params
264 struct wg_parser_stream *stream;
265 void *data;
266 UINT32 offset;
267 UINT32 size;
270 struct wg_parser_stream_notify_qos_params
272 struct wg_parser_stream *stream;
273 bool underflow;
274 DOUBLE proportion;
275 INT64 diff;
276 UINT64 timestamp;
279 struct wg_parser_stream_get_duration_params
281 struct wg_parser_stream *stream;
282 UINT64 duration;
285 enum wg_parser_tag
287 WG_PARSER_TAG_LANGUAGE,
288 WG_PARSER_TAG_NAME,
289 WG_PARSER_TAG_COUNT
292 struct wg_parser_stream_get_tag_params
294 struct wg_parser_stream *stream;
295 enum wg_parser_tag tag;
296 char *buffer;
297 UINT32 *size;
300 struct wg_parser_stream_seek_params
302 struct wg_parser_stream *stream;
303 DOUBLE rate;
304 UINT64 start_pos, stop_pos;
305 DWORD start_flags, stop_flags;
308 struct wg_transform_attrs
310 UINT32 output_plane_align;
311 UINT32 input_queue_length;
312 BOOL low_latency;
315 struct wg_transform_create_params
317 struct wg_transform *transform;
318 const struct wg_format *input_format;
319 const struct wg_format *output_format;
320 const struct wg_transform_attrs *attrs;
323 struct wg_transform_push_data_params
325 struct wg_transform *transform;
326 struct wg_sample *sample;
327 HRESULT result;
330 struct wg_transform_read_data_params
332 struct wg_transform *transform;
333 struct wg_sample *sample;
334 struct wg_format *format;
335 HRESULT result;
338 struct wg_transform_set_output_format_params
340 struct wg_transform *transform;
341 const struct wg_format *format;
344 struct wg_transform_get_status_params
346 struct wg_transform *transform;
347 UINT32 accepts_input;
350 enum unix_funcs
352 unix_wg_init_gstreamer,
354 unix_wg_parser_create,
355 unix_wg_parser_destroy,
357 unix_wg_parser_connect,
358 unix_wg_parser_disconnect,
360 unix_wg_parser_get_next_read_offset,
361 unix_wg_parser_push_data,
363 unix_wg_parser_get_stream_count,
364 unix_wg_parser_get_stream,
366 unix_wg_parser_stream_get_preferred_format,
367 unix_wg_parser_stream_get_codec_format,
368 unix_wg_parser_stream_enable,
369 unix_wg_parser_stream_disable,
371 unix_wg_parser_stream_get_buffer,
372 unix_wg_parser_stream_copy_buffer,
373 unix_wg_parser_stream_release_buffer,
374 unix_wg_parser_stream_notify_qos,
376 unix_wg_parser_stream_get_duration,
377 unix_wg_parser_stream_get_tag,
378 unix_wg_parser_stream_seek,
380 unix_wg_transform_create,
381 unix_wg_transform_destroy,
382 unix_wg_transform_set_output_format,
384 unix_wg_transform_push_data,
385 unix_wg_transform_read_data,
386 unix_wg_transform_get_status,
387 unix_wg_transform_drain,
388 unix_wg_transform_flush,
391 #endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */