Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/wg_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 4689c83413b..a2eb5415c7b 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -977,7 +977,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) gst_query_parse_accept_caps(query, &caps); wg_format_from_caps(&format, caps); ret = wg_format_compare(&format, &stream->current_format); - if (!ret && WARN_ON(gstreamer)) + if (!ret && gst_debug_category_get_threshold(GST_CAT_DEFAULT) >= GST_LEVEL_WARNING) { gchar *str = gst_caps_to_string(caps); GST_WARNING("Rejecting caps "%s".", str);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/wg_parser.c | 68 +++++++++++----------------------- 1 file changed, 21 insertions(+), 47 deletions(-)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index a2eb5415c7b..1ff82836184 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -992,6 +992,16 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) } }
+static GstElement *create_element(const char *name, const char *plugin_set) +{ + GstElement *element; + + if (!(element = gst_element_factory_make(name, NULL))) + fprintf(stderr, "winegstreamer: failed to create %s, are %u-bit GStreamer "%s" plugins installed?\n", + name, 8 * (unsigned int)sizeof(void *), plugin_set); + return element; +} + static struct wg_parser_stream *create_stream(struct wg_parser *parser) { struct wg_parser_stream *stream, **new_array; @@ -1046,39 +1056,23 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
/* DirectShow can express interlaced video, but downstream filters can't * necessarily consume it. In particular, the video renderer can't. */ - if (!(deinterlace = gst_element_factory_make("deinterlace", NULL))) - { - fprintf(stderr, "winegstreamer: failed to create deinterlace, are %u-bit GStreamer "good" plugins installed?\n", - 8 * (int)sizeof(void *)); + if (!(deinterlace = create_element("deinterlace", "good"))) goto out; - }
/* decodebin considers many YUV formats to be "raw", but some quartz * filters can't handle those. Also, videoflip can't handle all "raw" * formats either. Add a videoconvert to swap color spaces. */ - if (!(vconv = gst_element_factory_make("videoconvert", NULL))) - { - fprintf(stderr, "winegstreamer: failed to create videoconvert, are %u-bit GStreamer "base" plugins installed?\n", - 8 * (int)sizeof(void *)); + if (!(vconv = create_element("videoconvert", "base"))) goto out; - }
/* GStreamer outputs RGB video top-down, but DirectShow expects bottom-up. */ - if (!(flip = gst_element_factory_make("videoflip", NULL))) - { - fprintf(stderr, "winegstreamer: failed to create videoflip, are %u-bit GStreamer "good" plugins installed?\n", - 8 * (int)sizeof(void *)); + if (!(flip = create_element("videoflip", "good"))) goto out; - }
/* videoflip does not support 15 and 16-bit RGB so add a second videoconvert * to do the final conversion. */ - if (!(vconv2 = gst_element_factory_make("videoconvert", NULL))) - { - fprintf(stderr, "winegstreamer: failed to create videoconvert, are %u-bit GStreamer "base" plugins installed?\n", - 8 * (int)sizeof(void *)); + if (!(vconv2 = create_element("videoconvert", "base"))) goto out; - }
/* The bin takes ownership of these elements. */ gst_bin_add(GST_BIN(parser->container), deinterlace); @@ -1106,12 +1100,8 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user) * surround-sound configurations. Native dsound can't always handle * 64-bit formats either. Add an audioconvert to allow changing bit * depth and channel count. */ - if (!(convert = gst_element_factory_make("audioconvert", NULL))) - { - fprintf(stderr, "winegstreamer: failed to create audioconvert, are %u-bit GStreamer "base" plugins installed?\n", - 8 * (int)sizeof(void *)); + if (!(convert = create_element("audioconvert", "base"))) goto out; - }
gst_bin_add(GST_BIN(parser->container), convert); gst_element_sync_state_with_parent(convert); @@ -1636,15 +1626,11 @@ static void CDECL wg_parser_disconnect(struct wg_parser *parser)
static BOOL decodebin_parser_init_gst(struct wg_parser *parser) { - GstElement *element = gst_element_factory_make("decodebin", NULL); + GstElement *element; int ret;
- if (!element) - { - ERR("Failed to create decodebin; are %u-bit GStreamer "base" plugins installed?\n", - 8 * (int)sizeof(void*)); + if (!(element = create_element("decodebin", "base"))) return FALSE; - }
gst_bin_add(GST_BIN(parser->container), element); parser->decodebin = element; @@ -1689,15 +1675,11 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
static BOOL avi_parser_init_gst(struct wg_parser *parser) { - GstElement *element = gst_element_factory_make("avidemux", NULL); + GstElement *element; int ret;
- if (!element) - { - ERR("Failed to create avidemux; are %u-bit GStreamer "good" plugins installed?\n", - 8 * (int)sizeof(void*)); + if (!(element = create_element("avidemux", "good"))) return FALSE; - }
gst_bin_add(GST_BIN(parser->container), element);
@@ -1744,12 +1726,8 @@ static BOOL mpeg_audio_parser_init_gst(struct wg_parser *parser) GstElement *element; int ret;
- if (!(element = gst_element_factory_make("mpegaudioparse", NULL))) - { - ERR("Failed to create mpegaudioparse; are %u-bit GStreamer "good" plugins installed?\n", - 8 * (int)sizeof(void*)); + if (!(element = create_element("mpegaudioparse", "good"))) return FALSE; - }
gst_bin_add(GST_BIN(parser->container), element);
@@ -1797,12 +1775,8 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser) GstElement *element; int ret;
- if (!(element = gst_element_factory_make("wavparse", NULL))) - { - ERR("Failed to create wavparse; are %u-bit GStreamer "good" plugins installed?\n", - 8 * (int)sizeof(void*)); + if (!(element = create_element("wavparse", "good"))) return FALSE; - }
gst_bin_add(GST_BIN(parser->container), element);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/wg_parser.c | 46 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 21 deletions(-)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 1ff82836184..92e4fae034a 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -34,7 +34,10 @@ #include <gst/video/video.h> #include <gst/audio/audio.h>
-WINE_DEFAULT_DEBUG_CHANNEL(gstreamer); +/* GStreamer callbacks may be called on threads not created by Wine, and + * therefore cannot access the Wine TEB. This means that we must use GStreamer + * debug logging instead of Wine debug logging. In order to be safe we forbid + * any use of Wine debug logging in this entire file. */
GST_DEBUG_CATEGORY_STATIC(wine); #define GST_CAT_DEFAULT wine @@ -609,7 +612,7 @@ static bool CDECL wg_parser_stream_get_event(struct wg_parser_stream *stream, st if (parser->flushing) { pthread_mutex_unlock(&parser->mutex); - TRACE("Filter is flushing.\n"); + GST_DEBUG("Filter is flushing.\n"); return false; }
@@ -706,13 +709,13 @@ static void CDECL wg_parser_stream_notify_qos(struct wg_parser_stream *stream, /* 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. */ - TRACE("Ignoring QoS event.\n"); + GST_LOG("Ignoring QoS event.\n"); return; }
if (!(event = gst_event_new_qos(underflow ? GST_QOS_TYPE_UNDERFLOW : GST_QOS_TYPE_OVERFLOW, proportion, diff * 100, stream_time))) - ERR("Failed to create QOS event.\n"); + GST_ERROR("Failed to create QOS event.\n"); gst_pad_push_event(stream->my_sink, event); }
@@ -721,7 +724,7 @@ static GstAutoplugSelectResult autoplug_select_cb(GstElement *bin, GstPad *pad, { const char *name = gst_element_factory_get_longname(fact);
- GST_TRACE("Using "%s".", name); + GST_INFO("Using "%s".", name);
if (strstr(name, "Player protection")) { @@ -1493,7 +1496,7 @@ static LONGLONG query_duration(GstPad *pad) if (gst_pad_query_duration(pad, GST_FORMAT_TIME, &duration)) return duration / 100;
- WARN("Failed to query time duration; trying to convert from byte length.\n"); + GST_INFO("Failed to query time duration; trying to convert from byte length.\n");
/* To accurately get a duration for the stream, we want to only consider the * length of that stream. Hence, query for the pad duration, instead of @@ -1502,7 +1505,7 @@ static LONGLONG query_duration(GstPad *pad) && gst_pad_query_convert(pad, GST_FORMAT_BYTES, byte_length, GST_FORMAT_TIME, &duration)) return duration / 100;
- ERR("Failed to query duration.\n"); + GST_WARNING("Failed to query duration.\n"); return 0; }
@@ -1648,7 +1651,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser)
if ((ret = gst_pad_link(parser->my_src, parser->their_sink)) < 0) { - ERR("Failed to link pads, error %d.\n", ret); + GST_ERROR("Failed to link pads, error %d.\n", ret); return FALSE; }
@@ -1656,7 +1659,7 @@ static BOOL decodebin_parser_init_gst(struct wg_parser *parser) ret = gst_element_get_state(parser->container, NULL, NULL, -1); if (ret == GST_STATE_CHANGE_FAILURE) { - ERR("Failed to play stream.\n"); + GST_ERROR("Failed to play stream.\n"); return FALSE; }
@@ -1695,7 +1698,7 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser)
if ((ret = gst_pad_link(parser->my_src, parser->their_sink)) < 0) { - ERR("Failed to link pads, error %d.\n", ret); + GST_ERROR("Failed to link pads, error %d.\n", ret); return FALSE; }
@@ -1703,7 +1706,7 @@ static BOOL avi_parser_init_gst(struct wg_parser *parser) ret = gst_element_get_state(parser->container, NULL, NULL, -1); if (ret == GST_STATE_CHANGE_FAILURE) { - ERR("Failed to play stream.\n"); + GST_ERROR("Failed to play stream.\n"); return FALSE; }
@@ -1734,7 +1737,7 @@ static BOOL mpeg_audio_parser_init_gst(struct wg_parser *parser) parser->their_sink = gst_element_get_static_pad(element, "sink"); if ((ret = gst_pad_link(parser->my_src, parser->their_sink)) < 0) { - ERR("Failed to link sink pads, error %d.\n", ret); + GST_ERROR("Failed to link sink pads, error %d.\n", ret); return FALSE; }
@@ -1744,7 +1747,7 @@ static BOOL mpeg_audio_parser_init_gst(struct wg_parser *parser) gst_object_ref(stream->their_src = gst_element_get_static_pad(element, "src")); if ((ret = gst_pad_link(stream->their_src, stream->my_sink)) < 0) { - ERR("Failed to link source pads, error %d.\n", ret); + GST_ERROR("Failed to link source pads, error %d.\n", ret); return FALSE; }
@@ -1753,7 +1756,7 @@ static BOOL mpeg_audio_parser_init_gst(struct wg_parser *parser) ret = gst_element_get_state(parser->container, NULL, NULL, -1); if (ret == GST_STATE_CHANGE_FAILURE) { - ERR("Failed to play stream.\n"); + GST_ERROR("Failed to play stream.\n"); return FALSE; }
@@ -1783,7 +1786,7 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser) parser->their_sink = gst_element_get_static_pad(element, "sink"); if ((ret = gst_pad_link(parser->my_src, parser->their_sink)) < 0) { - ERR("Failed to link sink pads, error %d.\n", ret); + GST_ERROR("Failed to link sink pads, error %d.\n", ret); return FALSE; }
@@ -1794,7 +1797,7 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser) gst_object_ref(stream->their_src); if ((ret = gst_pad_link(stream->their_src, stream->my_sink)) < 0) { - ERR("Failed to link source pads, error %d.\n", ret); + GST_ERROR("Failed to link source pads, error %d.\n", ret); return FALSE; }
@@ -1803,7 +1806,7 @@ static BOOL wave_parser_init_gst(struct wg_parser *parser) ret = gst_element_get_state(parser->container, NULL, NULL, -1); if (ret == GST_STATE_CHANGE_FAILURE) { - ERR("Failed to play stream.\n"); + GST_ERROR("Failed to play stream.\n"); return FALSE; }
@@ -1823,7 +1826,7 @@ static struct wg_parser *wg_parser_create(void) pthread_cond_init(&parser->read_done_cond, NULL); parser->flushing = true;
- TRACE("Created winegstreamer parser %p.\n", parser); + GST_DEBUG("Created winegstreamer parser %p.\n", parser); return parser; }
@@ -1927,15 +1930,16 @@ NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *pt
if (!gst_init_check(&argc, &argv, &err)) { - ERR("Failed to initialize GStreamer: %s\n", debugstr_a(err->message)); + fprintf(stderr, "winegstreamer: failed to initialize GStreamer: %s\n", debugstr_a(err->message)); g_error_free(err); return STATUS_UNSUCCESSFUL; } - TRACE("GStreamer library version %s; wine built with %d.%d.%d.\n", - gst_version_string(), GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO);
GST_DEBUG_CATEGORY_INIT(wine, "WINE", GST_DEBUG_FG_RED, "Wine GStreamer support");
+ GST_INFO("GStreamer library version %s; wine built with %d.%d.%d.\n", + gst_version_string(), GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO); + *(const struct unix_funcs **)ptr_out = &funcs; } return STATUS_SUCCESS;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/main.c | 2 +- dlls/winegstreamer/quartz_parser.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index 16fd6147ddf..9211a090cf1 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -29,7 +29,7 @@
LONG object_locks;
-WINE_DEFAULT_DEBUG_CHANNEL(gstreamer); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
const struct unix_funcs *unix_funcs = NULL;
diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 5f9535659b4..09a916d7f5c 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -33,7 +33,7 @@ #include "wmcodecdsp.h" #include "ksmedia.h"
-WINE_DEFAULT_DEBUG_CHANNEL(gstreamer); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static const GUID MEDIASUBTYPE_CVID = {mmioFOURCC('c','v','i','d'), 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; static const GUID MEDIASUBTYPE_MP3 = {WAVE_FORMAT_MPEGLAYER3, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/dispatch.c | 2 +- dlls/strmbase/filter.c | 2 +- dlls/strmbase/mediatype.c | 4 ++-- dlls/strmbase/outputqueue.c | 2 +- dlls/strmbase/pin.c | 4 ++-- dlls/strmbase/pospass.c | 2 +- dlls/strmbase/renderer.c | 2 +- dlls/strmbase/seeking.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/strmbase/dispatch.c b/dlls/strmbase/dispatch.c index de817f20c0d..562c8c12ee6 100644 --- a/dlls/strmbase/dispatch.c +++ b/dlls/strmbase/dispatch.c @@ -20,7 +20,7 @@
#include "strmbase_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static ITypeLib *control_typelib; static ITypeInfo *control_typeinfo[last_tid]; diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index 93593e4c189..2cf874ac1f1 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -20,7 +20,7 @@
#include "strmbase_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
struct enum_pins { diff --git a/dlls/strmbase/mediatype.c b/dlls/strmbase/mediatype.c index 9544d1b8bae..6f66999c390 100644 --- a/dlls/strmbase/mediatype.c +++ b/dlls/strmbase/mediatype.c @@ -23,7 +23,7 @@ #include "dvdmedia.h" #include "dxva.h"
-WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static const struct { @@ -65,7 +65,7 @@ static const char *debugstr_fourcc(DWORD fourcc)
void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt) { - if (!TRACE_ON(strmbase) || !mt) return; + if (!TRACE_ON(quartz) || !mt) return;
TRACE("Dumping media type %p: major type %s, subtype %s", mt, strmbase_debugstr_guid(&mt->majortype), strmbase_debugstr_guid(&mt->subtype)); diff --git a/dlls/strmbase/outputqueue.c b/dlls/strmbase/outputqueue.c index dbcc4b6d0dd..4ac3ef72bd5 100644 --- a/dlls/strmbase/outputqueue.c +++ b/dlls/strmbase/outputqueue.c @@ -20,7 +20,7 @@
#include "strmbase_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
enum {SAMPLE_PACKET, EOS_PACKET};
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index e815f7b82df..efce0155a9e 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -21,7 +21,7 @@
#include "strmbase_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static const IMemInputPinVtbl MemInputPin_Vtbl;
@@ -152,7 +152,7 @@ static HRESULT WINAPI enum_media_types_Next(IEnumMediaTypes *iface, ULONG count, else if (hr != S_OK) break;
- if (TRACE_ON(strmbase)) + if (TRACE_ON(quartz)) { TRACE("Returning media type %u:\n", enummt->index + i); strmbase_dump_media_type(mts[i]); diff --git a/dlls/strmbase/pospass.c b/dlls/strmbase/pospass.c index b9e6f23a974..7478c0e67c5 100644 --- a/dlls/strmbase/pospass.c +++ b/dlls/strmbase/pospass.c @@ -22,7 +22,7 @@
#include "strmbase_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static struct strmbase_passthrough *impl_from_ISeekingPassThru(ISeekingPassThru *iface) { diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 01fabfc98de..a879917b169 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -20,7 +20,7 @@
#include "strmbase_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
/* The following quality-of-service code is based on GstBaseSink QoS code, which * is covered by the following copyright information: diff --git a/dlls/strmbase/seeking.c b/dlls/strmbase/seeking.c index d87e4f8516c..67ef660ba3d 100644 --- a/dlls/strmbase/seeking.c +++ b/dlls/strmbase/seeking.c @@ -21,7 +21,7 @@
#include "strmbase_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(strmbase); +WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static inline SourceSeeking *impl_from_IMediaSeeking(IMediaSeeking *iface) {