From 4aefacd16239659724e4449b7184a44ee6ae09f6 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 17 Jul 2016 14:58:21 +1000 Subject: [PATCH] winegstreamer: Do conversion before flipping. The videoflip element doesn't handle all formats, so some formats like Intel Indeo 3 will cause errors and fail. Add videoconvert before videoflip to do format conversion when it's needed. Signed-off-by: Jan Schmidt Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/winegstreamer/gstdemux.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 21385d75d8b..6f98521b9b2 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -831,11 +831,20 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, GSTImpl *This) gst_segment_init(pin->segment, GST_FORMAT_TIME); if (isvid) { + GstElement *vconv; + TRACE("setting up videoflip filter for pin %p, my_sink: %p, their_src: %p\n", pin, pin->my_sink, pad); /* gstreamer outputs video top-down, but dshow expects bottom-up, so * make new transform filter to invert video */ + vconv = gst_element_factory_make("videoconvert", NULL); + if(!vconv){ + ERR("Missing videoconvert filter?\n"); + ret = -1; + goto exit; + } + pin->flipfilter = gst_element_factory_make("videoflip", NULL); if(!pin->flipfilter){ ERR("Missing videoflip filter?\n"); @@ -845,10 +854,14 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, GSTImpl *This) gst_util_set_object_arg(G_OBJECT(pin->flipfilter), "method", "vertical-flip"); - gst_bin_add(GST_BIN(This->container), pin->flipfilter); + gst_bin_add(GST_BIN(This->container), vconv); /* bin takes ownership */ + gst_element_sync_state_with_parent(vconv); + gst_bin_add(GST_BIN(This->container), pin->flipfilter); /* bin takes ownership */ gst_element_sync_state_with_parent(pin->flipfilter); - pin->flip_sink = gst_element_get_static_pad(pin->flipfilter, "sink"); + gst_element_link (vconv, pin->flipfilter); + + pin->flip_sink = gst_element_get_static_pad(vconv, "sink"); if(!pin->flip_sink){ WARN("Couldn't find sink on flip filter\n"); gst_object_unref(pin->flipfilter);