The BURIKO visual novel engine (as seen in, for example, https://store.steampowered.com/app/1200720/MakingLovers/) demands that the upstream filter tries to connect with a MPEG format type.
Then it memorizes the resolution, rejects the connection, and expects upstream to try RGB32 or RGB24 instead.
It also passes an empty string as filename, and demands this exact error code.
I have no idea why.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56491
-- v5: quartz: Fix memory leak on failure path. quartz/tests: Test the new error codes. quartz: Fix error code on empty filename. quartz/tests: Test that compressed formats are offered for MPEGs. winegstreamer: Reduce CLSID_decodebin_parser merit, so the MPEG splitter is chosen instead for MPEGs. winegstreamer: Delete now-meaningless wg_parser_type enum. winegstreamer: Use decodebin instead of wavparse. winegstreamer: Create decodebin instead of avidemux.
From: Alfred Agrell floating@muncher.se
--- dlls/winegstreamer/quartz_parser.c | 2 +- dlls/winegstreamer/unixlib.h | 1 - dlls/winegstreamer/wg_parser.c | 24 ------------------------ 3 files changed, 1 insertion(+), 26 deletions(-)
diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 6c126fa13e2..2f2653b8711 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -2329,7 +2329,7 @@ HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) struct parser *object; HRESULT hr;
- if (FAILED(hr = parser_create(WG_PARSER_AVIDEMUX, FALSE, &object))) + if (FAILED(hr = parser_create(WG_PARSER_DECODEBIN, TRUE, &object))) return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops); diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 5b1b6ffa7ba..30053433261 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -209,7 +209,6 @@ typedef UINT32 wg_parser_type; enum wg_parser_type { WG_PARSER_DECODEBIN, - WG_PARSER_AVIDEMUX, WG_PARSER_WAVPARSE, };
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index b0a344d5186..9ea17d0c0c5 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -1784,29 +1784,6 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) return TRUE; }
-static BOOL avi_parser_init_gst(struct wg_parser *parser) -{ - GstElement *element; - - if (!(element = create_element("avidemux", "good"))) - return FALSE; - - gst_bin_add(GST_BIN(parser->container), element); - - g_signal_connect(element, "pad-added", G_CALLBACK(pad_added_cb), parser); - g_signal_connect(element, "pad-removed", G_CALLBACK(pad_removed_cb), parser); - g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads_cb), parser); - - pthread_mutex_lock(&parser->mutex); - parser->no_more_pads = false; - pthread_mutex_unlock(&parser->mutex); - - if (!link_src_to_element(parser->my_src, element)) - return FALSE; - - return TRUE; -} - static BOOL wave_parser_init_gst(struct wg_parser *parser) { struct wg_parser_stream *stream; @@ -1837,7 +1814,6 @@ static NTSTATUS wg_parser_create(void *args) static const init_gst_cb init_funcs[] = { [WG_PARSER_DECODEBIN] = decodebin_parser_init_gst, - [WG_PARSER_AVIDEMUX] = avi_parser_init_gst, [WG_PARSER_WAVPARSE] = wave_parser_init_gst, };
From: Alfred Agrell floating@muncher.se
--- dlls/winegstreamer/quartz_parser.c | 2 +- dlls/winegstreamer/unixlib.h | 1 - dlls/winegstreamer/wg_parser.c | 25 ------------------------- 3 files changed, 1 insertion(+), 27 deletions(-)
diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 2f2653b8711..72b82686baa 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -2251,7 +2251,7 @@ HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) struct parser *object; HRESULT hr;
- if (FAILED(hr = parser_create(WG_PARSER_WAVPARSE, FALSE, &object))) + if (FAILED(hr = parser_create(WG_PARSER_DECODEBIN, TRUE, &object))) return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops); diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 30053433261..682eb8febf3 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -209,7 +209,6 @@ typedef UINT32 wg_parser_type; enum wg_parser_type { WG_PARSER_DECODEBIN, - WG_PARSER_WAVPARSE, };
typedef UINT64 wg_parser_t; diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 9ea17d0c0c5..5b391bbd7ab 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -1784,37 +1784,12 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) return TRUE; }
-static BOOL wave_parser_init_gst(struct wg_parser *parser) -{ - struct wg_parser_stream *stream; - GstElement *element; - - if (!(element = create_element("wavparse", "good"))) - return FALSE; - - gst_bin_add(GST_BIN(parser->container), element); - - if (!link_src_to_element(parser->my_src, element)) - return FALSE; - - if (!(stream = create_stream(parser))) - return FALSE; - - if (!link_element_to_sink(element, stream->my_sink)) - return FALSE; - gst_pad_set_active(stream->my_sink, 1); - - parser->no_more_pads = true; - - return TRUE; -}
static NTSTATUS wg_parser_create(void *args) { static const init_gst_cb init_funcs[] = { [WG_PARSER_DECODEBIN] = decodebin_parser_init_gst, - [WG_PARSER_WAVPARSE] = wave_parser_init_gst, };
struct wg_parser_create_params *params = args;
From: Alfred Agrell floating@muncher.se
--- dlls/winegstreamer/gst_private.h | 2 +- dlls/winegstreamer/main.c | 5 ++--- dlls/winegstreamer/media_source.c | 2 +- dlls/winegstreamer/quartz_parser.c | 12 ++++++------ dlls/winegstreamer/unixlib.h | 7 ------- dlls/winegstreamer/wg_parser.c | 14 +++----------- dlls/winegstreamer/wm_reader.c | 4 ++-- 7 files changed, 15 insertions(+), 31 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 2374fb6fddd..e03c779f750 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -49,7 +49,7 @@ HRESULT wg_sample_queue_create(struct wg_sample_queue **out); void wg_sample_queue_destroy(struct wg_sample_queue *queue); void wg_sample_queue_flush(struct wg_sample_queue *queue, bool all);
-wg_parser_t wg_parser_create(enum wg_parser_type type, bool output_compressed); +wg_parser_t wg_parser_create(bool output_compressed); void wg_parser_destroy(wg_parser_t parser);
HRESULT wg_parser_connect(wg_parser_t parser, uint64_t file_size); diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index d4f5db04a15..87d3b9e4fa1 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -68,17 +68,16 @@ bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size) return TRUE; }
-wg_parser_t wg_parser_create(enum wg_parser_type type, bool output_compressed) +wg_parser_t wg_parser_create(bool output_compressed) { struct wg_parser_create_params params = { - .type = type, .output_compressed = output_compressed, .err_on = ERR_ON(quartz), .warn_on = WARN_ON(quartz), };
- TRACE("type %#x.\n", type); + TRACE("output_compressed %d.\n", output_compressed);
if (WINE_UNIX_CALL(unix_wg_parser_create, ¶ms)) return 0; diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 3b5469932f3..8acfa75f335 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -1643,7 +1643,7 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc if (FAILED(hr = MFAllocateWorkQueue(&object->async_commands_queue))) goto fail;
- if (!(parser = wg_parser_create(WG_PARSER_DECODEBIN, FALSE))) + if (!(parser = wg_parser_create(FALSE))) { hr = E_OUTOFMEMORY; goto fail; diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 72b82686baa..8d9472eb334 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -1650,14 +1650,14 @@ static HRESULT decodebin_parser_source_get_media_type(struct parser_source *pin, return VFW_S_NO_MORE_ITEMS; }
-static HRESULT parser_create(enum wg_parser_type type, BOOL output_compressed, struct parser **parser) +static HRESULT parser_create(BOOL output_compressed, struct parser **parser) { struct parser *object;
if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY;
- if (!(object->wg_parser = wg_parser_create(type, output_compressed))) + if (!(object->wg_parser = wg_parser_create(output_compressed))) { free(object); return E_OUTOFMEMORY; @@ -1677,7 +1677,7 @@ HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out) struct parser *object; HRESULT hr;
- if (FAILED(hr = parser_create(WG_PARSER_DECODEBIN, FALSE, &object))) + if (FAILED(hr = parser_create(FALSE, &object))) return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_decodebin_parser, &filter_ops); @@ -2251,7 +2251,7 @@ HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) struct parser *object; HRESULT hr;
- if (FAILED(hr = parser_create(WG_PARSER_DECODEBIN, TRUE, &object))) + if (FAILED(hr = parser_create(TRUE, &object))) return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops); @@ -2329,7 +2329,7 @@ HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) struct parser *object; HRESULT hr;
- if (FAILED(hr = parser_create(WG_PARSER_DECODEBIN, TRUE, &object))) + if (FAILED(hr = parser_create(TRUE, &object))) return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops); @@ -2446,7 +2446,7 @@ HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out) struct parser *object; HRESULT hr;
- if (FAILED(hr = parser_create(WG_PARSER_DECODEBIN, TRUE, &object))) + if (FAILED(hr = parser_create(TRUE, &object))) return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops); diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 682eb8febf3..0da8bce1509 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -205,12 +205,6 @@ struct wg_parser_buffer }; C_ASSERT(sizeof(struct wg_parser_buffer) == 32);
-typedef UINT32 wg_parser_type; -enum wg_parser_type -{ - WG_PARSER_DECODEBIN, -}; - typedef UINT64 wg_parser_t; typedef UINT64 wg_parser_stream_t; typedef UINT64 wg_transform_t; @@ -226,7 +220,6 @@ struct wg_init_gstreamer_params struct wg_parser_create_params { wg_parser_t parser; - wg_parser_type type; UINT8 output_compressed; UINT8 err_on; UINT8 warn_on; diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 5b391bbd7ab..31538624ef6 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -51,18 +51,16 @@ typedef enum
struct wg_parser;
-typedef BOOL (*init_gst_cb)(struct wg_parser *parser); - struct input_cache_chunk { guint64 position; uint8_t *data; };
+static BOOL decodebin_parser_init_gst(struct wg_parser *parser); + struct wg_parser { - init_gst_cb init_gst; - struct wg_parser_stream **streams; unsigned int stream_count;
@@ -1576,7 +1574,7 @@ static NTSTATUS wg_parser_connect(void *args) parser->next_pull_offset = 0; parser->error = false;
- if (!parser->init_gst(parser)) + if (!decodebin_parser_init_gst(parser)) goto out;
gst_element_set_state(parser->container, GST_STATE_PAUSED); @@ -1787,11 +1785,6 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
static NTSTATUS wg_parser_create(void *args) { - static const init_gst_cb init_funcs[] = - { - [WG_PARSER_DECODEBIN] = decodebin_parser_init_gst, - }; - struct wg_parser_create_params *params = args; struct wg_parser *parser;
@@ -1802,7 +1795,6 @@ static NTSTATUS wg_parser_create(void *args) pthread_cond_init(&parser->init_cond, NULL); pthread_cond_init(&parser->read_cond, NULL); pthread_cond_init(&parser->read_done_cond, NULL); - parser->init_gst = init_funcs[params->type]; parser->output_compressed = params->output_compressed; parser->err_on = params->err_on; parser->warn_on = params->warn_on; diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 18910f87d40..7b7ae394ba6 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1452,7 +1452,7 @@ static HRESULT init_stream(struct wm_reader *reader) HRESULT hr; WORD i;
- if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, FALSE))) + if (!(wg_parser = wg_parser_create(FALSE))) return E_OUTOFMEMORY;
reader->wg_parser = wg_parser; @@ -1557,7 +1557,7 @@ static HRESULT reinit_stream(struct wm_reader *reader, bool read_compressed) wg_parser_destroy(reader->wg_parser); reader->wg_parser = 0;
- if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, read_compressed))) + if (!(wg_parser = wg_parser_create(read_compressed))) return E_OUTOFMEMORY;
reader->wg_parser = wg_parser;
From: Alfred Agrell floating@muncher.se
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56491 --- dlls/winegstreamer/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 87d3b9e4fa1..671d011424e 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -1059,7 +1059,7 @@ static const REGFILTERPINS2 reg_decodebin_parser_pins[3] = static const REGFILTER2 reg_decodebin_parser = { .dwVersion = 2, - .dwMerit = MERIT_PREFERRED, + .dwMerit = MERIT_NORMAL - 1, .u.s2.cPins2 = 3, .u.s2.rgPins2 = reg_decodebin_parser_pins, };
From: Alfred Agrell floating@muncher.se
--- dlls/quartz/tests/filtergraph.c | 200 +++++++++++++++++++++++++++++++- 1 file changed, 194 insertions(+), 6 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 92baa0e74e8..32fa57b9469 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -817,6 +817,7 @@ static void test_render_with_multithread(void) struct testpin { IPin IPin_iface; + IMemInputPin IMemInputPin_iface; LONG ref; PIN_DIRECTION dir; struct testfilter *filter; @@ -836,6 +837,10 @@ struct testpin HRESULT Connect_hr; HRESULT EnumMediaTypes_hr; HRESULT QueryInternalConnections_hr; + + BYTE input[64]; + ULONG input_size; + HANDLE on_input_full; };
struct testfilter @@ -870,7 +875,6 @@ struct testfilter IReferenceClock IReferenceClock_iface;
IFileSourceFilter IFileSourceFilter_iface; - WCHAR filename[MAX_PATH]; };
static inline struct testpin *impl_from_IEnumMediaTypes(IEnumMediaTypes *iface) @@ -955,6 +959,11 @@ static inline struct testpin *impl_from_IPin(IPin *iface) return CONTAINING_RECORD(iface, struct testpin, IPin_iface); }
+static inline struct testpin *impl_from_IMemInputPin(IMemInputPin *iface) +{ + return CONTAINING_RECORD(iface, struct testpin, IMemInputPin_iface); +} + static HRESULT WINAPI testpin_QueryInterface(IPin *iface, REFIID iid, void **out) { struct testpin *pin = impl_from_IPin(iface); @@ -966,6 +975,12 @@ static HRESULT WINAPI testpin_QueryInterface(IPin *iface, REFIID iid, void **out IPin_AddRef(*out); return S_OK; } + if (pin->IMemInputPin_iface.lpVtbl && IsEqualGUID(iid, &IID_IMemInputPin)) + { + *out = &pin->IMemInputPin_iface; + IMemInputPin_AddRef(*out); + return S_OK; + }
*out = NULL; return E_NOINTERFACE; @@ -1970,11 +1985,7 @@ static ULONG WINAPI testfilesource_Release(IFileSourceFilter *iface) static HRESULT WINAPI testfilesource_Load(IFileSourceFilter *iface, const WCHAR *filename, const AM_MEDIA_TYPE *mt) { - struct testfilter *filter = impl_from_IFileSourceFilter(iface); - if (winetest_debug > 1) trace("%p->Load()\n", iface); - - wcscpy(filter->filename, filename); - + if (winetest_debug > 1) trace("%p->Load(%ls)\n", iface, filename); return S_OK; }
@@ -4193,6 +4204,182 @@ static void test_ec_complete(void) ok(filter3.ref == 1, "Got outstanding refcount %ld.\n", filter3.ref); }
+static HRESULT WINAPI mpegtestsink_ReceiveConnection(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt) +{ + struct testpin *pin = impl_from_IPin(iface); + if (winetest_debug > 1) trace("%p->ReceiveConnection(%p)\n", pin, peer); + + if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Video)) + return VFW_E_TYPE_NOT_ACCEPTED; + if (!IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_MPEG1Payload)) + return VFW_E_TYPE_NOT_ACCEPTED; + if (!IsEqualGUID(&mt->formattype, &FORMAT_MPEGVideo)) + return VFW_E_TYPE_NOT_ACCEPTED; + + pin->peer = peer; + IPin_AddRef(peer); + return S_OK; +} + +static HRESULT WINAPI mpegtestpin_EndOfStream(IPin *iface) +{ + return S_OK; +} + +static HRESULT WINAPI mpegtestpin_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate) +{ + return S_OK; +} + +static const IPinVtbl mpegtestsink_vtbl = +{ + testpin_QueryInterface, + testpin_AddRef, + testpin_Release, + no_Connect, + mpegtestsink_ReceiveConnection, + testpin_Disconnect, + testpin_ConnectedTo, + testpin_ConnectionMediaType, + testpin_QueryPinInfo, + testpin_QueryDirection, + testpin_QueryId, + testpin_QueryAccept, + testpin_EnumMediaTypes, + testpin_QueryInternalConnections, + mpegtestpin_EndOfStream, + testpin_BeginFlush, + testpin_EndFlush, + mpegtestpin_NewSegment +}; + +static HRESULT WINAPI meminput_QueryInterface(IMemInputPin *iface, REFIID iid, void **out) +{ + struct testpin *pin = impl_from_IMemInputPin(iface); + if (winetest_debug > 1) trace("%p->QueryInterface(%s)\n", pin, wine_dbgstr_guid(iid)); + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI meminput_AddRef(IMemInputPin *iface) +{ + struct testpin *pin = impl_from_IMemInputPin(iface); + return InterlockedIncrement(&pin->ref); +} + +static ULONG WINAPI meminput_Release(IMemInputPin *iface) +{ + struct testpin *pin = impl_from_IMemInputPin(iface); + return InterlockedDecrement(&pin->ref); +} + +static HRESULT STDMETHODCALLTYPE meminput_GetAllocator(IMemInputPin *iface, IMemAllocator **allocator) +{ + return VFW_E_NO_ALLOCATOR; +} + +static HRESULT STDMETHODCALLTYPE meminput_NotifyAllocator(IMemInputPin *iface, IMemAllocator *allocator, BOOL readonly) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE meminput_GetAllocatorRequirements(IMemInputPin *iface, ALLOCATOR_PROPERTIES *props) +{ + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE meminput_Receive(IMemInputPin *iface, IMediaSample *sample) +{ + struct testpin *pin = impl_from_IMemInputPin(iface); + size_t new_bytes; + HRESULT hr; + BYTE *ptr; + long len; + + len = IMediaSample_GetActualDataLength(sample); + hr = IMediaSample_GetPointer(sample, &ptr); + + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(len > 0, "Got %ld.\n", len); + + new_bytes = min(sizeof(pin->input) - pin->input_size, len); + if (new_bytes) + { + memcpy(pin->input + pin->input_size, ptr, new_bytes); + pin->input_size += new_bytes; + if (pin->input_size == sizeof(pin->input)) + SetEvent(pin->on_input_full); + } + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE meminput_ReceiveMultiple(IMemInputPin *iface, IMediaSample **samples, LONG n_samples, LONG *n_samples_processed) +{ + *n_samples_processed = 1; + return IMemInputPin_Receive(iface, samples[0]); +} + +static HRESULT STDMETHODCALLTYPE meminput_ReceiveCanBlock(IMemInputPin *iface) { return S_OK; } + +static const IMemInputPinVtbl mpegtestsink_meminput_vtbl = +{ + meminput_QueryInterface, + meminput_AddRef, + meminput_Release, + + meminput_GetAllocator, + meminput_NotifyAllocator, + meminput_GetAllocatorRequirements, + meminput_Receive, + meminput_ReceiveMultiple, + meminput_ReceiveCanBlock +}; + +static void test_renderfile_compressed(void) +{ + WCHAR *filename = load_resource(L"test.mpg"); + struct testpin sink_pin; + struct testfilter sink; + IMediaControl *control; + IFilterGraph2 *graph; + HRESULT hr; + DWORD ret; + + graph = create_graph(); + testpin_init(&sink_pin, &mpegtestsink_vtbl, PINDIR_INPUT); + sink_pin.IMemInputPin_iface.lpVtbl = &mpegtestsink_meminput_vtbl; + testfilter_init(&sink, &sink_pin, 1); + + hr = IFilterGraph2_AddFilter(graph, &sink.IBaseFilter_iface, L"sink"); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IFilterGraph2_RenderFile(graph, filename, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + ok(sink_pin.peer != NULL, "Expected connection.\n"); + + sink_pin.on_input_full = CreateEventW(NULL, FALSE, FALSE, NULL); + + hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMediaControl_Pause(control); + ok(SUCCEEDED(hr), "Got hr %#lx.\n", hr); + + ret = WaitForSingleObject(sink_pin.on_input_full, 100); + ok(ret == WAIT_OBJECT_0, "Got %#lx.\n", ret); + + ok(sink_pin.input[0] == 0x00, "Expected MPEG sequence header.\n"); + ok(sink_pin.input[1] == 0x00, "Expected MPEG sequence header.\n"); + ok(sink_pin.input[2] == 0x01, "Expected MPEG sequence header.\n"); + ok(sink_pin.input[3] == 0xB3, "Expected MPEG sequence header.\n"); + + IMediaControl_Stop(control); + IFilterGraph2_Release(graph); + DeleteFileW(filename); +} + static void test_renderfile_failure(void) { static const char bogus_data[20] = {0xde, 0xad, 0xbe, 0xef}; @@ -5751,6 +5938,7 @@ START_TEST(filtergraph) test_sync_source(); test_filter_state(); test_ec_complete(); + test_renderfile_compressed(); test_renderfile_failure(); test_graph_seeking(); test_default_sync_source();
From: Alfred Agrell floating@muncher.se
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56491 --- dlls/quartz/filtergraph.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index f2c44498109..995c77d89b9 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -1516,6 +1516,9 @@ static HRESULT WINAPI FilterGraph2_AddSourceFilter(IFilterGraph2 *iface, TRACE("graph %p, filename %s, filter_name %s, ret_filter %p.\n", graph, debugstr_w(filename), debugstr_w(filter_name), ret_filter);
+ if (!*filename) + return VFW_E_NOT_FOUND; + if (!get_media_type(filename, NULL, NULL, &clsid)) clsid = CLSID_AsyncReader; TRACE("Using source filter %s.\n", debugstr_guid(&clsid));
From: Alfred Agrell floating@muncher.se
--- dlls/quartz/tests/filtergraph.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 32fa57b9469..dc68226ec94 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -5353,6 +5353,19 @@ static void test_add_source_filter(void) else skip("Not enough permission to register media types.\n");
+ /* Test some failure cases. */ + + filter = (IBaseFilter *)0xdeadbeef; + hr = IFilterGraph2_AddSourceFilter(graph, L"", NULL, &filter); + /* the BURIKO visual novel engine requires this exact error code */ + ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr); + ok(filter == (IBaseFilter *)0xdeadbeef, "Got %p.\n", filter); + + filter = (IBaseFilter *)0xdeadbeef; + hr = IFilterGraph2_AddSourceFilter(graph, L"doesnt_exist.mp3", NULL, &filter); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got hr %#lx.\n", hr); + ok(filter == (IBaseFilter *)0xdeadbeef, "Got %p.\n", filter); + ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %ld.\n", ref); }
From: Alfred Agrell floating@muncher.se
--- dlls/quartz/filtergraph.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 995c77d89b9..4696d5ced01 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -1542,6 +1542,7 @@ static HRESULT WINAPI FilterGraph2_AddSourceFilter(IFilterGraph2 *iface, if (FAILED(hr)) { WARN("Failed to load file, hr %#lx.\n", hr); + IBaseFilter_Release(filter); return hr; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=144685
Your paranoid android.
=== w1064v1507 (32 bit report) ===
quartz: filtergraph.c:4371: Test failed: Got 0x102. filtergraph.c:4375: Test failed: Expected MPEG sequence header. filtergraph.c:4376: Test failed: Expected MPEG sequence header.
=== w11pro64_amd (64 bit report) ===
quartz: filtergraph.c:1494: Test failed: Unexpected call. filtergraph.c:4359: Test failed: Got hr 0x80040218. filtergraph.c:4361: Test failed: Expected connection. filtergraph.c:4371: Test failed: Got 0x102. filtergraph.c:4375: Test failed: Expected MPEG sequence header. filtergraph.c:4376: Test failed: Expected MPEG sequence header.
=== debian11b (64 bit WoW report) ===
dmime: Unhandled exception: page fault on read access to 0x0000000000000030 in 64-bit code (0x0000000040e49c).
On Thu Apr 4 16:16:18 2024 +0000, Elizabeth Figura wrote:
(2/5 is just adding a test, I'll assume you mean 1/5.)
Yes, sorry.
Yeah, I'm not sure about that part either. I'm not sure about any of
this, other than what BURIKO needs, and I have no idea about _why_ any of that.
As mentioned in bugzilla, using the MPEG splitter and decoders may
have a performance impact, even in applications that don't care about compressed MPEG; that's why I chose this approach. And, as you said, changing filter priorities yields a regression risk.
But if you feel that the improved do-it-right-ness outweighs said
drawbacks, then so be it. Please confirm which way you want it. Yes, it makes performance worse and debugging harder, but at this point the ship has sailed; that's a problem we just need to deal with. That was one of the motivations for delaying doing the work to implement compressed output support, but now we've reached the point where we need it. I think the tradeoffs at this point are such that always using the real MPEG-1 splitter and AVI splitter is the right option.
Sure, done. Except that autoplug-continue thing you mentioned; the avisplit tests still pass, so I think it already supports everything it should. If not, the CI will remind me.
I also did the same change to wavparse, then deleted the now-single-member wg_parser_type enum - if every caller passes the same value, it's just a waste of space. (I can drop those commits if you don't like them, I don't think they yield any functional changes. They're just cleanups.)
Maybe it's possible to add GstAllocator support and tell GStreamer to write directly into IMediaSample; that'd reduce the copies to just a few thread sync ops. But that's out of scope for this MR.
And if not (and until then), computers have gotten faster in the 13 years since decodebin_parser was created (a2916f3a0bfe7e4d2157c5a7413358391d00ba71 - though the name is newer), the overhead is probably less noticable than it would've been back then.
Looks good, thanks. I'm seeing some test failures however: https://testbot.winehq.org/JobDetails.pl?Key=144685
The timeout is probably because 100 ms just isn't enough; I'd turn that up to at least 1 second.
The Windows 11 failures are weirder. I've never seen the filter graph use IBaseFilter::FindPin() before and I don't know what it's being used for, but implementing it does make things basically work, at least.