Jan Schmidt : winegstreamer: Do conversion before flipping.

Alexandre Julliard julliard at winehq.org
Mon Jul 18 09:22:34 CDT 2016


Module: wine
Branch: master
Commit: 4aefacd16239659724e4449b7184a44ee6ae09f6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4aefacd16239659724e4449b7184a44ee6ae09f6

Author: Jan Schmidt <jan at centricular.com>
Date:   Sun Jul 17 14:58:21 2016 +1000

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 <jan at centricular.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 21385d7..6f98521 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);




More information about the wine-cvs mailing list