From 7750a01cea4bf7771c68ba150cc8edbb8930dd90 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 6 Oct 2021 09:29:40 +1100 Subject: [PATCH] Rebase against ed38d12833bb1957a915ac63128957dacf2bc245. --- ...amer-Convert-the-Unix-library-to-the.patch | 1389 +++++++++++++++++ ...amer-Return-void-from-wg_parser_stre.patch | 91 ++ ...amer-Move-Unix-library-definitions-i.patch | 382 +++++ ...mer-Remove-the-no-longer-used-start.patch} | 4 +- ...mer-Set-unlimited-buffering-using-a.patch} | 4 +- ...mer-Initialize-GStreamer-in-wg_pars.patch} | 4 +- ...mer-Use-a-single-wg_parser_create-e.patch} | 4 +- ...mer-Fix-return-code-in-init_gst-fai.patch} | 4 +- ...mer-Allocate-source-media-buffers-i.patch} | 4 +- ...mer-Duplicate-source-shutdown-path-.patch} | 4 +- ...mer-Properly-clean-up-from-failure-.patch} | 6 +- ...mer-Factor-out-more-of-the-init_gst.patch} | 4 +- patches/patchinstall.sh | 26 +- ...-implementation-of-SLTG-typelib-gene.patch | 22 +- staging/upstream-commit | 2 +- 15 files changed, 1908 insertions(+), 42 deletions(-) create mode 100644 patches/mfplat-reverts/0001-Revert-winegstreamer-Convert-the-Unix-library-to-the.patch create mode 100644 patches/mfplat-reverts/0002-Revert-winegstreamer-Return-void-from-wg_parser_stre.patch create mode 100644 patches/mfplat-reverts/0003-Revert-winegstreamer-Move-Unix-library-definitions-i.patch rename patches/mfplat-reverts/{0001-Revert-winegstreamer-Remove-the-no-longer-used-start.patch => 0004-Revert-winegstreamer-Remove-the-no-longer-used-start.patch} (86%) rename patches/mfplat-reverts/{0002-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch => 0005-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch} (98%) rename patches/mfplat-reverts/{0003-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch => 0006-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch} (95%) rename patches/mfplat-reverts/{0004-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch => 0007-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch} (97%) rename patches/mfplat-reverts/{0005-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch => 0008-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch} (84%) rename patches/mfplat-reverts/{0006-Revert-winegstreamer-Allocate-source-media-buffers-i.patch => 0009-Revert-winegstreamer-Allocate-source-media-buffers-i.patch} (98%) rename patches/mfplat-reverts/{0007-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch => 0010-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch} (98%) rename patches/mfplat-reverts/{0008-Revert-winegstreamer-Properly-clean-up-from-failure-.patch => 0011-Revert-winegstreamer-Properly-clean-up-from-failure-.patch} (96%) rename patches/mfplat-reverts/{0009-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch => 0012-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch} (97%) diff --git a/patches/mfplat-reverts/0001-Revert-winegstreamer-Convert-the-Unix-library-to-the.patch b/patches/mfplat-reverts/0001-Revert-winegstreamer-Convert-the-Unix-library-to-the.patch new file mode 100644 index 00000000..bf6b8e3d --- /dev/null +++ b/patches/mfplat-reverts/0001-Revert-winegstreamer-Convert-the-Unix-library-to-the.patch @@ -0,0 +1,1389 @@ +From 9519e2c9a353d51703831646c3e95bd0eb488846 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 6 Oct 2021 08:38:11 +1100 +Subject: [PATCH 01/12] Revert "winegstreamer: Convert the Unix library to the + __wine_unix_call interface." + +This reverts commit 4ba31162c37ea237763e650f6242535d86ffb170. +--- + dlls/winegstreamer/Makefile.in | 1 - + dlls/winegstreamer/gst_private.h | 32 +---- + dlls/winegstreamer/main.c | 197 +-------------------------- + dlls/winegstreamer/media_source.c | 44 +++--- + dlls/winegstreamer/quartz_parser.c | 72 +++++----- + dlls/winegstreamer/unixlib.h | 139 ++++--------------- + dlls/winegstreamer/wg_parser.c | 210 +++++++++++------------------ + 7 files changed, 167 insertions(+), 528 deletions(-) + +diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in +index e35df3cf3f9..13e61abee36 100644 +--- a/dlls/winegstreamer/Makefile.in ++++ b/dlls/winegstreamer/Makefile.in +@@ -1,5 +1,4 @@ + MODULE = winegstreamer.dll +-UNIXLIB = winegstreamer.so + IMPORTS = strmbase strmiids uuid ole32 mfuuid + DELAYIMPORTS = mfplat + EXTRAINCL = $(GSTREAMER_CFLAGS) +diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h +index ebe0bf6f50d..91c646571cf 100644 +--- a/dlls/winegstreamer/gst_private.h ++++ b/dlls/winegstreamer/gst_private.h +@@ -61,37 +61,7 @@ static inline const char *debugstr_time(REFERENCE_TIME time) + + #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000) + +-struct wg_parser *wg_parser_create(enum wg_parser_type type, bool unlimited_buffering) DECLSPEC_HIDDEN; +-void wg_parser_destroy(struct wg_parser *parser) DECLSPEC_HIDDEN; +- +-HRESULT wg_parser_connect(struct wg_parser *parser, uint64_t file_size) DECLSPEC_HIDDEN; +-void wg_parser_disconnect(struct wg_parser *parser) DECLSPEC_HIDDEN; +- +-void wg_parser_begin_flush(struct wg_parser *parser) DECLSPEC_HIDDEN; +-void wg_parser_end_flush(struct wg_parser *parser) DECLSPEC_HIDDEN; +- +-bool wg_parser_get_next_read_offset(struct wg_parser *parser, uint64_t *offset, uint32_t *size) DECLSPEC_HIDDEN; +-void wg_parser_push_data(struct wg_parser *parser, const void *data, uint32_t size) DECLSPEC_HIDDEN; +- +-uint32_t wg_parser_get_stream_count(struct wg_parser *parser) DECLSPEC_HIDDEN; +-struct wg_parser_stream *wg_parser_get_stream(struct wg_parser *parser, uint32_t index) DECLSPEC_HIDDEN; +- +-void wg_parser_stream_get_preferred_format(struct wg_parser_stream *stream, struct wg_format *format) DECLSPEC_HIDDEN; +-void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format) DECLSPEC_HIDDEN; +-void wg_parser_stream_disable(struct wg_parser_stream *stream) DECLSPEC_HIDDEN; +- +-bool wg_parser_stream_get_event(struct wg_parser_stream *stream, struct wg_parser_event *event) DECLSPEC_HIDDEN; +-bool wg_parser_stream_copy_buffer(struct wg_parser_stream *stream, +- void *data, uint32_t offset, uint32_t size) DECLSPEC_HIDDEN; +-void wg_parser_stream_release_buffer(struct wg_parser_stream *stream) DECLSPEC_HIDDEN; +-void wg_parser_stream_notify_qos(struct wg_parser_stream *stream, +- bool underflow, double proportion, int64_t diff, uint64_t timestamp) DECLSPEC_HIDDEN; +- +-/* Returns the duration in 100-nanosecond units. */ +-uint64_t wg_parser_stream_get_duration(struct wg_parser_stream *stream) DECLSPEC_HIDDEN; +-/* start_pos and stop_pos are in 100-nanosecond units. */ +-void wg_parser_stream_seek(struct wg_parser_stream *stream, double rate, +- uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags) DECLSPEC_HIDDEN; ++extern const struct unix_funcs *unix_funcs; + + HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; + HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c +index c799aa06d1b..6742724948e 100644 +--- a/dlls/winegstreamer/main.c ++++ b/dlls/winegstreamer/main.c +@@ -27,209 +27,16 @@ + #include "initguid.h" + #include "gst_guids.h" + +-static unixlib_handle_t unix_handle; +- + WINE_DEFAULT_DEBUG_CHANNEL(quartz); + +-struct wg_parser *wg_parser_create(enum wg_parser_type type, bool unlimited_buffering) +-{ +- struct wg_parser_create_params params = +- { +- .type = type, +- .unlimited_buffering = unlimited_buffering, +- }; +- +- if (__wine_unix_call(unix_handle, unix_wg_parser_create, ¶ms)) +- return NULL; +- return params.parser; +-} +- +-void wg_parser_destroy(struct wg_parser *parser) +-{ +- __wine_unix_call(unix_handle, unix_wg_parser_destroy, parser); +-} +- +-HRESULT wg_parser_connect(struct wg_parser *parser, uint64_t file_size) +-{ +- struct wg_parser_connect_params params = +- { +- .parser = parser, +- .file_size = file_size, +- }; +- +- return __wine_unix_call(unix_handle, unix_wg_parser_connect, ¶ms); +-} +- +-void wg_parser_disconnect(struct wg_parser *parser) +-{ +- __wine_unix_call(unix_handle, unix_wg_parser_disconnect, parser); +-} +- +-void wg_parser_begin_flush(struct wg_parser *parser) +-{ +- __wine_unix_call(unix_handle, unix_wg_parser_begin_flush, parser); +-} +- +-void wg_parser_end_flush(struct wg_parser *parser) +-{ +- __wine_unix_call(unix_handle, unix_wg_parser_end_flush, parser); +-} +- +-bool wg_parser_get_next_read_offset(struct wg_parser *parser, uint64_t *offset, uint32_t *size) +-{ +- struct wg_parser_get_next_read_offset_params params = +- { +- .parser = parser, +- }; +- +- if (__wine_unix_call(unix_handle, unix_wg_parser_get_next_read_offset, ¶ms)) +- return false; +- *offset = params.offset; +- *size = params.size; +- return true; +-} +- +-void wg_parser_push_data(struct wg_parser *parser, const void *data, uint32_t size) +-{ +- struct wg_parser_push_data_params params = +- { +- .parser = parser, +- .data = data, +- .size = size, +- }; +- +- __wine_unix_call(unix_handle, unix_wg_parser_push_data, ¶ms); +-} +- +-uint32_t wg_parser_get_stream_count(struct wg_parser *parser) +-{ +- struct wg_parser_get_stream_count_params params = +- { +- .parser = parser, +- }; +- +- __wine_unix_call(unix_handle, unix_wg_parser_get_stream_count, ¶ms); +- return params.count; +-} +- +-struct wg_parser_stream *wg_parser_get_stream(struct wg_parser *parser, uint32_t index) +-{ +- struct wg_parser_get_stream_params params = +- { +- .parser = parser, +- .index = index, +- }; +- +- __wine_unix_call(unix_handle, unix_wg_parser_get_stream, ¶ms); +- return params.stream; +-} +- +-void wg_parser_stream_get_preferred_format(struct wg_parser_stream *stream, struct wg_format *format) +-{ +- struct wg_parser_stream_get_preferred_format_params params = +- { +- .stream = stream, +- .format = format, +- }; +- +- __wine_unix_call(unix_handle, unix_wg_parser_stream_get_preferred_format, ¶ms); +-} +- +-void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format) +-{ +- struct wg_parser_stream_enable_params params = +- { +- .stream = stream, +- .format = format, +- }; +- +- __wine_unix_call(unix_handle, unix_wg_parser_stream_enable, ¶ms); +-} +- +-void wg_parser_stream_disable(struct wg_parser_stream *stream) +-{ +- __wine_unix_call(unix_handle, unix_wg_parser_stream_disable, stream); +-} +- +-bool wg_parser_stream_get_event(struct wg_parser_stream *stream, struct wg_parser_event *event) +-{ +- struct wg_parser_stream_get_event_params params = +- { +- .stream = stream, +- .event = event, +- }; +- +- return !__wine_unix_call(unix_handle, unix_wg_parser_stream_get_event, ¶ms); +-} +- +-bool wg_parser_stream_copy_buffer(struct wg_parser_stream *stream, +- void *data, uint32_t offset, uint32_t size) +-{ +- struct wg_parser_stream_copy_buffer_params params = +- { +- .stream = stream, +- .data = data, +- .offset = offset, +- .size = size, +- }; +- +- return !__wine_unix_call(unix_handle, unix_wg_parser_stream_copy_buffer, ¶ms); +-} +- +-void wg_parser_stream_release_buffer(struct wg_parser_stream *stream) +-{ +- __wine_unix_call(unix_handle, unix_wg_parser_stream_release_buffer, stream); +-} +- +-void wg_parser_stream_notify_qos(struct wg_parser_stream *stream, +- bool underflow, double proportion, int64_t diff, uint64_t timestamp) +-{ +- struct wg_parser_stream_notify_qos_params params = +- { +- .stream = stream, +- .underflow = underflow, +- .proportion = proportion, +- .diff = diff, +- .timestamp = timestamp, +- }; +- +- __wine_unix_call(unix_handle, unix_wg_parser_stream_notify_qos, ¶ms); +-} +- +-uint64_t wg_parser_stream_get_duration(struct wg_parser_stream *stream) +-{ +- struct wg_parser_stream_get_duration_params params = +- { +- .stream = stream, +- }; +- +- __wine_unix_call(unix_handle, unix_wg_parser_stream_get_duration, ¶ms); +- return params.duration; +-} +- +-void wg_parser_stream_seek(struct wg_parser_stream *stream, double rate, +- uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags) +-{ +- struct wg_parser_stream_seek_params params = +- { +- .stream = stream, +- .rate = rate, +- .start_pos = start_pos, +- .stop_pos = stop_pos, +- .start_flags = start_flags, +- .stop_flags = stop_flags, +- }; +- +- __wine_unix_call(unix_handle, unix_wg_parser_stream_seek, ¶ms); +-} ++const struct unix_funcs *unix_funcs = NULL; + + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) + { + if (reason == DLL_PROCESS_ATTACH) + { + DisableThreadLibraryCalls(instance); +- NtQueryVirtualMemory(GetCurrentProcess(), instance, MemoryWineUnixFuncs, +- &unix_handle, sizeof(unix_handle), NULL); ++ __wine_init_unix_lib(instance, reason, NULL, &unix_funcs); + } + return TRUE; + } +diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c +index da898f20f66..18bffca1362 100644 +--- a/dlls/winegstreamer/media_source.c ++++ b/dlls/winegstreamer/media_source.c +@@ -357,7 +357,7 @@ static void start_pipeline(struct media_source *source, struct source_async_comm + IMFMediaTypeHandler_GetCurrentMediaType(mth, ¤t_mt); + + mf_media_type_to_wg_format(current_mt, &format); +- wg_parser_stream_enable(stream->wg_stream, &format); ++ unix_funcs->wg_parser_stream_enable(stream->wg_stream, &format); + + IMFMediaType_Release(current_mt); + IMFMediaTypeHandler_Release(mth); +@@ -385,9 +385,9 @@ static void start_pipeline(struct media_source *source, struct source_async_comm + source->state = SOURCE_RUNNING; + + if (position->vt == VT_I8) +- wg_parser_stream_seek(source->streams[0]->wg_stream, 1.0, position->hVal.QuadPart, 0, +- AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning); +- wg_parser_end_flush(source->wg_parser); ++ unix_funcs->wg_parser_stream_seek(source->streams[0]->wg_stream, 1.0, ++ position->hVal.QuadPart, 0, AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning); ++ unix_funcs->wg_parser_end_flush(source->wg_parser); + + for (i = 0; i < source->stream_count; i++) + flush_token_queue(source->streams[i], position->vt == VT_EMPTY); +@@ -415,7 +415,7 @@ static void stop_pipeline(struct media_source *source) + { + unsigned int i; + +- wg_parser_begin_flush(source->wg_parser); ++ unix_funcs->wg_parser_begin_flush(source->wg_parser); + + for (i = 0; i < source->stream_count; i++) + { +@@ -423,7 +423,7 @@ static void stop_pipeline(struct media_source *source) + if (stream->state != STREAM_INACTIVE) + { + IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEStreamStopped, &GUID_NULL, S_OK, NULL); +- wg_parser_stream_disable(stream->wg_stream); ++ unix_funcs->wg_parser_stream_disable(stream->wg_stream); + } + } + +@@ -490,13 +490,13 @@ static void send_buffer(struct media_stream *stream, const struct wg_parser_even + goto out; + } + +- if (!wg_parser_stream_copy_buffer(stream->wg_stream, data, 0, event->u.buffer.size)) ++ if (!unix_funcs->wg_parser_stream_copy_buffer(stream->wg_stream, data, 0, event->u.buffer.size)) + { +- wg_parser_stream_release_buffer(stream->wg_stream); ++ unix_funcs->wg_parser_stream_release_buffer(stream->wg_stream); + IMFMediaBuffer_Unlock(buffer); + goto out; + } +- wg_parser_stream_release_buffer(stream->wg_stream); ++ unix_funcs->wg_parser_stream_release_buffer(stream->wg_stream); + + if (FAILED(hr = IMFMediaBuffer_Unlock(buffer))) + { +@@ -536,7 +536,7 @@ static void wait_on_sample(struct media_stream *stream, IUnknown *token) + + for (;;) + { +- if (!wg_parser_stream_get_event(stream->wg_stream, &event)) ++ if (!unix_funcs->wg_parser_stream_get_event(stream->wg_stream, &event)) + return; + + TRACE("Got event of type %#x.\n", event.type); +@@ -628,7 +628,7 @@ static DWORD CALLBACK read_thread(void *arg) + uint32_t size; + HRESULT hr; + +- if (!wg_parser_get_next_read_offset(source->wg_parser, &offset, &size)) ++ if (!unix_funcs->wg_parser_get_next_read_offset(source->wg_parser, &offset, &size)) + continue; + + if (offset >= file_size) +@@ -650,7 +650,7 @@ static DWORD CALLBACK read_thread(void *arg) + ERR("Failed to read %u bytes at offset %I64u, hr %#x.\n", size, offset, hr); + else if (ret_size != size) + ERR("Unexpected short read: requested %u bytes, got %u.\n", size, ret_size); +- wg_parser_push_data(source->wg_parser, SUCCEEDED(hr) ? data : NULL, ret_size); ++ unix_funcs->wg_parser_push_data(source->wg_parser, SUCCEEDED(hr) ? data : NULL, ret_size); + } + + free(data); +@@ -867,7 +867,7 @@ static HRESULT media_stream_init_desc(struct media_stream *stream) + unsigned int i; + HRESULT hr; + +- wg_parser_stream_get_preferred_format(stream->wg_stream, &format); ++ unix_funcs->wg_parser_stream_get_preferred_format(stream->wg_stream, &format); + + if (format.major_type == WG_MAJOR_TYPE_VIDEO) + { +@@ -1327,7 +1327,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) + + source->state = SOURCE_SHUTDOWN; + +- wg_parser_disconnect(source->wg_parser); ++ unix_funcs->wg_parser_disconnect(source->wg_parser); + + source->read_thread_shutdown = true; + WaitForSingleObject(source->read_thread, INFINITE); +@@ -1350,7 +1350,7 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) + IMFMediaStream_Release(&stream->IMFMediaStream_iface); + } + +- wg_parser_destroy(source->wg_parser); ++ unix_funcs->wg_parser_destroy(source->wg_parser); + + free(source->streams); + +@@ -1427,7 +1427,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + * never deselects it). Remove buffering limits from decodebin in order to + * account for this. Note that this does leak memory, but the same memory + * leak occurs with native. */ +- if (!(parser = wg_parser_create(WG_PARSER_DECODEBIN, true))) ++ if (!(parser = unix_funcs->wg_parser_create(WG_PARSER_DECODEBIN, true))) + { + hr = E_OUTOFMEMORY; + goto fail; +@@ -1438,10 +1438,10 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + + object->state = SOURCE_OPENING; + +- if (FAILED(hr = wg_parser_connect(parser, file_size))) ++ if (FAILED(hr = unix_funcs->wg_parser_connect(parser, file_size))) + goto fail; + +- stream_count = wg_parser_get_stream_count(parser); ++ stream_count = unix_funcs->wg_parser_get_stream_count(parser); + + if (!(object->streams = calloc(stream_count, sizeof(*object->streams)))) + { +@@ -1451,7 +1451,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + + for (i = 0; i < stream_count; ++i) + { +- if (FAILED(hr = new_media_stream(object, wg_parser_get_stream(parser, i), i, &object->streams[i]))) ++ if (FAILED(hr = new_media_stream(object, unix_funcs->wg_parser_get_stream(parser, i), i, &object->streams[i]))) + goto fail; + + if (FAILED(hr = media_stream_init_desc(object->streams[i]))) +@@ -1487,7 +1487,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + + for (i = 0; i < object->stream_count; i++) + total_pres_time = max(total_pres_time, +- wg_parser_stream_get_duration(object->streams[i]->wg_stream)); ++ unix_funcs->wg_parser_stream_get_duration(object->streams[i]->wg_stream)); + + if (object->stream_count) + IMFPresentationDescriptor_SetUINT64(object->pres_desc, &MF_PD_DURATION, total_pres_time); +@@ -1518,7 +1518,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + } + free(object->streams); + if (stream_count != UINT_MAX) +- wg_parser_disconnect(object->wg_parser); ++ unix_funcs->wg_parser_disconnect(object->wg_parser); + if (object->read_thread) + { + object->read_thread_shutdown = true; +@@ -1526,7 +1526,7 @@ static HRESULT media_source_constructor(IMFByteStream *bytestream, struct media_ + CloseHandle(object->read_thread); + } + if (object->wg_parser) +- wg_parser_destroy(object->wg_parser); ++ unix_funcs->wg_parser_destroy(object->wg_parser); + if (object->async_commands_queue) + MFUnlockWorkQueue(object->async_commands_queue); + if (object->event_queue) +diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c +index 6ae1a99a14a..5dd232ea0da 100644 +--- a/dlls/winegstreamer/quartz_parser.c ++++ b/dlls/winegstreamer/quartz_parser.c +@@ -623,7 +623,7 @@ static HRESULT send_sample(struct parser_source *pin, IMediaSample *sample, + + IMediaSample_GetPointer(sample, &ptr); + +- if (!wg_parser_stream_copy_buffer(pin->wg_stream, ptr, offset, size)) ++ if (!unix_funcs->wg_parser_stream_copy_buffer(pin->wg_stream, ptr, offset, size)) + { + /* The GStreamer pin has been flushed. */ + return S_OK; +@@ -732,7 +732,7 @@ static void send_buffer(struct parser_source *pin, const struct wg_parser_event + } + } + +- wg_parser_stream_release_buffer(pin->wg_stream); ++ unix_funcs->wg_parser_stream_release_buffer(pin->wg_stream); + } + + static DWORD CALLBACK stream_thread(void *arg) +@@ -748,7 +748,7 @@ static DWORD CALLBACK stream_thread(void *arg) + + EnterCriticalSection(&pin->flushing_cs); + +- if (!wg_parser_stream_get_event(pin->wg_stream, &event)) ++ if (!unix_funcs->wg_parser_stream_get_event(pin->wg_stream, &event)) + { + LeaveCriticalSection(&pin->flushing_cs); + continue; +@@ -799,7 +799,7 @@ static DWORD CALLBACK read_thread(void *arg) + uint32_t size; + HRESULT hr; + +- if (!wg_parser_get_next_read_offset(filter->wg_parser, &offset, &size)) ++ if (!unix_funcs->wg_parser_get_next_read_offset(filter->wg_parser, &offset, &size)) + continue; + + if (offset >= file_size) +@@ -817,7 +817,7 @@ static DWORD CALLBACK read_thread(void *arg) + if (FAILED(hr)) + ERR("Failed to read %u bytes at offset %I64u, hr %#x.\n", size, offset, hr); + +- wg_parser_push_data(filter->wg_parser, SUCCEEDED(hr) ? data : NULL, size); ++ unix_funcs->wg_parser_push_data(filter->wg_parser, SUCCEEDED(hr) ? data : NULL, size); + } + + free(data); +@@ -869,7 +869,7 @@ static void parser_destroy(struct strmbase_filter *iface) + IAsyncReader_Release(filter->reader); + filter->reader = NULL; + +- wg_parser_destroy(filter->wg_parser); ++ unix_funcs->wg_parser_destroy(filter->wg_parser); + + strmbase_sink_cleanup(&filter->sink); + strmbase_filter_cleanup(&filter->filter); +@@ -887,7 +887,7 @@ static HRESULT parser_init_stream(struct strmbase_filter *iface) + return S_OK; + + filter->streaming = true; +- wg_parser_end_flush(filter->wg_parser); ++ unix_funcs->wg_parser_end_flush(filter->wg_parser); + + /* DirectShow retains the old seek positions, but resets to them every time + * it transitions from stopped -> paused. */ +@@ -895,7 +895,7 @@ static HRESULT parser_init_stream(struct strmbase_filter *iface) + seeking = &filter->sources[0]->seek; + if (seeking->llStop) + stop_flags = AM_SEEKING_AbsolutePositioning; +- wg_parser_stream_seek(filter->sources[0]->wg_stream, seeking->dRate, ++ unix_funcs->wg_parser_stream_seek(filter->sources[0]->wg_stream, seeking->dRate, + seeking->llCurrent, seeking->llStop, AM_SEEKING_AbsolutePositioning, stop_flags); + + for (i = 0; i < filter->source_count; ++i) +@@ -923,7 +923,7 @@ static HRESULT parser_cleanup_stream(struct strmbase_filter *iface) + return S_OK; + + filter->streaming = false; +- wg_parser_begin_flush(filter->wg_parser); ++ unix_funcs->wg_parser_begin_flush(filter->wg_parser); + + for (i = 0; i < filter->source_count; ++i) + { +@@ -978,7 +978,7 @@ static HRESULT parser_sink_connect(struct strmbase_sink *iface, IPin *peer, cons + filter->sink_connected = true; + filter->read_thread = CreateThread(NULL, 0, read_thread, filter, 0, NULL); + +- if (FAILED(hr = wg_parser_connect(filter->wg_parser, file_size))) ++ if (FAILED(hr = unix_funcs->wg_parser_connect(filter->wg_parser, file_size))) + goto err; + + if (!filter->init_gst(filter)) +@@ -991,7 +991,7 @@ static HRESULT parser_sink_connect(struct strmbase_sink *iface, IPin *peer, cons + { + struct parser_source *pin = filter->sources[i]; + +- pin->seek.llDuration = pin->seek.llStop = wg_parser_stream_get_duration(pin->wg_stream); ++ pin->seek.llDuration = pin->seek.llStop = unix_funcs->wg_parser_stream_get_duration(pin->wg_stream); + pin->seek.llCurrent = 0; + } + +@@ -1026,11 +1026,11 @@ static BOOL decodebin_parser_filter_init_gst(struct parser *filter) + unsigned int i, stream_count; + WCHAR source_name[20]; + +- stream_count = wg_parser_get_stream_count(parser); ++ stream_count = unix_funcs->wg_parser_get_stream_count(parser); + for (i = 0; i < stream_count; ++i) + { + swprintf(source_name, ARRAY_SIZE(source_name), L"Stream %02u", i); +- if (!create_pin(filter, wg_parser_get_stream(parser, i), source_name)) ++ if (!create_pin(filter, unix_funcs->wg_parser_get_stream(parser, i), source_name)) + return FALSE; + } + +@@ -1069,7 +1069,7 @@ static HRESULT decodebin_parser_source_get_media_type(struct parser_source *pin, + WG_VIDEO_FORMAT_RGB15, + }; + +- wg_parser_stream_get_preferred_format(pin->wg_stream, &format); ++ unix_funcs->wg_parser_stream_get_preferred_format(pin->wg_stream, &format); + + memset(mt, 0, sizeof(AM_MEDIA_TYPE)); + +@@ -1115,7 +1115,7 @@ HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out) + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + +- if (!(object->wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, false))) ++ if (!(object->wg_parser = unix_funcs->wg_parser_create(WG_PARSER_DECODEBIN, false))) + { + free(object); + return E_OUTOFMEMORY; +@@ -1205,7 +1205,7 @@ static HRESULT WINAPI GST_ChangeRate(IMediaSeeking *iface) + { + struct parser_source *pin = impl_from_IMediaSeeking(iface); + +- wg_parser_stream_seek(pin->wg_stream, pin->seek.dRate, 0, 0, ++ unix_funcs->wg_parser_stream_seek(pin->wg_stream, pin->seek.dRate, 0, 0, + AM_SEEKING_NoPositioning, AM_SEEKING_NoPositioning); + return S_OK; + } +@@ -1247,7 +1247,7 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, + + if (!(current_flags & AM_SEEKING_NoFlush)) + { +- wg_parser_begin_flush(filter->wg_parser); ++ unix_funcs->wg_parser_begin_flush(filter->wg_parser); + + for (i = 0; i < filter->source_count; ++i) + { +@@ -1269,12 +1269,12 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, + + SourceSeekingImpl_SetPositions(iface, current, current_flags, stop, stop_flags); + +- wg_parser_stream_seek(pin->wg_stream, pin->seek.dRate, ++ unix_funcs->wg_parser_stream_seek(pin->wg_stream, pin->seek.dRate, + pin->seek.llCurrent, pin->seek.llStop, current_flags, stop_flags); + + if (!(current_flags & AM_SEEKING_NoFlush)) + { +- wg_parser_end_flush(filter->wg_parser); ++ unix_funcs->wg_parser_end_flush(filter->wg_parser); + + for (i = 0; i < filter->source_count; ++i) + { +@@ -1383,7 +1383,7 @@ static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFil + /* GST_QOS_TYPE_OVERFLOW is also used for buffers that arrive on time, but + * DirectShow filters might use Famine, so check that there actually is an + * underrun. */ +- wg_parser_stream_notify_qos(pin->wg_stream, q.Type == Famine && q.Proportion < 1000, ++ unix_funcs->wg_parser_stream_notify_qos(pin->wg_stream, q.Type == Famine && q.Proportion < 1000, + 1000.0 / q.Proportion, diff, timestamp); + + return S_OK; +@@ -1463,7 +1463,7 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface, + + ret = amt_to_wg_format(&pin->pin.pin.mt, &format); + assert(ret); +- wg_parser_stream_enable(pin->wg_stream, &format); ++ unix_funcs->wg_parser_stream_enable(pin->wg_stream, &format); + + /* We do need to drop any buffers that might have been sent with the old + * caps, but this will be handled in parser_init_stream(). */ +@@ -1478,7 +1478,7 @@ static void source_disconnect(struct strmbase_source *iface) + { + struct parser_source *pin = impl_source_from_IPin(&iface->pin.IPin_iface); + +- wg_parser_stream_disable(pin->wg_stream); ++ unix_funcs->wg_parser_stream_disable(pin->wg_stream); + } + + static void free_source_pin(struct parser_source *pin) +@@ -1544,7 +1544,7 @@ static HRESULT GST_RemoveOutputPins(struct parser *This) + if (!This->sink_connected) + return S_OK; + +- wg_parser_disconnect(This->wg_parser); ++ unix_funcs->wg_parser_disconnect(This->wg_parser); + + /* read_thread() needs to stay alive to service any read requests GStreamer + * sends, so we can only shut it down after GStreamer stops. */ +@@ -1597,7 +1597,7 @@ static BOOL wave_parser_filter_init_gst(struct parser *filter) + { + struct wg_parser *parser = filter->wg_parser; + +- if (!create_pin(filter, wg_parser_get_stream(parser, 0), L"output")) ++ if (!create_pin(filter, unix_funcs->wg_parser_get_stream(parser, 0), L"output")) + return FALSE; + + return TRUE; +@@ -1609,7 +1609,7 @@ static HRESULT wave_parser_source_query_accept(struct parser_source *pin, const + AM_MEDIA_TYPE pad_mt; + HRESULT hr; + +- wg_parser_stream_get_preferred_format(pin->wg_stream, &format); ++ unix_funcs->wg_parser_stream_get_preferred_format(pin->wg_stream, &format); + if (!amt_from_wg_format(&pad_mt, &format)) + return E_OUTOFMEMORY; + hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; +@@ -1624,7 +1624,7 @@ static HRESULT wave_parser_source_get_media_type(struct parser_source *pin, + + if (index > 0) + return VFW_S_NO_MORE_ITEMS; +- wg_parser_stream_get_preferred_format(pin->wg_stream, &format); ++ unix_funcs->wg_parser_stream_get_preferred_format(pin->wg_stream, &format); + if (!amt_from_wg_format(mt, &format)) + return E_OUTOFMEMORY; + return S_OK; +@@ -1640,7 +1640,7 @@ HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + +- if (!(object->wg_parser = wg_parser_create(WG_PARSER_WAVPARSE, false))) ++ if (!(object->wg_parser = unix_funcs->wg_parser_create(WG_PARSER_WAVPARSE, false))) + { + free(object); + return E_OUTOFMEMORY; +@@ -1678,11 +1678,11 @@ static BOOL avi_splitter_filter_init_gst(struct parser *filter) + uint32_t i, stream_count; + WCHAR source_name[20]; + +- stream_count = wg_parser_get_stream_count(parser); ++ stream_count = unix_funcs->wg_parser_get_stream_count(parser); + for (i = 0; i < stream_count; ++i) + { + swprintf(source_name, ARRAY_SIZE(source_name), L"Stream %02u", i); +- if (!create_pin(filter, wg_parser_get_stream(parser, i), source_name)) ++ if (!create_pin(filter, unix_funcs->wg_parser_get_stream(parser, i), source_name)) + return FALSE; + } + +@@ -1695,7 +1695,7 @@ static HRESULT avi_splitter_source_query_accept(struct parser_source *pin, const + AM_MEDIA_TYPE pad_mt; + HRESULT hr; + +- wg_parser_stream_get_preferred_format(pin->wg_stream, &format); ++ unix_funcs->wg_parser_stream_get_preferred_format(pin->wg_stream, &format); + if (!amt_from_wg_format(&pad_mt, &format)) + return E_OUTOFMEMORY; + hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; +@@ -1710,7 +1710,7 @@ static HRESULT avi_splitter_source_get_media_type(struct parser_source *pin, + + if (index > 0) + return VFW_S_NO_MORE_ITEMS; +- wg_parser_stream_get_preferred_format(pin->wg_stream, &format); ++ unix_funcs->wg_parser_stream_get_preferred_format(pin->wg_stream, &format); + if (!amt_from_wg_format(mt, &format)) + return E_OUTOFMEMORY; + return S_OK; +@@ -1726,7 +1726,7 @@ HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + +- if (!(object->wg_parser = wg_parser_create(WG_PARSER_AVIDEMUX, false))) ++ if (!(object->wg_parser = unix_funcs->wg_parser_create(WG_PARSER_AVIDEMUX, false))) + { + free(object); + return E_OUTOFMEMORY; +@@ -1767,7 +1767,7 @@ static BOOL mpeg_splitter_filter_init_gst(struct parser *filter) + { + struct wg_parser *parser = filter->wg_parser; + +- if (!create_pin(filter, wg_parser_get_stream(parser, 0), L"Audio")) ++ if (!create_pin(filter, unix_funcs->wg_parser_get_stream(parser, 0), L"Audio")) + return FALSE; + + return TRUE; +@@ -1779,7 +1779,7 @@ static HRESULT mpeg_splitter_source_query_accept(struct parser_source *pin, cons + AM_MEDIA_TYPE pad_mt; + HRESULT hr; + +- wg_parser_stream_get_preferred_format(pin->wg_stream, &format); ++ unix_funcs->wg_parser_stream_get_preferred_format(pin->wg_stream, &format); + if (!amt_from_wg_format(&pad_mt, &format)) + return E_OUTOFMEMORY; + hr = compare_media_types(mt, &pad_mt) ? S_OK : S_FALSE; +@@ -1794,7 +1794,7 @@ static HRESULT mpeg_splitter_source_get_media_type(struct parser_source *pin, + + if (index > 0) + return VFW_S_NO_MORE_ITEMS; +- wg_parser_stream_get_preferred_format(pin->wg_stream, &format); ++ unix_funcs->wg_parser_stream_get_preferred_format(pin->wg_stream, &format); + if (!amt_from_wg_format(mt, &format)) + return E_OUTOFMEMORY; + return S_OK; +@@ -1833,7 +1833,7 @@ HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out) + if (!(object = calloc(1, sizeof(*object)))) + return E_OUTOFMEMORY; + +- if (!(object->wg_parser = wg_parser_create(WG_PARSER_MPEGAUDIOPARSE, false))) ++ if (!(object->wg_parser = unix_funcs->wg_parser_create(WG_PARSER_MPEGAUDIOPARSE, false))) + { + free(object); + return E_OUTOFMEMORY; +diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h +index 90101893541..dade020916a 100644 +--- a/dlls/winegstreamer/unixlib.h ++++ b/dlls/winegstreamer/unixlib.h +@@ -24,12 +24,9 @@ + #include + #include + #include "windef.h" +-#include "winternl.h" + #include "wtypes.h" + #include "mmreg.h" + +-#include "wine/unixlib.h" +- + struct wg_format + { + enum wg_major_type +@@ -128,123 +125,41 @@ enum wg_parser_type + WG_PARSER_WAVPARSE, + }; + +-struct wg_parser_create_params +-{ +- struct wg_parser *parser; +- enum wg_parser_type type; +- bool unlimited_buffering; +-}; +- +-struct wg_parser_connect_params +-{ +- struct wg_parser *parser; +- UINT64 file_size; +-}; +- +-struct wg_parser_get_next_read_offset_params +-{ +- struct wg_parser *parser; +- UINT32 size; +- UINT64 offset; +-}; +- +-struct wg_parser_push_data_params +-{ +- struct wg_parser *parser; +- const void *data; +- UINT32 size; +-}; +- +-struct wg_parser_get_stream_count_params +-{ +- struct wg_parser *parser; +- UINT32 count; +-}; +- +-struct wg_parser_get_stream_params +-{ +- struct wg_parser *parser; +- UINT32 index; +- struct wg_parser_stream *stream; +-}; +- +-struct wg_parser_stream_get_preferred_format_params +-{ +- struct wg_parser_stream *stream; +- struct wg_format *format; +-}; +- +-struct wg_parser_stream_enable_params +-{ +- struct wg_parser_stream *stream; +- const struct wg_format *format; +-}; +- +-struct wg_parser_stream_get_event_params +-{ +- struct wg_parser_stream *stream; +- struct wg_parser_event *event; +-}; +- +-struct wg_parser_stream_copy_buffer_params +-{ +- struct wg_parser_stream *stream; +- void *data; +- UINT32 offset; +- UINT32 size; +-}; +- +-struct wg_parser_stream_notify_qos_params +-{ +- struct wg_parser_stream *stream; +- bool underflow; +- DOUBLE proportion; +- INT64 diff; +- UINT64 timestamp; +-}; +- +-struct wg_parser_stream_get_duration_params +-{ +- struct wg_parser_stream *stream; +- UINT64 duration; +-}; +- +-struct wg_parser_stream_seek_params +-{ +- struct wg_parser_stream *stream; +- DOUBLE rate; +- UINT64 start_pos, stop_pos; +- DWORD start_flags, stop_flags; +-}; +- +-enum unix_funcs ++struct unix_funcs + { +- unix_wg_parser_create, +- unix_wg_parser_destroy, ++ struct wg_parser *(CDECL *wg_parser_create)(enum wg_parser_type type, bool unlimited_buffering); ++ void (CDECL *wg_parser_destroy)(struct wg_parser *parser); + +- unix_wg_parser_connect, +- unix_wg_parser_disconnect, ++ HRESULT (CDECL *wg_parser_connect)(struct wg_parser *parser, uint64_t file_size); ++ void (CDECL *wg_parser_disconnect)(struct wg_parser *parser); + +- unix_wg_parser_begin_flush, +- unix_wg_parser_end_flush, ++ void (CDECL *wg_parser_begin_flush)(struct wg_parser *parser); ++ void (CDECL *wg_parser_end_flush)(struct wg_parser *parser); + +- unix_wg_parser_get_next_read_offset, +- unix_wg_parser_push_data, ++ bool (CDECL *wg_parser_get_next_read_offset)(struct wg_parser *parser, ++ uint64_t *offset, uint32_t *size); ++ void (CDECL *wg_parser_push_data)(struct wg_parser *parser, ++ const void *data, uint32_t size); + +- unix_wg_parser_get_stream_count, +- unix_wg_parser_get_stream, ++ uint32_t (CDECL *wg_parser_get_stream_count)(struct wg_parser *parser); ++ struct wg_parser_stream *(CDECL *wg_parser_get_stream)(struct wg_parser *parser, uint32_t index); + +- unix_wg_parser_stream_get_preferred_format, +- unix_wg_parser_stream_enable, +- unix_wg_parser_stream_disable, ++ void (CDECL *wg_parser_stream_get_preferred_format)(struct wg_parser_stream *stream, struct wg_format *format); ++ void (CDECL *wg_parser_stream_enable)(struct wg_parser_stream *stream, const struct wg_format *format); ++ void (CDECL *wg_parser_stream_disable)(struct wg_parser_stream *stream); + +- unix_wg_parser_stream_get_event, +- unix_wg_parser_stream_copy_buffer, +- unix_wg_parser_stream_release_buffer, +- unix_wg_parser_stream_notify_qos, ++ bool (CDECL *wg_parser_stream_get_event)(struct wg_parser_stream *stream, struct wg_parser_event *event); ++ bool (CDECL *wg_parser_stream_copy_buffer)(struct wg_parser_stream *stream, ++ void *data, uint32_t offset, uint32_t size); ++ void (CDECL *wg_parser_stream_release_buffer)(struct wg_parser_stream *stream); ++ void (CDECL *wg_parser_stream_notify_qos)(struct wg_parser_stream *stream, ++ bool underflow, double proportion, int64_t diff, uint64_t timestamp); + +- unix_wg_parser_stream_get_duration, +- unix_wg_parser_stream_seek, ++ /* Returns the duration in 100-nanosecond units. */ ++ uint64_t (CDECL *wg_parser_stream_get_duration)(struct wg_parser_stream *stream); ++ /* start_pos and stop_pos are in 100-nanosecond units. */ ++ void (CDECL *wg_parser_stream_seek)(struct wg_parser_stream *stream, double rate, ++ uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags); + }; + + #endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */ +diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c +index 72dfab8f3d6..694f8b57ed1 100644 +--- a/dlls/winegstreamer/wg_parser.c ++++ b/dlls/winegstreamer/wg_parser.c +@@ -34,6 +34,8 @@ + #include + #include + ++#include "ntstatus.h" ++#define WIN32_NO_STATUS + #include "winternl.h" + #include "dshow.h" + +@@ -501,25 +503,18 @@ static bool wg_format_compare(const struct wg_format *a, const struct wg_format + return false; + } + +-static NTSTATUS wg_parser_get_stream_count(void *args) ++static uint32_t CDECL wg_parser_get_stream_count(struct wg_parser *parser) + { +- struct wg_parser_get_stream_count_params *params = args; +- +- params->count = params->parser->stream_count; +- return S_OK; ++ return parser->stream_count; + } + +-static NTSTATUS wg_parser_get_stream(void *args) ++static struct wg_parser_stream * CDECL wg_parser_get_stream(struct wg_parser *parser, uint32_t index) + { +- struct wg_parser_get_stream_params *params = args; +- +- params->stream = params->parser->streams[params->index]; +- return S_OK; ++ return parser->streams[index]; + } + +-static NTSTATUS wg_parser_begin_flush(void *args) ++static void CDECL wg_parser_begin_flush(struct wg_parser *parser) + { +- struct wg_parser *parser = args; + unsigned int i; + + pthread_mutex_lock(&parser->mutex); +@@ -531,26 +526,18 @@ static NTSTATUS wg_parser_begin_flush(void *args) + if (parser->streams[i]->enabled) + pthread_cond_signal(&parser->streams[i]->event_cond); + } +- +- return S_OK; + } + +-static NTSTATUS wg_parser_end_flush(void *args) ++static void CDECL wg_parser_end_flush(struct wg_parser *parser) + { +- struct wg_parser *parser = args; +- + pthread_mutex_lock(&parser->mutex); + parser->flushing = false; + pthread_mutex_unlock(&parser->mutex); +- +- return S_OK; + } + +-static NTSTATUS wg_parser_get_next_read_offset(void *args) ++static bool CDECL wg_parser_get_next_read_offset(struct wg_parser *parser, ++ uint64_t *offset, uint32_t *size) + { +- struct wg_parser_get_next_read_offset_params *params = args; +- struct wg_parser *parser = params->parser; +- + pthread_mutex_lock(&parser->mutex); + + while (parser->sink_connected && !parser->read_request.data) +@@ -559,23 +546,19 @@ static NTSTATUS wg_parser_get_next_read_offset(void *args) + if (!parser->sink_connected) + { + pthread_mutex_unlock(&parser->mutex); +- return VFW_E_WRONG_STATE; ++ return false; + } + +- params->offset = parser->read_request.offset; +- params->size = parser->read_request.size; ++ *offset = parser->read_request.offset; ++ *size = parser->read_request.size; + + pthread_mutex_unlock(&parser->mutex); +- return S_OK; ++ return true; + } + +-static NTSTATUS wg_parser_push_data(void *args) ++static void CDECL wg_parser_push_data(struct wg_parser *parser, ++ const void *data, uint32_t size) + { +- const struct wg_parser_push_data_params *params = args; +- struct wg_parser *parser = params->parser; +- const void *data = params->data; +- uint32_t size = params->size; +- + pthread_mutex_lock(&parser->mutex); + parser->read_request.size = size; + parser->read_request.done = true; +@@ -585,24 +568,15 @@ static NTSTATUS wg_parser_push_data(void *args) + parser->read_request.data = NULL; + pthread_mutex_unlock(&parser->mutex); + pthread_cond_signal(&parser->read_done_cond); +- +- return S_OK; + } + +-static NTSTATUS wg_parser_stream_get_preferred_format(void *args) ++static void CDECL wg_parser_stream_get_preferred_format(struct wg_parser_stream *stream, struct wg_format *format) + { +- const struct wg_parser_stream_get_preferred_format_params *params = args; +- +- *params->format = params->stream->preferred_format; +- return S_OK; ++ *format = stream->preferred_format; + } + +-static NTSTATUS wg_parser_stream_enable(void *args) ++static void CDECL wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format) + { +- const struct wg_parser_stream_enable_params *params = args; +- struct wg_parser_stream *stream = params->stream; +- const struct wg_format *format = params->format; +- + stream->current_format = *format; + stream->enabled = true; + +@@ -633,21 +607,15 @@ static NTSTATUS wg_parser_stream_enable(void *args) + } + + gst_pad_push_event(stream->my_sink, gst_event_new_reconfigure()); +- return S_OK; + } + +-static NTSTATUS wg_parser_stream_disable(void *args) ++static void CDECL wg_parser_stream_disable(struct wg_parser_stream *stream) + { +- struct wg_parser_stream *stream = args; +- + stream->enabled = false; +- return S_OK; + } + +-static NTSTATUS wg_parser_stream_get_event(void *args) ++static bool CDECL wg_parser_stream_get_event(struct wg_parser_stream *stream, struct wg_parser_event *event) + { +- const struct wg_parser_stream_get_event_params *params = args; +- struct wg_parser_stream *stream = params->stream; + struct wg_parser *parser = stream->parser; + + pthread_mutex_lock(&parser->mutex); +@@ -659,10 +627,10 @@ static NTSTATUS wg_parser_stream_get_event(void *args) + { + pthread_mutex_unlock(&parser->mutex); + GST_DEBUG("Filter is flushing.\n"); +- return VFW_E_WRONG_STATE; ++ return false; + } + +- *params->event = stream->event; ++ *event = stream->event; + + if (stream->event.type != WG_PARSER_EVENT_BUFFER) + { +@@ -671,37 +639,33 @@ static NTSTATUS wg_parser_stream_get_event(void *args) + } + pthread_mutex_unlock(&parser->mutex); + +- return S_OK; ++ return true; + } + +-static NTSTATUS wg_parser_stream_copy_buffer(void *args) ++static bool CDECL wg_parser_stream_copy_buffer(struct wg_parser_stream *stream, ++ void *data, uint32_t offset, uint32_t size) + { +- const struct wg_parser_stream_copy_buffer_params *params = args; +- struct wg_parser_stream *stream = params->stream; + struct wg_parser *parser = stream->parser; +- uint32_t offset = params->offset; +- uint32_t size = params->size; + + pthread_mutex_lock(&parser->mutex); + + if (!stream->buffer) + { + pthread_mutex_unlock(&parser->mutex); +- return VFW_E_WRONG_STATE; ++ return false; + } + + assert(stream->event.type == WG_PARSER_EVENT_BUFFER); + assert(offset < stream->map_info.size); + assert(offset + size <= stream->map_info.size); +- memcpy(params->data, stream->map_info.data + offset, size); ++ memcpy(data, stream->map_info.data + offset, size); + + pthread_mutex_unlock(&parser->mutex); +- return S_OK; ++ return true; + } + +-static NTSTATUS wg_parser_stream_release_buffer(void *args) ++static void CDECL wg_parser_stream_release_buffer(struct wg_parser_stream *stream) + { +- struct wg_parser_stream *stream = args; + struct wg_parser *parser = stream->parser; + + pthread_mutex_lock(&parser->mutex); +@@ -715,24 +679,17 @@ static NTSTATUS wg_parser_stream_release_buffer(void *args) + + pthread_mutex_unlock(&parser->mutex); + pthread_cond_signal(&stream->event_empty_cond); +- +- return S_OK; + } + +-static NTSTATUS wg_parser_stream_get_duration(void *args) ++static uint64_t CDECL wg_parser_stream_get_duration(struct wg_parser_stream *stream) + { +- struct wg_parser_stream_get_duration_params *params = args; +- +- params->duration = params->stream->duration; +- return S_OK; ++ return stream->duration; + } + +-static NTSTATUS wg_parser_stream_seek(void *args) ++static void CDECL wg_parser_stream_seek(struct wg_parser_stream *stream, double rate, ++ uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags) + { + GstSeekType start_type = GST_SEEK_TYPE_SET, stop_type = GST_SEEK_TYPE_SET; +- const struct wg_parser_stream_seek_params *params = args; +- DWORD start_flags = params->start_flags; +- DWORD stop_flags = params->stop_flags; + GstSeekFlags flags = 0; + + if (start_flags & AM_SEEKING_SeekToKeyFrame) +@@ -747,39 +704,34 @@ static NTSTATUS wg_parser_stream_seek(void *args) + if ((stop_flags & AM_SEEKING_PositioningBitsMask) == AM_SEEKING_NoPositioning) + stop_type = GST_SEEK_TYPE_NONE; + +- if (!gst_pad_push_event(params->stream->my_sink, gst_event_new_seek(params->rate, GST_FORMAT_TIME, +- flags, start_type, params->start_pos * 100, stop_type, params->stop_pos * 100))) ++ if (!gst_pad_push_event(stream->my_sink, gst_event_new_seek(rate, GST_FORMAT_TIME, ++ flags, start_type, start_pos * 100, stop_type, stop_pos * 100))) + GST_ERROR("Failed to seek.\n"); +- +- return S_OK; + } + +-static NTSTATUS wg_parser_stream_notify_qos(void *args) ++static void CDECL wg_parser_stream_notify_qos(struct wg_parser_stream *stream, ++ bool underflow, double proportion, int64_t diff, uint64_t timestamp) + { +- const struct wg_parser_stream_notify_qos_params *params = args; +- struct wg_parser_stream *stream = params->stream; + GstClockTime stream_time; + GstEvent *event; + + /* We return timestamps in stream time, i.e. relative to the start of the + * file (or other medium), but gst_event_new_qos() expects the timestamp in + * running time. */ +- stream_time = gst_segment_to_running_time(&stream->segment, GST_FORMAT_TIME, params->timestamp * 100); ++ stream_time = gst_segment_to_running_time(&stream->segment, GST_FORMAT_TIME, timestamp * 100); + if (stream_time == -1) + { + /* This can happen legitimately if the sample falls outside of the + * segment bounds. GStreamer elements shouldn't present the sample in + * that case, but DirectShow doesn't care. */ + GST_LOG("Ignoring QoS event.\n"); +- return S_OK; ++ return; + } + +- if (!(event = gst_event_new_qos(params->underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW, +- params->proportion, params->diff * 100, stream_time))) ++ if (!(event = gst_event_new_qos(underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW, ++ proportion, diff * 100, stream_time))) + GST_ERROR("Failed to create QOS event.\n"); + gst_pad_push_event(stream->my_sink, event); +- +- return S_OK; + } + + static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, +@@ -1575,16 +1527,14 @@ static gboolean src_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) + return ret; + } + +-static NTSTATUS wg_parser_connect(void *args) ++static HRESULT CDECL wg_parser_connect(struct wg_parser *parser, uint64_t file_size) + { + GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE("quartz_src", + GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); +- const struct wg_parser_connect_params *params = args; +- struct wg_parser *parser = params->parser; + unsigned int i; + int ret; + +- parser->file_size = params->file_size; ++ parser->file_size = file_size; + parser->sink_connected = true; + + if (!parser->bus) +@@ -1734,9 +1684,8 @@ out: + return E_FAIL; + } + +-static NTSTATUS wg_parser_disconnect(void *args) ++static void CDECL wg_parser_disconnect(struct wg_parser *parser) + { +- struct wg_parser *parser = args; + unsigned int i; + + /* Unblock all of our streams. */ +@@ -1769,8 +1718,6 @@ static NTSTATUS wg_parser_disconnect(void *args) + gst_element_set_bus(parser->container, NULL); + gst_object_unref(parser->container); + parser->container = NULL; +- +- return S_OK; + } + + static BOOL decodebin_parser_init_gst(struct wg_parser *parser) +@@ -1931,7 +1878,7 @@ static void init_gstreamer_once(void) + gst_version_string(), GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO); + } + +-static NTSTATUS wg_parser_create(void *args) ++static struct wg_parser * CDECL wg_parser_create(enum wg_parser_type type, bool unlimited_buffering) + { + static const init_gst_cb init_funcs[] = + { +@@ -1942,32 +1889,28 @@ static NTSTATUS wg_parser_create(void *args) + }; + + static pthread_once_t once = PTHREAD_ONCE_INIT; +- struct wg_parser_create_params *params = args; + struct wg_parser *parser; + + if (pthread_once(&once, init_gstreamer_once)) +- return E_FAIL; ++ return NULL; + + if (!(parser = calloc(1, sizeof(*parser)))) +- return E_OUTOFMEMORY; ++ return NULL; + + pthread_mutex_init(&parser->mutex, NULL); + pthread_cond_init(&parser->init_cond, NULL); + pthread_cond_init(&parser->read_cond, NULL); + pthread_cond_init(&parser->read_done_cond, NULL); + parser->flushing = true; +- parser->init_gst = init_funcs[params->type]; +- parser->unlimited_buffering = params->unlimited_buffering; ++ parser->init_gst = init_funcs[type]; ++ parser->unlimited_buffering = unlimited_buffering; + + GST_DEBUG("Created winegstreamer parser %p.\n", parser); +- params->parser = parser; +- return S_OK; ++ return parser; + } + +-static NTSTATUS wg_parser_destroy(void *args) ++static void CDECL wg_parser_destroy(struct wg_parser *parser) + { +- struct wg_parser *parser = args; +- + if (parser->bus) + { + gst_bus_set_sync_handler(parser->bus, NULL, NULL, NULL); +@@ -1980,36 +1923,41 @@ static NTSTATUS wg_parser_destroy(void *args) + pthread_cond_destroy(&parser->read_done_cond); + + free(parser); +- return S_OK; + } + +-const unixlib_entry_t __wine_unix_call_funcs[] = ++static const struct unix_funcs funcs = + { +-#define X(name) [unix_ ## name] = name +- X(wg_parser_create), +- X(wg_parser_destroy), ++ wg_parser_create, ++ wg_parser_destroy, + +- X(wg_parser_connect), +- X(wg_parser_disconnect), ++ wg_parser_connect, ++ wg_parser_disconnect, + +- X(wg_parser_begin_flush), +- X(wg_parser_end_flush), ++ wg_parser_begin_flush, ++ wg_parser_end_flush, + +- X(wg_parser_get_next_read_offset), +- X(wg_parser_push_data), ++ wg_parser_get_next_read_offset, ++ wg_parser_push_data, + +- X(wg_parser_get_stream_count), +- X(wg_parser_get_stream), ++ wg_parser_get_stream_count, ++ wg_parser_get_stream, + +- X(wg_parser_stream_get_preferred_format), +- X(wg_parser_stream_enable), +- X(wg_parser_stream_disable), ++ wg_parser_stream_get_preferred_format, ++ wg_parser_stream_enable, ++ wg_parser_stream_disable, + +- X(wg_parser_stream_get_event), +- X(wg_parser_stream_copy_buffer), +- X(wg_parser_stream_release_buffer), +- X(wg_parser_stream_notify_qos), ++ wg_parser_stream_get_event, ++ wg_parser_stream_copy_buffer, ++ wg_parser_stream_release_buffer, ++ wg_parser_stream_notify_qos, + +- X(wg_parser_stream_get_duration), +- X(wg_parser_stream_seek), ++ wg_parser_stream_get_duration, ++ wg_parser_stream_seek, + }; ++ ++NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out) ++{ ++ if (reason == DLL_PROCESS_ATTACH) ++ *(const struct unix_funcs **)ptr_out = &funcs; ++ return STATUS_SUCCESS; ++} +-- +2.33.0 + diff --git a/patches/mfplat-reverts/0002-Revert-winegstreamer-Return-void-from-wg_parser_stre.patch b/patches/mfplat-reverts/0002-Revert-winegstreamer-Return-void-from-wg_parser_stre.patch new file mode 100644 index 00000000..1f448964 --- /dev/null +++ b/patches/mfplat-reverts/0002-Revert-winegstreamer-Return-void-from-wg_parser_stre.patch @@ -0,0 +1,91 @@ +From d524440204163e2ad00ccb94886f299c3afa9e3c Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 6 Oct 2021 08:38:12 +1100 +Subject: [PATCH 02/12] Revert "winegstreamer: Return void from + wg_parser_stream_seek()." + +This reverts commit 494039d0d0df8fd5b2b3442caac7bd6c0c7433c0. +--- + dlls/winegstreamer/quartz_parser.c | 12 +++++++++--- + dlls/winegstreamer/unixlib.h | 2 +- + dlls/winegstreamer/wg_parser.c | 7 +++---- + 3 files changed, 13 insertions(+), 8 deletions(-) + +diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c +index 5dd232ea0da..a1fa7daec6f 100644 +--- a/dlls/winegstreamer/quartz_parser.c ++++ b/dlls/winegstreamer/quartz_parser.c +@@ -1233,6 +1233,7 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, + { + struct parser_source *pin = impl_from_IMediaSeeking(iface); + struct parser *filter = impl_from_strmbase_filter(pin->pin.pin.filter); ++ HRESULT hr = S_OK; + int i; + + TRACE("pin %p, current %s, current_flags %#x, stop %s, stop_flags %#x.\n", +@@ -1269,8 +1270,13 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, + + SourceSeekingImpl_SetPositions(iface, current, current_flags, stop, stop_flags); + +- unix_funcs->wg_parser_stream_seek(pin->wg_stream, pin->seek.dRate, +- pin->seek.llCurrent, pin->seek.llStop, current_flags, stop_flags); ++ if (!unix_funcs->wg_parser_stream_seek(pin->wg_stream, pin->seek.dRate, ++ pin->seek.llCurrent, pin->seek.llStop, current_flags, stop_flags)) ++ { ++ ERR("Failed to seek (current %s, stop %s).\n", ++ debugstr_time(pin->seek.llCurrent), debugstr_time(pin->seek.llStop)); ++ hr = E_FAIL; ++ } + + if (!(current_flags & AM_SEEKING_NoFlush)) + { +@@ -1293,7 +1299,7 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, + LeaveCriticalSection(&pin->flushing_cs); + } + +- return S_OK; ++ return hr; + } + + static const IMediaSeekingVtbl GST_Seeking_Vtbl = +diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h +index dade020916a..e917f7b5557 100644 +--- a/dlls/winegstreamer/unixlib.h ++++ b/dlls/winegstreamer/unixlib.h +@@ -158,7 +158,7 @@ struct unix_funcs + /* Returns the duration in 100-nanosecond units. */ + uint64_t (CDECL *wg_parser_stream_get_duration)(struct wg_parser_stream *stream); + /* start_pos and stop_pos are in 100-nanosecond units. */ +- void (CDECL *wg_parser_stream_seek)(struct wg_parser_stream *stream, double rate, ++ bool (CDECL *wg_parser_stream_seek)(struct wg_parser_stream *stream, double rate, + uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags); + }; + +diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c +index 694f8b57ed1..b89a50b5d8f 100644 +--- a/dlls/winegstreamer/wg_parser.c ++++ b/dlls/winegstreamer/wg_parser.c +@@ -686,7 +686,7 @@ static uint64_t CDECL wg_parser_stream_get_duration(struct wg_parser_stream *str + return stream->duration; + } + +-static void CDECL wg_parser_stream_seek(struct wg_parser_stream *stream, double rate, ++static bool CDECL wg_parser_stream_seek(struct wg_parser_stream *stream, double rate, + uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags) + { + GstSeekType start_type = GST_SEEK_TYPE_SET, stop_type = GST_SEEK_TYPE_SET; +@@ -704,9 +704,8 @@ static void CDECL wg_parser_stream_seek(struct wg_parser_stream *stream, double + if ((stop_flags & AM_SEEKING_PositioningBitsMask) == AM_SEEKING_NoPositioning) + stop_type = GST_SEEK_TYPE_NONE; + +- if (!gst_pad_push_event(stream->my_sink, gst_event_new_seek(rate, GST_FORMAT_TIME, +- flags, start_type, start_pos * 100, stop_type, stop_pos * 100))) +- GST_ERROR("Failed to seek.\n"); ++ return gst_pad_push_event(stream->my_sink, gst_event_new_seek(rate, ++ GST_FORMAT_TIME, flags, start_type, start_pos * 100, stop_type, stop_pos * 100)); + } + + static void CDECL wg_parser_stream_notify_qos(struct wg_parser_stream *stream, +-- +2.33.0 + diff --git a/patches/mfplat-reverts/0003-Revert-winegstreamer-Move-Unix-library-definitions-i.patch b/patches/mfplat-reverts/0003-Revert-winegstreamer-Move-Unix-library-definitions-i.patch new file mode 100644 index 00000000..5a0973c8 --- /dev/null +++ b/patches/mfplat-reverts/0003-Revert-winegstreamer-Move-Unix-library-definitions-i.patch @@ -0,0 +1,382 @@ +From 6725238dfb2de2144fccfc83f0f4fbf96aba4b6c Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 6 Oct 2021 08:38:12 +1100 +Subject: [PATCH 03/12] Revert "winegstreamer: Move Unix library definitions + into a separate header." + +This reverts commit 84b870bb1fcac27288ed70d28de6a1c2649e9fe6. +--- + dlls/winegstreamer/gst_private.h | 137 ++++++++++++++++++++++++- + dlls/winegstreamer/unixlib.h | 165 ------------------------------- + dlls/winegstreamer/wg_parser.c | 17 +--- + 3 files changed, 140 insertions(+), 179 deletions(-) + delete mode 100644 dlls/winegstreamer/unixlib.h + +diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h +index 91c646571cf..3470f7870fa 100644 +--- a/dlls/winegstreamer/gst_private.h ++++ b/dlls/winegstreamer/gst_private.h +@@ -36,8 +36,6 @@ + #include "wine/debug.h" + #include "wine/strmbase.h" + +-#include "unixlib.h" +- + static inline const char *debugstr_time(REFERENCE_TIME time) + { + ULONGLONG abstime = time >= 0 ? time : -time; +@@ -61,6 +59,141 @@ static inline const char *debugstr_time(REFERENCE_TIME time) + + #define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000) + ++struct wg_format ++{ ++ enum wg_major_type ++ { ++ WG_MAJOR_TYPE_UNKNOWN, ++ WG_MAJOR_TYPE_VIDEO, ++ WG_MAJOR_TYPE_AUDIO, ++ } major_type; ++ ++ union ++ { ++ 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, ++ ++ WG_VIDEO_FORMAT_CINEPAK, ++ } format; ++ uint32_t width, height; ++ uint32_t fps_n, fps_d; ++ } video; ++ 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, ++ ++ WG_AUDIO_FORMAT_MPEG1_LAYER1, ++ WG_AUDIO_FORMAT_MPEG1_LAYER2, ++ WG_AUDIO_FORMAT_MPEG1_LAYER3, ++ } format; ++ ++ uint32_t channels; ++ uint32_t channel_mask; /* In WinMM format. */ ++ uint32_t rate; ++ } audio; ++ } u; ++}; ++ ++enum wg_parser_event_type ++{ ++ WG_PARSER_EVENT_NONE = 0, ++ WG_PARSER_EVENT_BUFFER, ++ WG_PARSER_EVENT_EOS, ++ WG_PARSER_EVENT_SEGMENT, ++}; ++ ++struct wg_parser_event ++{ ++ enum wg_parser_event_type type; ++ union ++ { ++ struct ++ { ++ /* pts and duration are in 100-nanosecond units. */ ++ ULONGLONG pts, duration; ++ uint32_t size; ++ bool discontinuity, preroll, delta, has_pts, has_duration; ++ } buffer; ++ struct ++ { ++ ULONGLONG position, stop; ++ DOUBLE rate; ++ } segment; ++ } u; ++}; ++C_ASSERT(sizeof(struct wg_parser_event) == 40); ++ ++enum wg_parser_type ++{ ++ WG_PARSER_DECODEBIN, ++ WG_PARSER_AVIDEMUX, ++ WG_PARSER_MPEGAUDIOPARSE, ++ WG_PARSER_WAVPARSE, ++}; ++ ++struct unix_funcs ++{ ++ struct wg_parser *(CDECL *wg_parser_create)(enum wg_parser_type type, bool unlimited_buffering); ++ void (CDECL *wg_parser_destroy)(struct wg_parser *parser); ++ ++ HRESULT (CDECL *wg_parser_connect)(struct wg_parser *parser, uint64_t file_size); ++ void (CDECL *wg_parser_disconnect)(struct wg_parser *parser); ++ ++ void (CDECL *wg_parser_begin_flush)(struct wg_parser *parser); ++ void (CDECL *wg_parser_end_flush)(struct wg_parser *parser); ++ ++ bool (CDECL *wg_parser_get_next_read_offset)(struct wg_parser *parser, ++ uint64_t *offset, uint32_t *size); ++ void (CDECL *wg_parser_push_data)(struct wg_parser *parser, ++ const void *data, uint32_t size); ++ ++ uint32_t (CDECL *wg_parser_get_stream_count)(struct wg_parser *parser); ++ struct wg_parser_stream *(CDECL *wg_parser_get_stream)(struct wg_parser *parser, uint32_t index); ++ ++ void (CDECL *wg_parser_stream_get_preferred_format)(struct wg_parser_stream *stream, struct wg_format *format); ++ void (CDECL *wg_parser_stream_enable)(struct wg_parser_stream *stream, const struct wg_format *format); ++ void (CDECL *wg_parser_stream_disable)(struct wg_parser_stream *stream); ++ ++ bool (CDECL *wg_parser_stream_get_event)(struct wg_parser_stream *stream, struct wg_parser_event *event); ++ bool (CDECL *wg_parser_stream_copy_buffer)(struct wg_parser_stream *stream, ++ void *data, uint32_t offset, uint32_t size); ++ void (CDECL *wg_parser_stream_release_buffer)(struct wg_parser_stream *stream); ++ void (CDECL *wg_parser_stream_notify_qos)(struct wg_parser_stream *stream, ++ bool underflow, double proportion, int64_t diff, uint64_t timestamp); ++ ++ /* Returns the duration in 100-nanosecond units. */ ++ uint64_t (CDECL *wg_parser_stream_get_duration)(struct wg_parser_stream *stream); ++ /* start_pos and stop_pos are in 100-nanosecond units. */ ++ bool (CDECL *wg_parser_stream_seek)(struct wg_parser_stream *stream, double rate, ++ uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags); ++}; ++ + extern const struct unix_funcs *unix_funcs; + + HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h +deleted file mode 100644 +index e917f7b5557..00000000000 +--- a/dlls/winegstreamer/unixlib.h ++++ /dev/null +@@ -1,165 +0,0 @@ +-/* +- * winegstreamer Unix library interface +- * +- * Copyright 2020-2021 Zebediah Figura for CodeWeavers +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +- */ +- +-#ifndef __WINE_WINEGSTREAMER_UNIXLIB_H +-#define __WINE_WINEGSTREAMER_UNIXLIB_H +- +-#include +-#include +-#include "windef.h" +-#include "wtypes.h" +-#include "mmreg.h" +- +-struct wg_format +-{ +- enum wg_major_type +- { +- WG_MAJOR_TYPE_UNKNOWN, +- WG_MAJOR_TYPE_VIDEO, +- WG_MAJOR_TYPE_AUDIO, +- } major_type; +- +- union +- { +- 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, +- +- WG_VIDEO_FORMAT_CINEPAK, +- } format; +- uint32_t width, height; +- uint32_t fps_n, fps_d; +- } video; +- 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, +- +- WG_AUDIO_FORMAT_MPEG1_LAYER1, +- WG_AUDIO_FORMAT_MPEG1_LAYER2, +- WG_AUDIO_FORMAT_MPEG1_LAYER3, +- } format; +- +- uint32_t channels; +- uint32_t channel_mask; /* In WinMM format. */ +- uint32_t rate; +- } audio; +- } u; +-}; +- +-enum wg_parser_event_type +-{ +- WG_PARSER_EVENT_NONE = 0, +- WG_PARSER_EVENT_BUFFER, +- WG_PARSER_EVENT_EOS, +- WG_PARSER_EVENT_SEGMENT, +-}; +- +-struct wg_parser_event +-{ +- enum wg_parser_event_type type; +- union +- { +- struct +- { +- /* pts and duration are in 100-nanosecond units. */ +- ULONGLONG pts, duration; +- uint32_t size; +- bool discontinuity, preroll, delta, has_pts, has_duration; +- } buffer; +- struct +- { +- ULONGLONG position, stop; +- DOUBLE rate; +- } segment; +- } u; +-}; +-C_ASSERT(sizeof(struct wg_parser_event) == 40); +- +-enum wg_parser_type +-{ +- WG_PARSER_DECODEBIN, +- WG_PARSER_AVIDEMUX, +- WG_PARSER_MPEGAUDIOPARSE, +- WG_PARSER_WAVPARSE, +-}; +- +-struct unix_funcs +-{ +- struct wg_parser *(CDECL *wg_parser_create)(enum wg_parser_type type, bool unlimited_buffering); +- void (CDECL *wg_parser_destroy)(struct wg_parser *parser); +- +- HRESULT (CDECL *wg_parser_connect)(struct wg_parser *parser, uint64_t file_size); +- void (CDECL *wg_parser_disconnect)(struct wg_parser *parser); +- +- void (CDECL *wg_parser_begin_flush)(struct wg_parser *parser); +- void (CDECL *wg_parser_end_flush)(struct wg_parser *parser); +- +- bool (CDECL *wg_parser_get_next_read_offset)(struct wg_parser *parser, +- uint64_t *offset, uint32_t *size); +- void (CDECL *wg_parser_push_data)(struct wg_parser *parser, +- const void *data, uint32_t size); +- +- uint32_t (CDECL *wg_parser_get_stream_count)(struct wg_parser *parser); +- struct wg_parser_stream *(CDECL *wg_parser_get_stream)(struct wg_parser *parser, uint32_t index); +- +- void (CDECL *wg_parser_stream_get_preferred_format)(struct wg_parser_stream *stream, struct wg_format *format); +- void (CDECL *wg_parser_stream_enable)(struct wg_parser_stream *stream, const struct wg_format *format); +- void (CDECL *wg_parser_stream_disable)(struct wg_parser_stream *stream); +- +- bool (CDECL *wg_parser_stream_get_event)(struct wg_parser_stream *stream, struct wg_parser_event *event); +- bool (CDECL *wg_parser_stream_copy_buffer)(struct wg_parser_stream *stream, +- void *data, uint32_t offset, uint32_t size); +- void (CDECL *wg_parser_stream_release_buffer)(struct wg_parser_stream *stream); +- void (CDECL *wg_parser_stream_notify_qos)(struct wg_parser_stream *stream, +- bool underflow, double proportion, int64_t diff, uint64_t timestamp); +- +- /* Returns the duration in 100-nanosecond units. */ +- uint64_t (CDECL *wg_parser_stream_get_duration)(struct wg_parser_stream *stream); +- /* start_pos and stop_pos are in 100-nanosecond units. */ +- bool (CDECL *wg_parser_stream_seek)(struct wg_parser_stream *stream, double rate, +- uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags); +-}; +- +-#endif /* __WINE_WINEGSTREAMER_UNIXLIB_H */ +diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c +index b89a50b5d8f..21278682318 100644 +--- a/dlls/winegstreamer/wg_parser.c ++++ b/dlls/winegstreamer/wg_parser.c +@@ -25,21 +25,14 @@ + #endif + + #include "config.h" +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- + #include "ntstatus.h" + #define WIN32_NO_STATUS ++#include "gst_private.h" + #include "winternl.h" +-#include "dshow.h" + +-#include "unixlib.h" ++#include ++#include ++#include + + typedef enum + { +@@ -1866,7 +1859,7 @@ static void init_gstreamer_once(void) + + if (!gst_init_check(&argc, &argv, &err)) + { +- fprintf(stderr, "winegstreamer: failed to initialize GStreamer: %s\n", err->message); ++ fprintf(stderr, "winegstreamer: failed to initialize GStreamer: %s\n", debugstr_a(err->message)); + g_error_free(err); + return; + } +-- +2.33.0 + diff --git a/patches/mfplat-reverts/0001-Revert-winegstreamer-Remove-the-no-longer-used-start.patch b/patches/mfplat-reverts/0004-Revert-winegstreamer-Remove-the-no-longer-used-start.patch similarity index 86% rename from patches/mfplat-reverts/0001-Revert-winegstreamer-Remove-the-no-longer-used-start.patch rename to patches/mfplat-reverts/0004-Revert-winegstreamer-Remove-the-no-longer-used-start.patch index ad6f9715..9939bcab 100644 --- a/patches/mfplat-reverts/0001-Revert-winegstreamer-Remove-the-no-longer-used-start.patch +++ b/patches/mfplat-reverts/0004-Revert-winegstreamer-Remove-the-no-longer-used-start.patch @@ -1,7 +1,7 @@ -From 30120049d9403c6d2eed5a2e1aeb7a3c71557e35 Mon Sep 17 00:00:00 2001 +From 673582fbfd99f1d1837127bac4bb7dab01d9f84b Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sat, 2 Oct 2021 10:35:45 +1000 -Subject: [PATCH 1/9] Revert "winegstreamer: Remove the no longer used +Subject: [PATCH 04/12] Revert "winegstreamer: Remove the no longer used start_dispatch_thread() declaration." This reverts commit a87abdbe85779adf6a2a7897bd88984587880693. diff --git a/patches/mfplat-reverts/0002-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch b/patches/mfplat-reverts/0005-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch similarity index 98% rename from patches/mfplat-reverts/0002-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch rename to patches/mfplat-reverts/0005-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch index 38ed1bec..e052c6e0 100644 --- a/patches/mfplat-reverts/0002-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch +++ b/patches/mfplat-reverts/0005-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch @@ -1,7 +1,7 @@ -From 0909d7fc577a0406791e112bc1e920bf37be0152 Mon Sep 17 00:00:00 2001 +From c583b4715063e2b961724779c963fffb4098ec75 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sat, 2 Oct 2021 10:35:46 +1000 -Subject: [PATCH 2/9] Revert "winegstreamer: Set unlimited buffering using a +Subject: [PATCH 05/12] Revert "winegstreamer: Set unlimited buffering using a flag for wg_parser_create()." This reverts commit 45690320f933d68f613f95f0330098426fc5a08f. diff --git a/patches/mfplat-reverts/0003-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch b/patches/mfplat-reverts/0006-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch similarity index 95% rename from patches/mfplat-reverts/0003-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch rename to patches/mfplat-reverts/0006-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch index 9696c8c6..3a2db3f1 100644 --- a/patches/mfplat-reverts/0003-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch +++ b/patches/mfplat-reverts/0006-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch @@ -1,7 +1,7 @@ -From 21e917e0afa2c59304e375da6d7230ba22d0d361 Mon Sep 17 00:00:00 2001 +From 8c3c3aead2c71f69d4b132f897f2a746e56b9e3c Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sat, 2 Oct 2021 10:35:47 +1000 -Subject: [PATCH 3/9] Revert "winegstreamer: Initialize GStreamer in +Subject: [PATCH 06/12] Revert "winegstreamer: Initialize GStreamer in wg_parser_create()." This reverts commit 3643f73ab61f05ddc9a637f8613c933dda0dd232. diff --git a/patches/mfplat-reverts/0004-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch b/patches/mfplat-reverts/0007-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch similarity index 97% rename from patches/mfplat-reverts/0004-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch rename to patches/mfplat-reverts/0007-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch index 739bb5eb..3f490b80 100644 --- a/patches/mfplat-reverts/0004-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch +++ b/patches/mfplat-reverts/0007-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch @@ -1,7 +1,7 @@ -From ffbc85a3089b39308582cab7de021c7d1d3481f2 Mon Sep 17 00:00:00 2001 +From edbd61fcdce0925f6efe4cc91bad006fbeb2ab2f Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sat, 2 Oct 2021 10:35:47 +1000 -Subject: [PATCH 4/9] Revert "winegstreamer: Use a single wg_parser_create() +Subject: [PATCH 07/12] Revert "winegstreamer: Use a single wg_parser_create() entry point." This reverts commit eab189810d9c40c698bd049d9af647e195cd5993. diff --git a/patches/mfplat-reverts/0005-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch b/patches/mfplat-reverts/0008-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch similarity index 84% rename from patches/mfplat-reverts/0005-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch rename to patches/mfplat-reverts/0008-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch index 6d6095e1..1d8dac9b 100644 --- a/patches/mfplat-reverts/0005-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch +++ b/patches/mfplat-reverts/0008-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch @@ -1,7 +1,7 @@ -From ad6648fd5f8bb2a01c4ac94e0478030690213790 Mon Sep 17 00:00:00 2001 +From 9e4429f355fda7b1d3572aa849de2c3d2326885b Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 19 Sep 2021 13:07:56 +1000 -Subject: [PATCH 5/9] Revert "winegstreamer: Fix return code in init_gst +Subject: [PATCH 08/12] Revert "winegstreamer: Fix return code in init_gst failure case." This reverts commit b9a7e961cdd39203866be38e90b1d901595d54ba. diff --git a/patches/mfplat-reverts/0006-Revert-winegstreamer-Allocate-source-media-buffers-i.patch b/patches/mfplat-reverts/0009-Revert-winegstreamer-Allocate-source-media-buffers-i.patch similarity index 98% rename from patches/mfplat-reverts/0006-Revert-winegstreamer-Allocate-source-media-buffers-i.patch rename to patches/mfplat-reverts/0009-Revert-winegstreamer-Allocate-source-media-buffers-i.patch index 237722ce..de308f42 100644 --- a/patches/mfplat-reverts/0006-Revert-winegstreamer-Allocate-source-media-buffers-i.patch +++ b/patches/mfplat-reverts/0009-Revert-winegstreamer-Allocate-source-media-buffers-i.patch @@ -1,7 +1,7 @@ -From 1d45ee3329da8099c566dd9cf7f0075271c64957 Mon Sep 17 00:00:00 2001 +From 47c589a15c0a20a6643fc61eab0772e60bb7d6e9 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 19 Sep 2021 13:08:02 +1000 -Subject: [PATCH 6/9] Revert "winegstreamer: Allocate source media buffers in +Subject: [PATCH 09/12] Revert "winegstreamer: Allocate source media buffers in the PE components." This reverts commit 8b7390f80d866435f06f2571a93bcd67c0947673. diff --git a/patches/mfplat-reverts/0007-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch b/patches/mfplat-reverts/0010-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch similarity index 98% rename from patches/mfplat-reverts/0007-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch rename to patches/mfplat-reverts/0010-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch index 8f8ac171..2dc64857 100644 --- a/patches/mfplat-reverts/0007-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch +++ b/patches/mfplat-reverts/0010-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch @@ -1,7 +1,7 @@ -From 0a3805b8c2476df04303a59b118cb00146bd4cc3 Mon Sep 17 00:00:00 2001 +From 4fc216dc84f0d25c1bfe828f0ab01747536dc6f7 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 19 Sep 2021 13:08:03 +1000 -Subject: [PATCH 7/9] Revert "winegstreamer: Duplicate source shutdown path +Subject: [PATCH 10/12] Revert "winegstreamer: Duplicate source shutdown path into constructor with leak fixes." This reverts commit 67734bfce31d6032cee1a8980a9022665e9e18fa. diff --git a/patches/mfplat-reverts/0008-Revert-winegstreamer-Properly-clean-up-from-failure-.patch b/patches/mfplat-reverts/0011-Revert-winegstreamer-Properly-clean-up-from-failure-.patch similarity index 96% rename from patches/mfplat-reverts/0008-Revert-winegstreamer-Properly-clean-up-from-failure-.patch rename to patches/mfplat-reverts/0011-Revert-winegstreamer-Properly-clean-up-from-failure-.patch index 6a1c73fc..5db01b7a 100644 --- a/patches/mfplat-reverts/0008-Revert-winegstreamer-Properly-clean-up-from-failure-.patch +++ b/patches/mfplat-reverts/0011-Revert-winegstreamer-Properly-clean-up-from-failure-.patch @@ -1,8 +1,8 @@ -From f9a7dd1d5b82b0c9ce25a75af759f057cf5de7db Mon Sep 17 00:00:00 2001 +From b1c93d216b7319beeb1588c427408809cd0f66ff Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 19 Sep 2021 13:08:04 +1000 -Subject: [PATCH 8/9] Revert "winegstreamer: Properly clean up from failure in - wg_parser_connect()." +Subject: [PATCH 11/12] Revert "winegstreamer: Properly clean up from failure + in wg_parser_connect()." This reverts commit 721b1eb2ebe5c3eaab8ac3fb1e4f4648cbee5b4d. --- diff --git a/patches/mfplat-reverts/0009-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch b/patches/mfplat-reverts/0012-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch similarity index 97% rename from patches/mfplat-reverts/0009-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch rename to patches/mfplat-reverts/0012-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch index 8b877ed8..5ed5023f 100644 --- a/patches/mfplat-reverts/0009-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch +++ b/patches/mfplat-reverts/0012-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch @@ -1,7 +1,7 @@ -From d173e0229a32f2aaea6309907b2561f83e868305 Mon Sep 17 00:00:00 2001 +From c7efccc7753bbda48493a7ff94fea0b72eb398c6 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 19 Sep 2021 13:08:05 +1000 -Subject: [PATCH 9/9] Revert "winegstreamer: Factor out more of the init_gst +Subject: [PATCH 12/12] Revert "winegstreamer: Factor out more of the init_gst callback into wg_parser_connect()." This reverts commit 830efe873a967dbbb0c9a65be6a66b124a5fa826. diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index dc83ff74..439ffebd 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "5a8dcb062793fbb68997e1b54ebc2666a2b2834d" + echo "ed38d12833bb1957a915ac63128957dacf2bc245" } # Show version information @@ -2442,19 +2442,23 @@ fi # Patchset mfplat-reverts # | # | Modified files: -# | * dlls/winegstreamer/gst_private.h, dlls/winegstreamer/media_source.c, dlls/winegstreamer/quartz_parser.c, +# | * dlls/winegstreamer/Makefile.in, dlls/winegstreamer/gst_private.h, dlls/winegstreamer/main.c, +# | dlls/winegstreamer/media_source.c, dlls/winegstreamer/quartz_parser.c, dlls/winegstreamer/unixlib.h, # | dlls/winegstreamer/wg_parser.c # | if test "$enable_mfplat_reverts" -eq 1; then - patch_apply mfplat-reverts/0001-Revert-winegstreamer-Remove-the-no-longer-used-start.patch - patch_apply mfplat-reverts/0002-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch - patch_apply mfplat-reverts/0003-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch - patch_apply mfplat-reverts/0004-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch - patch_apply mfplat-reverts/0005-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch - patch_apply mfplat-reverts/0006-Revert-winegstreamer-Allocate-source-media-buffers-i.patch - patch_apply mfplat-reverts/0007-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch - patch_apply mfplat-reverts/0008-Revert-winegstreamer-Properly-clean-up-from-failure-.patch - patch_apply mfplat-reverts/0009-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch + patch_apply mfplat-reverts/0001-Revert-winegstreamer-Convert-the-Unix-library-to-the.patch + patch_apply mfplat-reverts/0002-Revert-winegstreamer-Return-void-from-wg_parser_stre.patch + patch_apply mfplat-reverts/0003-Revert-winegstreamer-Move-Unix-library-definitions-i.patch + patch_apply mfplat-reverts/0004-Revert-winegstreamer-Remove-the-no-longer-used-start.patch + patch_apply mfplat-reverts/0005-Revert-winegstreamer-Set-unlimited-buffering-using-a.patch + patch_apply mfplat-reverts/0006-Revert-winegstreamer-Initialize-GStreamer-in-wg_pars.patch + patch_apply mfplat-reverts/0007-Revert-winegstreamer-Use-a-single-wg_parser_create-e.patch + patch_apply mfplat-reverts/0008-Revert-winegstreamer-Fix-return-code-in-init_gst-fai.patch + patch_apply mfplat-reverts/0009-Revert-winegstreamer-Allocate-source-media-buffers-i.patch + patch_apply mfplat-reverts/0010-Revert-winegstreamer-Duplicate-source-shutdown-path-.patch + patch_apply mfplat-reverts/0011-Revert-winegstreamer-Properly-clean-up-from-failure-.patch + patch_apply mfplat-reverts/0012-Revert-winegstreamer-Factor-out-more-of-the-init_gst.patch fi # Patchset mfplat-streaming-support diff --git a/patches/widl-SLTG_Typelib_Support/0001-widl-Add-initial-implementation-of-SLTG-typelib-gene.patch b/patches/widl-SLTG_Typelib_Support/0001-widl-Add-initial-implementation-of-SLTG-typelib-gene.patch index 85e9edda..aee312f7 100644 --- a/patches/widl-SLTG_Typelib_Support/0001-widl-Add-initial-implementation-of-SLTG-typelib-gene.patch +++ b/patches/widl-SLTG_Typelib_Support/0001-widl-Add-initial-implementation-of-SLTG-typelib-gene.patch @@ -1,4 +1,4 @@ -From fbf14812e8eba54d8a4eb369cabbe10174584a02 Mon Sep 17 00:00:00 2001 +From 61c9dd1107e9a6d058d9fc4e35d9f6694c0ecd9c Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 23 Dec 2015 19:37:37 +0800 Subject: [PATCH] widl: Add initial implementation of SLTG typelib generator. @@ -36,10 +36,10 @@ index 7df7d290825..5d9f45a7c38 100644 +extern int create_sltg_typelib(typelib_t *typelib); #endif diff --git a/tools/widl/widl.c b/tools/widl/widl.c -index 5b1ce6ca689..45288d1a1f9 100644 +index 5c11f6285ea..2199087ebdf 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c -@@ -170,6 +170,7 @@ enum { +@@ -169,6 +169,7 @@ enum { DLLDATA_ONLY_OPTION, LOCAL_STUBS_OPTION, NOSTDINC_OPTION, @@ -47,15 +47,15 @@ index 5b1ce6ca689..45288d1a1f9 100644 PREFIX_ALL_OPTION, PREFIX_CLIENT_OPTION, PREFIX_SERVER_OPTION, -@@ -196,6 +197,7 @@ static const struct option long_options[] = { - { "nostdinc", 0, NULL, NOSTDINC_OPTION }, - { "ns_prefix", 0, NULL, RT_NS_PREFIX }, - { "oldnames", 0, NULL, OLDNAMES_OPTION }, +@@ -195,6 +196,7 @@ static const struct long_option long_options[] = { + { "nostdinc", 0, NOSTDINC_OPTION }, + { "ns_prefix", 0, RT_NS_PREFIX }, + { "oldnames", 0, OLDNAMES_OPTION }, + { "oldtlb", 0, NULL, OLD_TYPELIB_OPTION }, - { "output", 0, NULL, 'o' }, - { "prefix-all", 1, NULL, PREFIX_ALL_OPTION }, - { "prefix-client", 1, NULL, PREFIX_CLIENT_OPTION }, -@@ -776,6 +778,10 @@ int main(int argc,char *argv[]) + { "output", 0, 'o' }, + { "prefix-all", 1, PREFIX_ALL_OPTION }, + { "prefix-client", 1, PREFIX_CLIENT_OPTION }, +@@ -714,6 +716,10 @@ static void option_callback( int optc, char *optarg ) do_everything = 0; do_typelib = 1; break; diff --git a/staging/upstream-commit b/staging/upstream-commit index 7d58c50b..9d151483 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -5a8dcb062793fbb68997e1b54ebc2666a2b2834d +ed38d12833bb1957a915ac63128957dacf2bc245