Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index e1309e97c4c..ba632f3297d 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -102,6 +102,8 @@ struct wg_parser_event
struct wg_parser_stream { + struct wg_parser *parser; + GstPad *their_src, *post_sink, *post_src, *my_sink; GstElement *flip; struct wg_format preferred_format, current_format; @@ -917,10 +919,9 @@ static bool wg_format_compare(const struct wg_format *a, const struct wg_format
static gboolean query_sink(GstPad *pad, GstObject *parent, GstQuery *query) { - struct parser_source *pin = gst_pad_get_element_private(pad); - struct wg_parser_stream *stream = pin->wg_stream; + struct wg_parser_stream *stream = gst_pad_get_element_private(pad);
- GST_LOG("pin %p, type "%s".", pin, gst_query_type_get_name(query->type)); + GST_LOG("stream %p, type "%s".", stream, gst_query_type_get_name(query->type));
switch (query->type) { @@ -1053,10 +1054,9 @@ static gboolean event_src(GstPad *pad, GstObject *parent, GstEvent *event) return ret; }
-static GstFlowReturn queue_stream_event(struct parser_source *pin, const struct wg_parser_event *event) +static GstFlowReturn queue_stream_event(struct wg_parser_stream *stream, const struct wg_parser_event *event) { - struct wg_parser *parser = impl_from_strmbase_filter(pin->pin.pin.filter)->wg_parser; - struct wg_parser_stream *stream = pin->wg_stream; + struct wg_parser *parser = stream->parser;
/* Unlike request_buffer_src() [q.v.], we need to watch for GStreamer * flushes here. The difference is that we can be blocked by the streaming @@ -1082,12 +1082,10 @@ static GstFlowReturn queue_stream_event(struct parser_source *pin, const struct
static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) { - struct parser_source *pin = gst_pad_get_element_private(pad); - struct wg_parser_stream *stream = pin->wg_stream; - struct parser *filter = impl_from_strmbase_filter(pin->pin.pin.filter); - struct wg_parser *parser = filter->wg_parser; + struct wg_parser_stream *stream = gst_pad_get_element_private(pad); + struct wg_parser *parser = stream->parser;
- GST_LOG("pin %p, type "%s".", pin, GST_EVENT_TYPE_NAME(event)); + GST_LOG("stream %p, type "%s".", stream, GST_EVENT_TYPE_NAME(event));
switch (event->type) { @@ -1109,7 +1107,7 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) stream_event.u.segment.position = segment->position / 100; stream_event.u.segment.stop = segment->stop / 100; stream_event.u.segment.rate = segment->rate * segment->applied_rate; - queue_stream_event(pin, &stream_event); + queue_stream_event(stream, &stream_event); } break;
@@ -1119,7 +1117,7 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) struct wg_parser_event stream_event;
stream_event.type = WG_PARSER_EVENT_EOS; - queue_stream_event(pin, &stream_event); + queue_stream_event(stream, &stream_event); } else { @@ -1237,12 +1235,11 @@ static void *push_data(void *arg)
static GstFlowReturn got_data_sink(GstPad *pad, GstObject *parent, GstBuffer *buffer) { - struct parser_source *pin = gst_pad_get_element_private(pad); - struct wg_parser_stream *stream = pin->wg_stream; + struct wg_parser_stream *stream = gst_pad_get_element_private(pad); struct wg_parser_event stream_event; GstFlowReturn ret;
- GST_LOG("pin %p, buffer %p.", pin, buffer); + GST_LOG("stream %p, buffer %p.", stream, buffer);
if (!stream->enabled) { @@ -1253,7 +1250,7 @@ static GstFlowReturn got_data_sink(GstPad *pad, GstObject *parent, GstBuffer *bu stream_event.type = WG_PARSER_EVENT_BUFFER; stream_event.u.buffer = buffer; /* Transfer our reference to the buffer to the thread. */ - if ((ret = queue_stream_event(pin, &stream_event)) != GST_FLOW_OK) + if ((ret = queue_stream_event(stream, &stream_event)) != GST_FLOW_OK) gst_buffer_unref(buffer); return ret; } @@ -2842,6 +2839,7 @@ static struct parser_source *create_pin(struct parser *filter, const WCHAR *name } pin->wg_stream = stream;
+ stream->parser = parser; strmbase_source_init(&pin->pin, &filter->filter, name, &source_ops); pin->IQualityControl_iface.lpVtbl = &GSTOutPin_QualityControl_Vtbl; strmbase_seeking_init(&pin->seek, &GST_Seeking_Vtbl, GST_ChangeStop, @@ -2855,7 +2853,7 @@ static struct parser_source *create_pin(struct parser *filter, const WCHAR *name
sprintf(pad_name, "qz_sink_%u", filter->source_count); stream->my_sink = gst_pad_new(pad_name, GST_PAD_SINK); - gst_pad_set_element_private(stream->my_sink, pin); + gst_pad_set_element_private(stream->my_sink, stream); gst_pad_set_chain_function(stream->my_sink, got_data_sink); gst_pad_set_event_function(stream->my_sink, event_sink); gst_pad_set_query_function(stream->my_sink, query_sink);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 89 ++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 34 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index ba632f3297d..2767b027f92 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -168,7 +168,9 @@ static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0}; static const IMediaSeekingVtbl GST_Seeking_Vtbl; static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl;
-static struct parser_source *create_pin(struct parser *filter, const WCHAR *name); +static struct wg_parser_stream *create_stream(struct wg_parser *parser); +static struct parser_source *create_pin(struct parser *filter, + struct wg_parser_stream *stream, const WCHAR *name); static HRESULT GST_RemoveOutputPins(struct parser *This); static HRESULT WINAPI GST_ChangeCurrent(IMediaSeeking *iface); static HRESULT WINAPI GST_ChangeStop(IMediaSeeking *iface); @@ -1578,6 +1580,8 @@ static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user) g_free(name); }
+static void free_stream(struct wg_parser_stream *stream); + static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct parser *This) { static const WCHAR formatW[] = {'S','t','r','e','a','m',' ','%','0','2','u',0}; @@ -1604,12 +1608,14 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct parser *Th arg = gst_caps_get_structure(caps, 0); typename = gst_structure_get_name(arg);
- if (!(pin = create_pin(This, nameW))) + if (!(stream = create_stream(parser))) + goto out; + + if (!(pin = create_pin(This, stream, nameW))) { - ERR("Failed to allocate memory.\n"); + free_stream(stream); goto out; } - stream = pin->wg_stream;
if (!strcmp(typename, "video/x-raw")) { @@ -2813,53 +2819,56 @@ static const struct strmbase_source_ops source_ops = .source_disconnect = source_disconnect, };
-static struct parser_source *create_pin(struct parser *filter, const WCHAR *name) +static struct wg_parser_stream *create_stream(struct wg_parser *parser) { - struct wg_parser *parser = filter->wg_parser; - struct wg_parser_stream *stream; - struct parser_source *pin; + struct wg_parser_stream *stream, **new_array; char pad_name[19]; - void *new_array; - - if (!(new_array = heap_realloc(filter->sources, (filter->source_count + 1) * sizeof(*filter->sources)))) - return NULL; - filter->sources = new_array;
if (!(new_array = realloc(parser->streams, (parser->stream_count + 1) * sizeof(*parser->streams)))) return NULL; parser->streams = new_array;
- if (!(pin = heap_alloc_zero(sizeof(*pin)))) - return NULL; - if (!(stream = calloc(1, sizeof(*stream)))) - { - heap_free(pin); return NULL; - } - pin->wg_stream = stream;
stream->parser = parser; - strmbase_source_init(&pin->pin, &filter->filter, name, &source_ops); - pin->IQualityControl_iface.lpVtbl = &GSTOutPin_QualityControl_Vtbl; - strmbase_seeking_init(&pin->seek, &GST_Seeking_Vtbl, GST_ChangeStop, - GST_ChangeCurrent, GST_ChangeRate); pthread_cond_init(&stream->event_cond, NULL); pthread_cond_init(&stream->event_empty_cond, NULL); - BaseFilterImpl_IncrementPinVersion(&filter->filter); - - InitializeCriticalSection(&pin->flushing_cs); - pin->flushing_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": pin.flushing_cs");
- sprintf(pad_name, "qz_sink_%u", filter->source_count); + sprintf(pad_name, "qz_sink_%u", parser->stream_count); stream->my_sink = gst_pad_new(pad_name, GST_PAD_SINK); gst_pad_set_element_private(stream->my_sink, stream); gst_pad_set_chain_function(stream->my_sink, got_data_sink); gst_pad_set_event_function(stream->my_sink, event_sink); gst_pad_set_query_function(stream->my_sink, query_sink);
- filter->sources[filter->source_count++] = pin; parser->streams[parser->stream_count++] = stream; + return stream; +} + +static struct parser_source *create_pin(struct parser *filter, + struct wg_parser_stream *stream, const WCHAR *name) +{ + struct parser_source *pin, **new_array; + + if (!(new_array = heap_realloc(filter->sources, (filter->source_count + 1) * sizeof(*filter->sources)))) + return NULL; + filter->sources = new_array; + + if (!(pin = heap_alloc_zero(sizeof(*pin)))) + return NULL; + + pin->wg_stream = stream; + strmbase_source_init(&pin->pin, &filter->filter, name, &source_ops); + pin->IQualityControl_iface.lpVtbl = &GSTOutPin_QualityControl_Vtbl; + strmbase_seeking_init(&pin->seek, &GST_Seeking_Vtbl, GST_ChangeStop, + GST_ChangeCurrent, GST_ChangeRate); + BaseFilterImpl_IncrementPinVersion(&filter->filter); + + InitializeCriticalSection(&pin->flushing_cs); + pin->flushing_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": pin.flushing_cs"); + + filter->sources[filter->source_count++] = pin; return pin; }
@@ -2984,9 +2993,15 @@ static BOOL wave_parser_init_gst(struct parser *filter) return FALSE; }
- if (!(pin = create_pin(filter, source_name))) + if (!(stream = create_stream(parser))) + return FALSE; + + if (!(pin = create_pin(filter, stream, source_name))) + { + free_stream(stream); return FALSE; - stream = pin->wg_stream; + } + stream->their_src = gst_element_get_static_pad(element, "src"); gst_object_ref(stream->their_src); if ((ret = gst_pad_link(stream->their_src, stream->my_sink)) < 0) @@ -3228,9 +3243,15 @@ static BOOL mpeg_splitter_init_gst(struct parser *filter) return FALSE; }
- if (!(pin = create_pin(filter, source_name))) + if (!(stream = create_stream(parser))) return FALSE; - stream = pin->wg_stream; + + if (!(pin = create_pin(filter, stream, source_name))) + { + free_stream(stream); + return FALSE; + } + 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) {
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 38 ++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 12 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 2767b027f92..9ecd1e0b7fb 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1584,21 +1584,16 @@ static void free_stream(struct wg_parser_stream *stream);
static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct parser *This) { - static const WCHAR formatW[] = {'S','t','r','e','a','m',' ','%','0','2','u',0}; struct wg_parser *parser = This->wg_parser; struct wg_parser_stream *stream; const char *typename; char *name; GstCaps *caps; GstStructure *arg; - struct parser_source *pin; int ret; - WCHAR nameW[128];
TRACE("%p %p %p\n", This, bin, pad);
- sprintfW(nameW, formatW, This->source_count); - name = gst_pad_get_name(pad); TRACE("Name: %s\n", name); g_free(name); @@ -1611,12 +1606,6 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct parser *Th if (!(stream = create_stream(parser))) goto out;
- if (!(pin = create_pin(This, stream, nameW))) - { - free_stream(stream); - goto out; - } - if (!strcmp(typename, "video/x-raw")) { GstElement *deinterlace, *vconv, *flip, *vconv2; @@ -2203,8 +2192,11 @@ static const struct strmbase_sink_ops sink_ops =
static BOOL decodebin_parser_init_gst(struct parser *filter) { + static const WCHAR formatW[] = {'S','t','r','e','a','m',' ','%','0','2','u',0}; GstElement *element = gst_element_factory_make("decodebin", NULL); struct wg_parser *parser = filter->wg_parser; + WCHAR source_name[20]; + unsigned int i; int ret;
if (!element) @@ -2250,6 +2242,14 @@ static BOOL decodebin_parser_init_gst(struct parser *filter) return FALSE; } pthread_mutex_unlock(&parser->mutex); + + for (i = 0; i < parser->stream_count; ++i) + { + sprintfW(source_name, formatW, i); + if (!create_pin(filter, parser->streams[i], source_name)) + return FALSE; + } + return TRUE; }
@@ -2909,7 +2909,10 @@ static HRESULT GST_RemoveOutputPins(struct parser *This) CloseHandle(This->read_thread);
for (i = 0; i < This->source_count; ++i) - free_source_pin(This->sources[i]); + { + if (This->sources[i]) + free_source_pin(This->sources[i]); + }
This->source_count = 0; heap_free(This->sources); @@ -3094,8 +3097,11 @@ static const struct strmbase_sink_ops avi_splitter_sink_ops =
static BOOL avi_splitter_init_gst(struct parser *filter) { + static const WCHAR formatW[] = {'S','t','r','e','a','m',' ','%','0','2','u',0}; GstElement *element = gst_element_factory_make("avidemux", NULL); struct wg_parser *parser = filter->wg_parser; + WCHAR source_name[20]; + unsigned int i; int ret;
if (!element) @@ -3140,6 +3146,14 @@ static BOOL avi_splitter_init_gst(struct parser *filter) return FALSE; } pthread_mutex_unlock(&parser->mutex); + + for (i = 0; i < parser->stream_count; ++i) + { + sprintfW(source_name, formatW, i); + if (!create_pin(filter, parser->streams[i], source_name)) + return FALSE; + } + return TRUE; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 9ecd1e0b7fb..12e06ed9fd5 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1552,12 +1552,11 @@ static DWORD CALLBACK read_thread(void *arg)
static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user) { - struct parser *filter = user; - struct wg_parser *parser = filter->wg_parser; + struct wg_parser *parser = user; unsigned int i; char *name;
- GST_LOG("filter %p, bin %p, pad %p.", filter, bin, pad); + GST_LOG("parser %p, bin %p, pad %p.", parser, bin, pad);
for (i = 0; i < parser->stream_count; ++i) { @@ -1582,9 +1581,8 @@ static void removed_decoded_pad(GstElement *bin, GstPad *pad, gpointer user)
static void free_stream(struct wg_parser_stream *stream);
-static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct parser *This) +static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser *parser) { - struct wg_parser *parser = This->wg_parser; struct wg_parser_stream *stream; const char *typename; char *name; @@ -1592,7 +1590,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct parser *Th GstStructure *arg; int ret;
- TRACE("%p %p %p\n", This, bin, pad); + TRACE("parser %p, bin %p, pad %p.\n", parser, bin, pad);
name = gst_pad_get_name(pad); TRACE("Name: %s\n", name); @@ -1723,7 +1721,7 @@ out:
static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user) { - struct parser *This = user; + struct wg_parser *This = user;
TRACE("%p %p %p\n", This, bin, pad);
@@ -1816,10 +1814,9 @@ static gboolean activate_mode(GstPad *pad, GstObject *parent, GstPadMode mode, g
static void no_more_pads(GstElement *decodebin, gpointer user) { - struct parser *filter = user; - struct wg_parser *parser = filter->wg_parser; + struct wg_parser *parser = user;
- GST_DEBUG("filter %p.", filter); + GST_DEBUG("parser %p.", parser);
pthread_mutex_lock(&parser->mutex); parser->no_more_pads = true; @@ -2208,10 +2205,10 @@ static BOOL decodebin_parser_init_gst(struct parser *filter)
gst_bin_add(GST_BIN(parser->container), element);
- g_signal_connect(element, "pad-added", G_CALLBACK(existing_new_pad_wrapper), filter); - g_signal_connect(element, "pad-removed", G_CALLBACK(removed_decoded_pad), filter); - g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_blacklist), filter); - g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads), filter); + g_signal_connect(element, "pad-added", G_CALLBACK(existing_new_pad_wrapper), parser); + g_signal_connect(element, "pad-removed", G_CALLBACK(removed_decoded_pad), parser); + g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_blacklist), parser); + g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads), parser);
parser->their_sink = gst_element_get_static_pad(element, "sink");
@@ -3113,9 +3110,9 @@ static BOOL avi_splitter_init_gst(struct parser *filter)
gst_bin_add(GST_BIN(parser->container), element);
- g_signal_connect(element, "pad-added", G_CALLBACK(existing_new_pad_wrapper), filter); - g_signal_connect(element, "pad-removed", G_CALLBACK(removed_decoded_pad), filter); - g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads), filter); + g_signal_connect(element, "pad-added", G_CALLBACK(existing_new_pad_wrapper), parser); + g_signal_connect(element, "pad-removed", G_CALLBACK(removed_decoded_pad), parser); + g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads), parser);
parser->their_sink = gst_element_get_static_pad(element, "sink");
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 12e06ed9fd5..bc1bc71a907 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1585,17 +1585,10 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser { struct wg_parser_stream *stream; const char *typename; - char *name; GstCaps *caps; GstStructure *arg; int ret;
- TRACE("parser %p, bin %p, pad %p.\n", parser, bin, pad); - - name = gst_pad_get_name(pad); - TRACE("Name: %s\n", name); - g_free(name); - caps = gst_pad_query_caps(pad, NULL); caps = gst_caps_make_writable(caps); arg = gst_caps_get_structure(caps, 0); @@ -1612,7 +1605,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser * necessarily consume it. In particular, the video renderer can't. */ if (!(deinterlace = gst_element_factory_make("deinterlace", NULL))) { - ERR("Failed to create deinterlace, are %u-bit GStreamer "good" plugins installed?\n", + fprintf(stderr, "winegstreamer: failed to create deinterlace, are %u-bit GStreamer "good" plugins installed?\n", 8 * (int)sizeof(void *)); goto out; } @@ -1622,7 +1615,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser * formats either. Add a videoconvert to swap color spaces. */ if (!(vconv = gst_element_factory_make("videoconvert", NULL))) { - ERR("Failed to create videoconvert, are %u-bit GStreamer "base" plugins installed?\n", + fprintf(stderr, "winegstreamer: failed to create videoconvert, are %u-bit GStreamer "base" plugins installed?\n", 8 * (int)sizeof(void *)); goto out; } @@ -1630,7 +1623,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser /* GStreamer outputs RGB video top-down, but DirectShow expects bottom-up. */ if (!(flip = gst_element_factory_make("videoflip", NULL))) { - ERR("Failed to create videoflip, are %u-bit GStreamer "good" plugins installed?\n", + fprintf(stderr, "winegstreamer: failed to create videoflip, are %u-bit GStreamer "good" plugins installed?\n", 8 * (int)sizeof(void *)); goto out; } @@ -1639,7 +1632,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser * to do the final conversion. */ if (!(vconv2 = gst_element_factory_make("videoconvert", NULL))) { - ERR("Failed to create videoconvert, are %u-bit GStreamer "base" plugins installed?\n", + fprintf(stderr, "winegstreamer: failed to create videoconvert, are %u-bit GStreamer "base" plugins installed?\n", 8 * (int)sizeof(void *)); goto out; } @@ -1672,7 +1665,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser * depth and channel count. */ if (!(convert = gst_element_factory_make("audioconvert", NULL))) { - ERR("Failed to create audioconvert, are %u-bit GStreamer "base" plugins installed?\n", + fprintf(stderr, "winegstreamer: failed to create audioconvert, are %u-bit GStreamer "base" plugins installed?\n", 8 * (int)sizeof(void *)); goto out; } @@ -1688,7 +1681,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser { if ((ret = gst_pad_link(pad, stream->post_sink)) < 0) { - ERR("Failed to link decodebin source pad to post-processing elements, error %s.\n", + GST_ERROR("Failed to link decodebin source pad to post-processing elements, error %s.", gst_pad_link_get_name(ret)); gst_object_unref(stream->post_sink); stream->post_sink = NULL; @@ -1697,7 +1690,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser
if ((ret = gst_pad_link(stream->post_src, stream->my_sink)) < 0) { - ERR("Failed to link post-processing elements to our sink pad, error %s.\n", + GST_ERROR("Failed to link post-processing elements to our sink pad, error %s.", gst_pad_link_get_name(ret)); gst_object_unref(stream->post_src); stream->post_src = NULL; @@ -1708,7 +1701,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct wg_parser } else if ((ret = gst_pad_link(pad, stream->my_sink)) < 0) { - ERR("Failed to link decodebin source pad to our sink pad, error %s.\n", + GST_ERROR("Failed to link decodebin source pad to our sink pad, error %s.", gst_pad_link_get_name(ret)); goto out; } @@ -1723,7 +1716,7 @@ static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user) { struct wg_parser *This = user;
- TRACE("%p %p %p\n", This, bin, pad); + GST_LOG("parser %p, bin %p, pad %p.", This, bin, pad);
if (gst_pad_is_linked(pad)) return;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gst_cbs.c | 16 +--------------- dlls/winegstreamer/gst_cbs.h | 4 ---- dlls/winegstreamer/gstdemux.c | 21 ++------------------- 3 files changed, 3 insertions(+), 38 deletions(-)
diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c index 312c12fd194..d037c195971 100644 --- a/dlls/winegstreamer/gst_cbs.c +++ b/dlls/winegstreamer/gst_cbs.c @@ -47,10 +47,7 @@ static void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user) { struct cb_data *cbdata = user;
- if (cbdata->type < GSTDEMUX_MAX) - perform_cb_gstdemux(cbdata); - else if (cbdata->type < MEDIA_SOURCE_MAX) - perform_cb_media_source(cbdata); + perform_cb_media_source(cbdata);
pthread_mutex_lock(&cbdata->lock); cbdata->finished = 1; @@ -136,17 +133,6 @@ static void call_cb(struct cb_data *cbdata) pthread_mutex_destroy(&cbdata->lock); }
-void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) -{ - struct cb_data cbdata = { EXISTING_NEW_PAD }; - - cbdata.u.pad_added_data.element = bin; - cbdata.u.pad_added_data.pad = pad; - cbdata.u.pad_added_data.user = user; - - call_cb(&cbdata); -} - GstFlowReturn bytestream_wrapper_pull_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) { diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h index f6f1ffb526b..fd90373d900 100644 --- a/dlls/winegstreamer/gst_cbs.h +++ b/dlls/winegstreamer/gst_cbs.h @@ -30,8 +30,6 @@ typedef enum { } GstAutoplugSelectResult;
enum CB_TYPE { - EXISTING_NEW_PAD, - GSTDEMUX_MAX, BYTESTREAM_WRAPPER_PULL, BYTESTREAM_QUERY, BYTESTREAM_PAD_MODE_ACTIVATE, @@ -102,10 +100,8 @@ struct cb_data { };
void mark_wine_thread(void) DECLSPEC_HIDDEN; -void perform_cb_gstdemux(struct cb_data *data) DECLSPEC_HIDDEN; void perform_cb_media_source(struct cb_data *data) DECLSPEC_HIDDEN;
-void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; GstFlowReturn got_data_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN; void Gstreamer_transform_pad_added_wrapper(GstElement *filter, GstPad *pad, gpointer user) DECLSPEC_HIDDEN; GstFlowReturn bytestream_wrapper_pull_wrapper(GstPad *pad, GstObject *parent, guint64 ofs, guint len, GstBuffer **buf) DECLSPEC_HIDDEN; diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index bc1bc71a907..1e14f073480 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -2198,7 +2198,7 @@ static BOOL decodebin_parser_init_gst(struct parser *filter)
gst_bin_add(GST_BIN(parser->container), element);
- g_signal_connect(element, "pad-added", G_CALLBACK(existing_new_pad_wrapper), parser); + g_signal_connect(element, "pad-added", G_CALLBACK(existing_new_pad), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(removed_decoded_pad), parser); g_signal_connect(element, "autoplug-select", G_CALLBACK(autoplug_blacklist), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads), parser); @@ -2917,23 +2917,6 @@ static HRESULT GST_RemoveOutputPins(struct parser *This) return S_OK; }
-void perform_cb_gstdemux(struct cb_data *cbdata) -{ - switch(cbdata->type) - { - case EXISTING_NEW_PAD: - { - struct pad_added_data *data = &cbdata->u.pad_added_data; - existing_new_pad(data->element, data->pad, data->user); - break; - } - default: - { - assert(0); - } - } -} - static BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b) { return IsEqualGUID(&a->majortype, &b->majortype) @@ -3103,7 +3086,7 @@ static BOOL avi_splitter_init_gst(struct parser *filter)
gst_bin_add(GST_BIN(parser->container), element);
- g_signal_connect(element, "pad-added", G_CALLBACK(existing_new_pad_wrapper), parser); + g_signal_connect(element, "pad-added", G_CALLBACK(existing_new_pad), parser); g_signal_connect(element, "pad-removed", G_CALLBACK(removed_decoded_pad), parser); g_signal_connect(element, "no-more-pads", G_CALLBACK(no_more_pads), parser);