winegstreamer: Pass desired output plane alignment to wg_transform_create.
[wine.git] / dlls / winegstreamer / unixlib.h
blob15b5dcff352bd4ef133c9133dce5f18064943ad6
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;
313 struct wg_transform_create_params
315 struct wg_transform *transform;
316 const struct wg_format *input_format;
317 const struct wg_format *output_format;
318 const struct wg_transform_attrs *attrs;
321 struct wg_transform_push_data_params
323 struct wg_transform *transform;
324 struct wg_sample *sample;
325 HRESULT result;
328 struct wg_transform_read_data_params
330 struct wg_transform *transform;
331 struct wg_sample *sample;
332 struct wg_format *format;
333 HRESULT result;
336 struct wg_transform_set_output_format_params
338 struct wg_transform *transform;
339 const struct wg_format *format;
342 struct wg_transform_get_status_params
344 struct wg_transform *transform;
345 UINT32 accepts_input;
348 enum unix_funcs
350 unix_wg_init_gstreamer,
352 unix_wg_parser_create,
353 unix_wg_parser_destroy,
355 unix_wg_parser_connect,
356 unix_wg_parser_disconnect,
358 unix_wg_parser_get_next_read_offset,
359 unix_wg_parser_push_data,
361 unix_wg_parser_get_stream_count,
362 unix_wg_parser_get_stream,
364 unix_wg_parser_stream_get_preferred_format,
365 unix_wg_parser_stream_get_codec_format,
366 unix_wg_parser_stream_enable,
367 unix_wg_parser_stream_disable,
369 unix_wg_parser_stream_get_buffer,
370 unix_wg_parser_stream_copy_buffer,
371 unix_wg_parser_stream_release_buffer,
372 unix_wg_parser_stream_notify_qos,
374 unix_wg_parser_stream_get_duration,
375 unix_wg_parser_stream_get_tag,
376 unix_wg_parser_stream_seek,
378 unix_wg_transform_create,
379 unix_wg_transform_destroy,
380 unix_wg_transform_set_output_format,
382 unix_wg_transform_push_data,
383 unix_wg_transform_read_data,
384 unix_wg_transform_get_status,
385 unix_wg_transform_drain,
386 unix_wg_transform_flush,
389 #endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */