Module: wine Branch: master Commit: 8f58b9e1e1a3a8a51ef1db99f6e2e75742984bc8 URL: https://gitlab.winehq.org/wine/wine/-/commit/8f58b9e1e1a3a8a51ef1db99f6e2e75...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Mar 26 16:51:37 2024 +0100
winegstreamer: Set GST_DEBUG if not set, based on WINEDEBUG channels.
---
dlls/winegstreamer/main.c | 10 +++++++++- dlls/winegstreamer/unixlib.c | 9 +++++++++ dlls/winegstreamer/unixlib.h | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 74a6eee5b1d..d4f5db04a15 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -33,6 +33,8 @@ #include "wmcodecdsp.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz); +WINE_DECLARE_DEBUG_CHANNEL(mfplat); +WINE_DECLARE_DEBUG_CHANNEL(wmvcore);
DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); DEFINE_GUID(MEDIASUBTYPE_VC1S,MAKEFOURCC('V','C','1','S'),0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71); @@ -810,9 +812,15 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
static BOOL CALLBACK init_gstreamer_proc(INIT_ONCE *once, void *param, void **ctx) { + struct wg_init_gstreamer_params params = + { + .trace_on = TRACE_ON(mfplat) || TRACE_ON(quartz) || TRACE_ON(wmvcore), + .warn_on = WARN_ON(mfplat) || WARN_ON(quartz) || WARN_ON(wmvcore), + .err_on = ERR_ON(mfplat) || ERR_ON(quartz) || ERR_ON(wmvcore), + }; HINSTANCE handle;
- if (WINE_UNIX_CALL(unix_wg_init_gstreamer, NULL)) + if (WINE_UNIX_CALL(unix_wg_init_gstreamer, ¶ms)) return FALSE;
/* Unloading glib is a bad idea.. it installs atexit handlers, diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index a2ec66e1990..175ab92ecdc 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -246,6 +246,7 @@ bool push_event(GstPad *pad, GstEvent *event)
NTSTATUS wg_init_gstreamer(void *arg) { + struct wg_init_gstreamer_params *params = arg; char arg0[] = "wine"; char arg1[] = "--gst-disable-registry-fork"; char *args[] = {arg0, arg1, NULL}; @@ -253,6 +254,14 @@ NTSTATUS wg_init_gstreamer(void *arg) char **argv = args; GError *err;
+ if (params->trace_on) + setenv("GST_DEBUG", "WINE:9,4", FALSE); + if (params->warn_on) + setenv("GST_DEBUG", "3", FALSE); + if (params->err_on) + setenv("GST_DEBUG", "1", FALSE); + setenv("GST_DEBUG_NO_COLOR", "1", FALSE); + /* GStreamer installs a temporary SEGV handler when it loads plugins * to initialize its registry calling exit(-1) when any fault is caught. * We need to make sure any signal reaches our signal handlers to catch diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 4ec9fce515e..5b1b6ffa7ba 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -218,6 +218,13 @@ typedef UINT64 wg_parser_stream_t; typedef UINT64 wg_transform_t; typedef UINT64 wg_muxer_t;
+struct wg_init_gstreamer_params +{ + UINT8 trace_on; + UINT8 warn_on; + UINT8 err_on; +}; + struct wg_parser_create_params { wg_parser_t parser;