winegstreamer: Replace ambiguously sized/aligned elements.

Replaces bool and enum elements in syscalls with fixed sized UINT64 and UINT8 to avoid ambiguity in
size or alignment in future wow64 thunks.
This commit is contained in:
Kurt Kartaltepe 2023-07-07 20:41:36 -07:00 committed by Alexandre Julliard
parent 18e79f813b
commit 6987f565e0
2 changed files with 73 additions and 59 deletions

View file

@ -23,6 +23,7 @@
#include "unixlib.h"
#include <stdbool.h>
#include <gst/gst.h>
/* unixlib.c */

View file

@ -21,7 +21,6 @@
#ifndef __WINE_WINEGSTREAMER_UNIXLIB_H
#define __WINE_WINEGSTREAMER_UNIXLIB_H
#include <stdbool.h>
#include <stdint.h>
#include "windef.h"
#include "winternl.h"
@ -30,37 +29,74 @@
#include "wine/unixlib.h"
typedef UINT32 wg_major_type;
enum wg_major_type
{
WG_MAJOR_TYPE_UNKNOWN = 0,
WG_MAJOR_TYPE_AUDIO,
WG_MAJOR_TYPE_AUDIO_MPEG1,
WG_MAJOR_TYPE_AUDIO_MPEG4,
WG_MAJOR_TYPE_AUDIO_WMA,
WG_MAJOR_TYPE_VIDEO,
WG_MAJOR_TYPE_VIDEO_CINEPAK,
WG_MAJOR_TYPE_VIDEO_H264,
WG_MAJOR_TYPE_VIDEO_WMV,
WG_MAJOR_TYPE_VIDEO_INDEO,
};
typedef UINT32 wg_audio_format;
enum wg_audio_format
{
WG_AUDIO_FORMAT_UNKNOWN,
WG_AUDIO_FORMAT_U8,
WG_AUDIO_FORMAT_S16LE,
WG_AUDIO_FORMAT_S24LE,
WG_AUDIO_FORMAT_S32LE,
WG_AUDIO_FORMAT_F32LE,
WG_AUDIO_FORMAT_F64LE,
};
typedef UINT32 wg_video_format;
enum wg_video_format
{
WG_VIDEO_FORMAT_UNKNOWN,
WG_VIDEO_FORMAT_BGRA,
WG_VIDEO_FORMAT_BGRx,
WG_VIDEO_FORMAT_BGR,
WG_VIDEO_FORMAT_RGB15,
WG_VIDEO_FORMAT_RGB16,
WG_VIDEO_FORMAT_AYUV,
WG_VIDEO_FORMAT_I420,
WG_VIDEO_FORMAT_NV12,
WG_VIDEO_FORMAT_UYVY,
WG_VIDEO_FORMAT_YUY2,
WG_VIDEO_FORMAT_YV12,
WG_VIDEO_FORMAT_YVYU,
};
typedef UINT32 wg_wmv_video_format;
enum wg_wmv_video_format
{
WG_WMV_VIDEO_FORMAT_UNKNOWN,
WG_WMV_VIDEO_FORMAT_WMV1,
WG_WMV_VIDEO_FORMAT_WMV2,
WG_WMV_VIDEO_FORMAT_WMV3,
WG_WMV_VIDEO_FORMAT_WMVA,
WG_WMV_VIDEO_FORMAT_WVC1,
};
struct wg_format
{
enum wg_major_type
{
WG_MAJOR_TYPE_UNKNOWN = 0,
WG_MAJOR_TYPE_AUDIO,
WG_MAJOR_TYPE_AUDIO_MPEG1,
WG_MAJOR_TYPE_AUDIO_MPEG4,
WG_MAJOR_TYPE_AUDIO_WMA,
WG_MAJOR_TYPE_VIDEO,
WG_MAJOR_TYPE_VIDEO_CINEPAK,
WG_MAJOR_TYPE_VIDEO_H264,
WG_MAJOR_TYPE_VIDEO_WMV,
WG_MAJOR_TYPE_VIDEO_INDEO,
} major_type;
wg_major_type major_type;
union
{
struct
{
enum wg_audio_format
{
WG_AUDIO_FORMAT_UNKNOWN,
WG_AUDIO_FORMAT_U8,
WG_AUDIO_FORMAT_S16LE,
WG_AUDIO_FORMAT_S24LE,
WG_AUDIO_FORMAT_S32LE,
WG_AUDIO_FORMAT_F32LE,
WG_AUDIO_FORMAT_F64LE,
} format;
wg_audio_format format;
uint32_t channels;
uint32_t channel_mask; /* In WinMM format. */
@ -92,24 +128,7 @@ struct wg_format
struct
{
enum wg_video_format
{
WG_VIDEO_FORMAT_UNKNOWN,
WG_VIDEO_FORMAT_BGRA,
WG_VIDEO_FORMAT_BGRx,
WG_VIDEO_FORMAT_BGR,
WG_VIDEO_FORMAT_RGB15,
WG_VIDEO_FORMAT_RGB16,
WG_VIDEO_FORMAT_AYUV,
WG_VIDEO_FORMAT_I420,
WG_VIDEO_FORMAT_NV12,
WG_VIDEO_FORMAT_UYVY,
WG_VIDEO_FORMAT_YUY2,
WG_VIDEO_FORMAT_YV12,
WG_VIDEO_FORMAT_YVYU,
} format;
wg_video_format format;
/* Positive height indicates top-down video; negative height
* indicates bottom-up video. */
int32_t width, height;
@ -132,15 +151,7 @@ struct wg_format
} video_h264;
struct
{
enum wg_wmv_video_format
{
WG_WMV_VIDEO_FORMAT_UNKNOWN,
WG_WMV_VIDEO_FORMAT_WMV1,
WG_WMV_VIDEO_FORMAT_WMV2,
WG_WMV_VIDEO_FORMAT_WMV3,
WG_WMV_VIDEO_FORMAT_WMVA,
WG_WMV_VIDEO_FORMAT_WVC1,
} format;
wg_wmv_video_format format;
int32_t width, height;
uint32_t fps_n, fps_d;
} video_wmv;
@ -180,10 +191,11 @@ struct wg_parser_buffer
UINT64 pts, duration;
UINT32 size;
UINT32 stream;
bool discontinuity, preroll, delta, has_pts, has_duration;
UINT8 discontinuity, preroll, delta, has_pts, has_duration;
};
C_ASSERT(sizeof(struct wg_parser_buffer) == 32);
typedef UINT32 wg_parser_type;
enum wg_parser_type
{
WG_PARSER_DECODEBIN,
@ -199,10 +211,10 @@ typedef UINT64 wg_transform_t;
struct wg_parser_create_params
{
wg_parser_t parser;
enum wg_parser_type type;
bool unlimited_buffering;
bool err_on;
bool warn_on;
wg_parser_type type;
UINT8 unlimited_buffering;
UINT8 err_on;
UINT8 warn_on;
};
struct wg_parser_connect_params
@ -274,7 +286,7 @@ struct wg_parser_stream_copy_buffer_params
struct wg_parser_stream_notify_qos_params
{
wg_parser_stream_t stream;
bool underflow;
UINT8 underflow;
DOUBLE proportion;
INT64 diff;
UINT64 timestamp;
@ -286,6 +298,7 @@ struct wg_parser_stream_get_duration_params
UINT64 duration;
};
typedef UINT64 wg_parser_tag;
enum wg_parser_tag
{
WG_PARSER_TAG_LANGUAGE,
@ -296,7 +309,7 @@ enum wg_parser_tag
struct wg_parser_stream_get_tag_params
{
wg_parser_stream_t stream;
enum wg_parser_tag tag;
wg_parser_tag tag;
char *buffer;
UINT32 *size;
};