Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index e15072f6aa4..adffee3d24a 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -79,7 +79,7 @@ struct gstdemux_source GstPad *flip_sink, *flip_src; GstPad *their_src; GstPad *my_sink; - AM_MEDIA_TYPE * pmt; + AM_MEDIA_TYPE mt; HANDLE caps_event; GstSegment *segment; SourceSeeking seek; @@ -104,7 +104,7 @@ static const IPinVtbl GST_InputPin_Vtbl; static const IBaseFilterVtbl GST_Vtbl; static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl;
-static BOOL create_pin(struct gstdemux *filter, const WCHAR *name, const AM_MEDIA_TYPE *mt); +static BOOL create_pin(struct gstdemux *filter, const WCHAR *name); static HRESULT GST_RemoveOutputPins(struct gstdemux *This); static HRESULT WINAPI GST_ChangeCurrent(IMediaSeeking *iface); static HRESULT WINAPI GST_ChangeStop(IMediaSeeking *iface); @@ -285,21 +285,25 @@ static gboolean setcaps_sink(GstPad *pad, GstCaps *caps) { struct gstdemux_source *pin = gst_pad_get_element_private(pad); struct gstdemux *This = impl_from_strmbase_filter(pin->pin.pin.filter); - AM_MEDIA_TYPE amt; GstStructure *arg; const char *typename; gboolean ret;
TRACE("%p %p\n", pad, caps);
+ FreeMediaType(&pin->mt); + arg = gst_caps_get_structure(caps, 0); typename = gst_structure_get_name(arg); if (!strcmp(typename, "audio/x-raw")) { - ret = amt_from_gst_caps_audio(caps, &amt); + ret = amt_from_gst_caps_audio(caps, &pin->mt); } else if (!strcmp(typename, "video/x-raw")) { - ret = amt_from_gst_caps_video(caps, &amt); + ret = amt_from_gst_caps_video(caps, &pin->mt); if (ret) - This->props.cbBuffer = max(This->props.cbBuffer, ((VIDEOINFOHEADER*)amt.pbFormat)->bmiHeader.biSizeImage); + { + VIDEOINFOHEADER *vih = (VIDEOINFOHEADER *)pin->mt.pbFormat; + This->props.cbBuffer = max(This->props.cbBuffer, vih->bmiHeader.biSizeImage); + } } else { FIXME("Unhandled type "%s"\n", typename); return FALSE; @@ -307,8 +311,6 @@ static gboolean setcaps_sink(GstPad *pad, GstCaps *caps) TRACE("Linking returned %i for %s\n", ret, typename); if (!ret) return FALSE; - FreeMediaType(pin->pmt); - *pin->pmt = amt; SetEvent(pin->caps_event); return TRUE; } @@ -762,7 +764,6 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux * { const char *typename; char *name; - AM_MEDIA_TYPE amt = {{0}}; GstCaps *caps; GstStructure *arg; GstPad *mypad; @@ -797,7 +798,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux * return; }
- if (!create_pin(This, nameW, &amt)) + if (!create_pin(This, nameW)) { ERR("Failed to allocate memory.\n"); return; @@ -1666,7 +1667,7 @@ static HRESULT WINAPI GSTOutPin_GetMediaType(BasePin *iface, int iPosition, AM_M if (iPosition > 0) return VFW_S_NO_MORE_ITEMS;
- CopyMediaType(pmt, This->pmt); + CopyMediaType(pmt, &This->mt);
return S_OK; } @@ -1731,7 +1732,7 @@ static void free_source_pin(struct gstdemux_source *pin) } gst_object_unref(pin->my_sink); CloseHandle(pin->caps_event); - DeleteMediaType(pin->pmt); + FreeMediaType(&pin->mt); gst_segment_free(pin->segment);
strmbase_source_cleanup(&pin->pin); @@ -1770,7 +1771,7 @@ static const struct strmbase_source_ops source_ops = GSTOutPin_DecideAllocator, };
-static BOOL create_pin(struct gstdemux *filter, const WCHAR *name, const AM_MEDIA_TYPE *mt) +static BOOL create_pin(struct gstdemux *filter, const WCHAR *name) { struct gstdemux_source *pin, **new_array;
@@ -1783,8 +1784,6 @@ static BOOL create_pin(struct gstdemux *filter, const WCHAR *name, const AM_MEDI
strmbase_source_init(&pin->pin, &GST_OutputPin_Vtbl, &filter->filter, name, &source_ops); - pin->pmt = heap_alloc(sizeof(AM_MEDIA_TYPE)); - CopyMediaType(pin->pmt, mt); pin->caps_event = CreateEventW(NULL, FALSE, FALSE, NULL); pin->segment = gst_segment_new(); pin->IQualityControl_iface.lpVtbl = &GSTOutPin_QualityControl_Vtbl;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 59 ++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 26 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index adffee3d24a..e76ceda0fe6 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -254,12 +254,15 @@ static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt)
static gboolean accept_caps_sink(GstPad *pad, GstCaps *caps) { + struct gstdemux_source *pin = gst_pad_get_element_private(pad); + gchar *caps_str = gst_caps_to_string(caps); AM_MEDIA_TYPE amt; GstStructure *arg; const char *typename; gboolean ret;
- TRACE("%p %p\n", pad, caps); + TRACE("pin %p, caps %s.\n", pin, debugstr_a(caps_str)); + g_free(caps_str);
arg = gst_caps_get_structure(caps, 0); typename = gst_structure_get_name(arg); @@ -284,12 +287,14 @@ static gboolean accept_caps_sink(GstPad *pad, GstCaps *caps) static gboolean setcaps_sink(GstPad *pad, GstCaps *caps) { struct gstdemux_source *pin = gst_pad_get_element_private(pad); - struct gstdemux *This = impl_from_strmbase_filter(pin->pin.pin.filter); + struct gstdemux *filter = impl_from_strmbase_filter(pin->pin.pin.filter); + gchar *caps_str = gst_caps_to_string(caps); GstStructure *arg; const char *typename; gboolean ret;
- TRACE("%p %p\n", pad, caps); + TRACE("filter %p, caps %s.\n", filter, debugstr_a(caps_str)); + g_free(caps_str);
FreeMediaType(&pin->mt);
@@ -302,7 +307,7 @@ static gboolean setcaps_sink(GstPad *pad, GstCaps *caps) if (ret) { VIDEOINFOHEADER *vih = (VIDEOINFOHEADER *)pin->mt.pbFormat; - This->props.cbBuffer = max(This->props.cbBuffer, vih->bmiHeader.biSizeImage); + filter->props.cbBuffer = max(filter->props.cbBuffer, vih->bmiHeader.biSizeImage); } } else { FIXME("Unhandled type "%s"\n", typename); @@ -345,13 +350,12 @@ static gboolean gst_base_src_perform_seek(struct gstdemux *This, GstEvent *event GstEvent *tevent; BOOL thread = !!This->push_thread;
- TRACE("%p %p\n", This, event); - gst_event_parse_seek(event, &rate, &seek_format, &flags, &cur_type, &cur, &stop_type, &stop);
- if (seek_format != GST_FORMAT_BYTES) { - FIXME("Not handling other format %i\n", seek_format); + if (seek_format != GST_FORMAT_BYTES) + { + FIXME("Unhandled format "%s".\n", gst_format_get_name(seek_format)); return FALSE; }
@@ -389,7 +393,7 @@ static gboolean event_src(GstPad *pad, GstObject *parent, GstEvent *event) { struct gstdemux *This = gst_pad_get_element_private(pad);
- TRACE("%p %p\n", pad, event); + TRACE("filter %p, type "%s".\n", This, GST_EVENT_TYPE_NAME(event));
switch (event->type) { case GST_EVENT_SEEK: @@ -407,7 +411,7 @@ static gboolean event_src(GstPad *pad, GstObject *parent, GstEvent *event) LeaveCriticalSection(&This->filter.csFilter); break; default: - FIXME("%p (%u) stub\n", event, event->type); + WARN("Ignoring "%s" event.\n", GST_EVENT_TYPE_NAME(event)); case GST_EVENT_TAG: case GST_EVENT_QOS: case GST_EVENT_RECONFIGURE: @@ -420,7 +424,7 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) { struct gstdemux_source *pin = gst_pad_get_element_private(pad);
- TRACE("%p %p\n", pad, event); + TRACE("pin %p, type "%s".\n", pin, GST_EVENT_TYPE_NAME(event));
switch (event->type) { case GST_EVENT_SEGMENT: { @@ -435,8 +439,9 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) rate = segment->rate; applied_rate = segment->applied_rate;
- if (segment->format != GST_FORMAT_TIME) { - FIXME("Ignoring new segment because of format %i\n", segment->format); + if (segment->format != GST_FORMAT_TIME) + { + FIXME("Unhandled format "%s".\n", gst_format_get_name(segment->format)); return TRUE; }
@@ -482,7 +487,7 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event) return setcaps_sink(pad, caps); } default: - TRACE("%p stub %s\n", event, gst_event_type_get_name(event->type)); + WARN("Ignoring "%s" event.\n", GST_EVENT_TYPE_NAME(event)); return gst_pad_event_default(pad, parent, event); } } @@ -940,7 +945,7 @@ static gboolean query_function(GstPad *pad, GstObject *parent, GstQuery *query) int ret; LONGLONG duration;
- TRACE("%p %p %p\n", This, pad, query); + TRACE("filter %p, type %s.\n", This, GST_QUERY_TYPE_NAME(query));
switch (GST_QUERY_TYPE(query)) { case GST_QUERY_DURATION: @@ -954,9 +959,11 @@ static gboolean query_function(GstPad *pad, GstObject *parent, GstQuery *query) return ret; case GST_QUERY_SEEKING: gst_query_parse_seeking (query, &format, NULL, NULL, NULL); - TRACE("Seeking %i %i\n", format, GST_FORMAT_BYTES); if (format != GST_FORMAT_BYTES) + { + WARN("Cannot seek using format "%s".\n", gst_format_get_name(format)); return FALSE; + } gst_query_set_seeking(query, GST_FORMAT_BYTES, 1, 0, This->filesize); return TRUE; case GST_QUERY_SCHEDULING: @@ -965,7 +972,7 @@ static gboolean query_function(GstPad *pad, GstObject *parent, GstQuery *query) gst_query_add_scheduling_mode(query, GST_PAD_MODE_PULL); return TRUE; default: - TRACE("Unhandled query type: %s\n", GST_QUERY_TYPE_NAME(query)); + WARN("Unhandled query type %s.\n", GST_QUERY_TYPE_NAME(query)); return FALSE; } } @@ -974,8 +981,6 @@ static gboolean activate_push(GstPad *pad, gboolean activate) { struct gstdemux *This = gst_pad_get_element_private(pad);
- TRACE("%p %p %u\n", This, pad, activate); - EnterCriticalSection(&This->filter.csFilter); if (!activate) { TRACE("Deactivating\n"); @@ -1003,7 +1008,11 @@ static gboolean activate_push(GstPad *pad, gboolean activate)
static gboolean activate_mode(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) { - TRACE("%p %p 0x%x %u\n", pad, parent, mode, activate); + struct gstdemux *filter = gst_pad_get_element_private(pad); + + TRACE("%s source pad for filter %p in %s mode.\n", + activate ? "Activating" : "Deactivating", filter, gst_pad_mode_get_name(mode)); + switch (mode) { case GST_PAD_MODE_PULL: return TRUE; @@ -1017,9 +1026,9 @@ static gboolean activate_mode(GstPad *pad, GstObject *parent, GstPadMode mode, g
static void no_more_pads(GstElement *decodebin, gpointer user) { - struct gstdemux *This = user; - TRACE("%p %p\n", This, decodebin); - SetEvent(This->no_more_pads_event); + struct gstdemux *filter = user; + TRACE("filter %p.\n", filter); + SetEvent(filter->no_more_pads_event); }
static GstAutoplugSelectResult autoplug_blacklist(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *fact, gpointer user) @@ -1044,7 +1053,7 @@ static GstBusSyncReply watch_bus(GstBus *bus, GstMessage *msg, gpointer data) GError *err = NULL; gchar *dbg_info = NULL;
- TRACE("%p %p %p\n", This, bus, msg); + TRACE("filter %p, message type %s.\n", This, GST_MESSAGE_TYPE_NAME(msg));
if (GST_MESSAGE_TYPE(msg) & GST_MESSAGE_ERROR) { gst_message_parse_error(msg, &err, &dbg_info); @@ -2014,8 +2023,6 @@ void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user) { struct cb_data *cbdata = user;
- TRACE("got cb type: 0x%x\n", cbdata->type); - switch(cbdata->type) { case WATCH_BUS:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56513
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:104 error: patch failed: dlls/winegstreamer/gstdemux.c:284 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:104 error: patch failed: dlls/winegstreamer/gstdemux.c:284 Task: Patch failed to apply
The "bits" field does not directly describe the total bit depth.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index e76ceda0fe6..b92bdfd7e49 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -207,16 +207,23 @@ static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt) amt->pUnk = NULL; ZeroMemory(vih, sizeof(*vih)); amt->majortype = MEDIATYPE_Video; - if (GST_VIDEO_INFO_IS_RGB(&vinfo)) { - bih->biBitCount = GST_VIDEO_FORMAT_INFO_BITS(vinfo.finfo); - switch (bih->biBitCount) { - case 16: amt->subtype = MEDIASUBTYPE_RGB555; break; - case 24: amt->subtype = MEDIASUBTYPE_RGB24; break; - case 32: amt->subtype = MEDIASUBTYPE_RGB32; break; - default: - FIXME("Unknown bpp %u\n", bih->biBitCount); - heap_free(vih); - return FALSE; + + if (GST_VIDEO_INFO_IS_RGB(&vinfo)) + { + switch (vinfo.finfo->format) + { + case GST_VIDEO_FORMAT_BGRx: + amt->subtype = MEDIASUBTYPE_RGB32; + bih->biBitCount = 32; + break; + case GST_VIDEO_FORMAT_BGR: + amt->subtype = MEDIASUBTYPE_RGB24; + bih->biBitCount = 24; + break; + default: + FIXME("Unhandled type %u.\n", vinfo.finfo->format); + heap_free(vih); + return FALSE; } bih->biCompression = BI_RGB; } else {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56514
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:104 error: patch failed: dlls/winegstreamer/gstdemux.c:284 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:104 error: patch failed: dlls/winegstreamer/gstdemux.c:284 Task: Patch failed to apply
On 14/9/19 7:37 am, Zebediah Figura wrote:
The "bits" field does not directly describe the total bit depth.
Signed-off-by: Zebediah Figura z.figura12@gmail.com
dlls/winegstreamer/gstdemux.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index e76ceda0fe6..b92bdfd7e49 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -207,16 +207,23 @@ static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt) amt->pUnk = NULL; ZeroMemory(vih, sizeof(*vih)); amt->majortype = MEDIATYPE_Video;
- if (GST_VIDEO_INFO_IS_RGB(&vinfo)) {
bih->biBitCount = GST_VIDEO_FORMAT_INFO_BITS(vinfo.finfo);
switch (bih->biBitCount) {
case 16: amt->subtype = MEDIASUBTYPE_RGB555; break;
case 24: amt->subtype = MEDIASUBTYPE_RGB24; break;
case 32: amt->subtype = MEDIASUBTYPE_RGB32; break;
default:
FIXME("Unknown bpp %u\n", bih->biBitCount);
heap_free(vih);
return FALSE;
- if (GST_VIDEO_INFO_IS_RGB(&vinfo))
- {
switch (vinfo.finfo->format)
{
case GST_VIDEO_FORMAT_BGRx:
amt->subtype = MEDIASUBTYPE_RGB32;
bih->biBitCount = 32;
break;
case GST_VIDEO_FORMAT_BGR:
amt->subtype = MEDIASUBTYPE_RGB24;
bih->biBitCount = 24;
break;
default:
FIXME("Unhandled type %u.\n", vinfo.finfo->format);
heap_free(vih);
return FALSE;
This seems generally correct - a 32-bit format could be RGB32, or *MEDIASUBTYPE_ARGB32.*
*You seem to have dropped the 16-bit format handling though? Not so common any more, but used to be more popular in older games and things.*
*- Jan. *
* *
* *
} bih->biCompression = BI_RGB; } else {
On 9/14/19 4:51 AM, Jan Schmidt wrote:
On 14/9/19 7:37 am, Zebediah Figura wrote:
The "bits" field does not directly describe the total bit depth.
Signed-off-by: Zebediah Figura z.figura12@gmail.com
dlls/winegstreamer/gstdemux.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index e76ceda0fe6..b92bdfd7e49 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -207,16 +207,23 @@ static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt) amt->pUnk = NULL; ZeroMemory(vih, sizeof(*vih)); amt->majortype = MEDIATYPE_Video;
- if (GST_VIDEO_INFO_IS_RGB(&vinfo)) {
bih->biBitCount = GST_VIDEO_FORMAT_INFO_BITS(vinfo.finfo);
switch (bih->biBitCount) {
case 16: amt->subtype = MEDIASUBTYPE_RGB555; break;
case 24: amt->subtype = MEDIASUBTYPE_RGB24; break;
case 32: amt->subtype = MEDIASUBTYPE_RGB32; break;
default:
FIXME("Unknown bpp %u\n", bih->biBitCount);
heap_free(vih);
return FALSE;
- if (GST_VIDEO_INFO_IS_RGB(&vinfo))
- {
switch (vinfo.finfo->format)
{
case GST_VIDEO_FORMAT_BGRx:
amt->subtype = MEDIASUBTYPE_RGB32;
bih->biBitCount = 32;
break;
case GST_VIDEO_FORMAT_BGR:
amt->subtype = MEDIASUBTYPE_RGB24;
bih->biBitCount = 24;
break;
default:
FIXME("Unhandled type %u.\n", vinfo.finfo->format);
heap_free(vih);
return FALSE;
This seems generally correct - a 32-bit format could be RGB32, or *MEDIASUBTYPE_ARGB32.*
That, and the "bits" field reports 8 for both ;-)
*You seem to have dropped the 16-bit format handling though? Not so common any more, but used to be more popular in older games and things.*
Thanks for calling that to my attention. I originally assumed it wasn't supported, because libgstriff doesn't handle it and I managed to overlook it in the GstVideoFormat enum, but in fact it's GST_VIDEO_FORMAT_BGR15. I'll send a v2 restoring that.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gstdemux.c | 69 ++++++++++++++--------------------- 1 file changed, 27 insertions(+), 42 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index b92bdfd7e49..9e6b95ba375 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -121,7 +121,7 @@ BOOL is_wine_thread(void) return pthread_getspecific(wine_gst_key) != NULL; }
-static gboolean amt_from_gst_caps_audio(GstCaps *caps, AM_MEDIA_TYPE *amt) +static gboolean amt_from_gst_caps_audio(const GstCaps *caps, AM_MEDIA_TYPE *amt) { WAVEFORMATEXTENSIBLE *wfe; WAVEFORMATEX *wfx; @@ -182,7 +182,7 @@ static gboolean amt_from_gst_caps_audio(GstCaps *caps, AM_MEDIA_TYPE *amt) return TRUE; }
-static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt) +static gboolean amt_from_gst_caps_video(const GstCaps *caps, AM_MEDIA_TYPE *amt) { VIDEOINFOHEADER *vih; BITMAPINFOHEADER *bih; @@ -259,36 +259,34 @@ static gboolean amt_from_gst_caps_video(GstCaps *caps, AM_MEDIA_TYPE *amt) return TRUE; }
+static gboolean amt_from_gst_caps(const GstCaps *caps, AM_MEDIA_TYPE *mt) +{ + const char *type = gst_structure_get_name(gst_caps_get_structure(caps, 0)); + + if (!strcmp(type, "audio/x-raw")) + return amt_from_gst_caps_audio(caps, mt); + else if (!strcmp(type, "video/x-raw")) + return amt_from_gst_caps_video(caps, mt); + else + { + FIXME("Unhandled type %s.\n", debugstr_a(type)); + return FALSE; + } +} + static gboolean accept_caps_sink(GstPad *pad, GstCaps *caps) { struct gstdemux_source *pin = gst_pad_get_element_private(pad); gchar *caps_str = gst_caps_to_string(caps); - AM_MEDIA_TYPE amt; - GstStructure *arg; - const char *typename; + AM_MEDIA_TYPE mt; gboolean ret;
TRACE("pin %p, caps %s.\n", pin, debugstr_a(caps_str)); g_free(caps_str);
- arg = gst_caps_get_structure(caps, 0); - typename = gst_structure_get_name(arg); - if (!strcmp(typename, "audio/x-raw")) { - ret = amt_from_gst_caps_audio(caps, &amt); - if (ret) - FreeMediaType(&amt); - TRACE("+%i\n", ret); - return ret; - } else if (!strcmp(typename, "video/x-raw")) { - ret = amt_from_gst_caps_video(caps, &amt); - if (ret) - FreeMediaType(&amt); - TRACE("-%i\n", ret); - return ret; - } else { - FIXME("Unhandled type "%s"\n", typename); - return FALSE; - } + if ((ret = amt_from_gst_caps(caps, &mt))) + FreeMediaType(&mt); + return ret; }
static gboolean setcaps_sink(GstPad *pad, GstCaps *caps) @@ -296,33 +294,20 @@ static gboolean setcaps_sink(GstPad *pad, GstCaps *caps) struct gstdemux_source *pin = gst_pad_get_element_private(pad); struct gstdemux *filter = impl_from_strmbase_filter(pin->pin.pin.filter); gchar *caps_str = gst_caps_to_string(caps); - GstStructure *arg; - const char *typename; - gboolean ret;
TRACE("filter %p, caps %s.\n", filter, debugstr_a(caps_str)); g_free(caps_str);
FreeMediaType(&pin->mt);
- arg = gst_caps_get_structure(caps, 0); - typename = gst_structure_get_name(arg); - if (!strcmp(typename, "audio/x-raw")) { - ret = amt_from_gst_caps_audio(caps, &pin->mt); - } else if (!strcmp(typename, "video/x-raw")) { - ret = amt_from_gst_caps_video(caps, &pin->mt); - if (ret) - { - VIDEOINFOHEADER *vih = (VIDEOINFOHEADER *)pin->mt.pbFormat; - filter->props.cbBuffer = max(filter->props.cbBuffer, vih->bmiHeader.biSizeImage); - } - } else { - FIXME("Unhandled type "%s"\n", typename); + if (!amt_from_gst_caps(caps, &pin->mt)) return FALSE; + + if (IsEqualGUID(&pin->mt.formattype, &FORMAT_VideoInfo)) + { + VIDEOINFOHEADER *vih = (VIDEOINFOHEADER *)pin->mt.pbFormat; + filter->props.cbBuffer = max(filter->props.cbBuffer, vih->bmiHeader.biSizeImage); } - TRACE("Linking returned %i for %s\n", ret, typename); - if (!ret) - return FALSE; SetEvent(pin->caps_event); return TRUE; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56515
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:104 error: patch failed: dlls/winegstreamer/gstdemux.c:284 error: patch failed: dlls/winegstreamer/gstdemux.c:259 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:104 error: patch failed: dlls/winegstreamer/gstdemux.c:284 error: patch failed: dlls/winegstreamer/gstdemux.c:259 Task: Patch failed to apply
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56512
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:104 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:104 Task: Patch failed to apply