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
32 #include "mfobjects.h"
34 #include "wine/unixlib.h"
36 /* same as MPEG1VIDEOINFO / MPEG2VIDEOINFO but with MFVIDEOFORMAT */
37 struct mpeg_video_format
40 UINT32 start_time_code
;
44 UINT32 sequence_header_count
;
46 BYTE sequence_header
[];
49 C_ASSERT(sizeof(struct mpeg_video_format
) == offsetof(struct mpeg_video_format
, sequence_header
[0]));
63 typedef UINT32 wg_major_type
;
66 WG_MAJOR_TYPE_UNKNOWN
= 0,
68 WG_MAJOR_TYPE_AUDIO_MPEG1
,
69 WG_MAJOR_TYPE_AUDIO_MPEG4
,
70 WG_MAJOR_TYPE_AUDIO_WMA
,
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
;
82 WG_AUDIO_FORMAT_UNKNOWN
,
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
;
95 WG_VIDEO_FORMAT_UNKNOWN
,
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
,
121 wg_major_type major_type
;
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 */
134 wg_audio_format format
;
137 uint32_t channel_mask
; /* In WinMM format. */
141 uint32_t block_align
;
144 uint32_t payload_type
;
145 uint32_t codec_data_len
;
146 unsigned char codec_data
[64];
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. */
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
;
169 uint32_t codec_data_len
;
170 unsigned char codec_data
[64];
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,
186 /* timestamp and duration are in 100-nanosecond units. */
189 LONG refcount
; /* unix refcount */
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
;
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
218 struct wg_parser_create_params
221 UINT8 output_compressed
;
226 struct wg_parser_connect_params
233 struct wg_parser_get_next_read_offset_params
240 struct wg_parser_push_data_params
247 struct wg_parser_get_stream_count_params
253 struct wg_parser_get_stream_params
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
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
;
293 struct wg_parser_stream_notify_qos_params
295 wg_parser_stream_t stream
;
302 struct wg_parser_stream_get_duration_params
304 wg_parser_stream_t stream
;
308 typedef UINT64 wg_parser_tag
;
311 WG_PARSER_TAG_LANGUAGE
,
316 struct wg_parser_stream_get_tag_params
318 wg_parser_stream_t stream
;
324 struct wg_parser_stream_seek_params
326 wg_parser_stream_t stream
;
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
;
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
;
355 struct wg_transform_read_data_params
357 wg_transform_t transform
;
358 struct wg_sample
*sample
;
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
;
389 struct wg_muxer_create_params
395 struct wg_muxer_add_stream_params
399 const struct wg_format
*format
;
402 struct wg_muxer_push_sample_params
405 struct wg_sample
*sample
;
409 struct wg_muxer_read_data_params
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
,
463 unix_wg_muxer_push_sample
,
464 unix_wg_muxer_read_data
,
465 unix_wg_muxer_finalize
,
470 #endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */