l3codeca.acm: Avoid mpg123 functions with suffix.
[wine.git] / dlls / winegstreamer / unixlib.h
blob5911278530dc5c6308637512f3e14e0878e0c28c
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,
38 WG_MAJOR_TYPE_VIDEO,
39 WG_MAJOR_TYPE_AUDIO,
40 WG_MAJOR_TYPE_MPEG1_AUDIO,
41 WG_MAJOR_TYPE_WMA,
42 WG_MAJOR_TYPE_H264,
43 } major_type;
45 union
47 struct
49 enum wg_video_format
51 WG_VIDEO_FORMAT_UNKNOWN,
53 WG_VIDEO_FORMAT_BGRA,
54 WG_VIDEO_FORMAT_BGRx,
55 WG_VIDEO_FORMAT_BGR,
56 WG_VIDEO_FORMAT_RGB15,
57 WG_VIDEO_FORMAT_RGB16,
59 WG_VIDEO_FORMAT_AYUV,
60 WG_VIDEO_FORMAT_I420,
61 WG_VIDEO_FORMAT_NV12,
62 WG_VIDEO_FORMAT_UYVY,
63 WG_VIDEO_FORMAT_YUY2,
64 WG_VIDEO_FORMAT_YV12,
65 WG_VIDEO_FORMAT_YVYU,
67 WG_VIDEO_FORMAT_CINEPAK,
68 } format;
69 int32_t width, height;
70 uint32_t fps_n, fps_d;
71 } video;
72 struct
74 enum wg_audio_format
76 WG_AUDIO_FORMAT_UNKNOWN,
78 WG_AUDIO_FORMAT_U8,
79 WG_AUDIO_FORMAT_S16LE,
80 WG_AUDIO_FORMAT_S24LE,
81 WG_AUDIO_FORMAT_S32LE,
82 WG_AUDIO_FORMAT_F32LE,
83 WG_AUDIO_FORMAT_F64LE,
84 } format;
86 uint32_t channels;
87 uint32_t channel_mask; /* In WinMM format. */
88 uint32_t rate;
89 } audio;
90 struct
92 uint32_t layer;
93 uint32_t rate;
94 uint32_t channels;
95 } mpeg1_audio;
96 struct
98 uint32_t version;
99 uint32_t bitrate;
100 uint32_t rate;
101 uint32_t depth;
102 uint32_t channels;
103 uint32_t block_align;
104 uint32_t codec_data_len;
105 unsigned char codec_data[64];
106 } wma;
107 struct
109 int32_t width, height;
110 uint32_t fps_n, fps_d;
111 uint32_t profile;
112 uint32_t level;
113 } h264;
114 } u;
117 enum wg_sample_flag
119 WG_SAMPLE_FLAG_INCOMPLETE = 1,
120 WG_SAMPLE_FLAG_HAS_PTS = 2,
121 WG_SAMPLE_FLAG_HAS_DURATION = 4,
122 WG_SAMPLE_FLAG_SYNC_POINT = 8,
125 struct wg_sample
127 /* timestamp and duration are in 100-nanosecond units. */
128 UINT64 pts;
129 UINT64 duration;
130 UINT32 flags;
131 UINT32 max_size;
132 UINT32 size;
133 BYTE *data;
136 struct wg_parser_buffer
138 /* pts and duration are in 100-nanosecond units. */
139 UINT64 pts, duration;
140 UINT32 size;
141 bool discontinuity, preroll, delta, has_pts, has_duration;
143 C_ASSERT(sizeof(struct wg_parser_buffer) == 32);
145 enum wg_parser_type
147 WG_PARSER_DECODEBIN,
148 WG_PARSER_AVIDEMUX,
149 WG_PARSER_MPEGAUDIOPARSE,
150 WG_PARSER_WAVPARSE,
153 struct wg_parser_create_params
155 struct wg_parser *parser;
156 enum wg_parser_type type;
157 bool unlimited_buffering;
160 struct wg_parser_connect_params
162 struct wg_parser *parser;
163 UINT64 file_size;
166 struct wg_parser_get_next_read_offset_params
168 struct wg_parser *parser;
169 UINT32 size;
170 UINT64 offset;
173 struct wg_parser_push_data_params
175 struct wg_parser *parser;
176 const void *data;
177 UINT32 size;
180 struct wg_parser_get_stream_count_params
182 struct wg_parser *parser;
183 UINT32 count;
186 struct wg_parser_get_stream_params
188 struct wg_parser *parser;
189 UINT32 index;
190 struct wg_parser_stream *stream;
193 struct wg_parser_stream_get_preferred_format_params
195 struct wg_parser_stream *stream;
196 struct wg_format *format;
199 struct wg_parser_stream_enable_params
201 struct wg_parser_stream *stream;
202 const struct wg_format *format;
205 struct wg_parser_stream_get_buffer_params
207 struct wg_parser_stream *stream;
208 struct wg_parser_buffer *buffer;
211 struct wg_parser_stream_copy_buffer_params
213 struct wg_parser_stream *stream;
214 void *data;
215 UINT32 offset;
216 UINT32 size;
219 struct wg_parser_stream_notify_qos_params
221 struct wg_parser_stream *stream;
222 bool underflow;
223 DOUBLE proportion;
224 INT64 diff;
225 UINT64 timestamp;
228 struct wg_parser_stream_get_duration_params
230 struct wg_parser_stream *stream;
231 UINT64 duration;
234 struct wg_parser_stream_seek_params
236 struct wg_parser_stream *stream;
237 DOUBLE rate;
238 UINT64 start_pos, stop_pos;
239 DWORD start_flags, stop_flags;
242 struct wg_transform_create_params
244 struct wg_transform *transform;
245 const struct wg_format *input_format;
246 const struct wg_format *output_format;
249 struct wg_transform_push_data_params
251 struct wg_transform *transform;
252 struct wg_sample *sample;
253 HRESULT result;
256 struct wg_transform_read_data_params
258 struct wg_transform *transform;
259 struct wg_sample *sample;
260 HRESULT result;
263 enum unix_funcs
265 unix_wg_parser_create,
266 unix_wg_parser_destroy,
268 unix_wg_parser_connect,
269 unix_wg_parser_disconnect,
271 unix_wg_parser_get_next_read_offset,
272 unix_wg_parser_push_data,
274 unix_wg_parser_get_stream_count,
275 unix_wg_parser_get_stream,
277 unix_wg_parser_stream_get_preferred_format,
278 unix_wg_parser_stream_enable,
279 unix_wg_parser_stream_disable,
281 unix_wg_parser_stream_get_buffer,
282 unix_wg_parser_stream_copy_buffer,
283 unix_wg_parser_stream_release_buffer,
284 unix_wg_parser_stream_notify_qos,
286 unix_wg_parser_stream_get_duration,
287 unix_wg_parser_stream_seek,
289 unix_wg_transform_create,
290 unix_wg_transform_destroy,
292 unix_wg_transform_push_data,
293 unix_wg_transform_read_data,
296 #endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */