[PATCH 2/3] winegstreamer: Add a videobox element to the default video pipeline.

Rémi Bernon rbernon at codeweavers.com
Wed Oct 27 10:04:15 CDT 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/winegstreamer/wg_parser.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index c3c9051a174..a3b88529c60 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -97,7 +97,7 @@ struct wg_parser_stream
     struct wg_parser *parser;
 
     GstPad *their_src, *post_sink, *post_src, *my_sink;
-    GstElement *flip;
+    GstElement *flip, *videobox;
     GstSegment segment;
     struct wg_format preferred_format, current_format;
 
@@ -1150,7 +1150,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
 
     if (!strcmp(name, "video/x-raw"))
     {
-        GstElement *deinterlace, *vconv, *flip, *vconv2;
+        GstElement *deinterlace, *vconv, *flip, *vconv2, *videobox;
 
         /* DirectShow can express interlaced video, but downstream filters can't
          * necessarily consume it. In particular, the video renderer can't. */
@@ -1167,6 +1167,11 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
         if (!(flip = create_element("videoflip", "good")))
             goto out;
 
+        /* GStreamer uses a different alignment from native for some video formats,
+         * we'll need to add some padding. */
+        if (!(videobox = create_element("videobox", "good")))
+            goto out;
+
         /* videoflip does not support 15 and 16-bit RGB so add a second videoconvert
          * to do the final conversion. */
         if (!(vconv2 = create_element("videoconvert", "base")))
@@ -1179,16 +1184,20 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
         gst_element_sync_state_with_parent(vconv);
         gst_bin_add(GST_BIN(parser->container), flip);
         gst_element_sync_state_with_parent(flip);
+        gst_bin_add(GST_BIN(parser->container), videobox);
+        gst_element_sync_state_with_parent(videobox);
         gst_bin_add(GST_BIN(parser->container), vconv2);
         gst_element_sync_state_with_parent(vconv2);
 
         gst_element_link(deinterlace, vconv);
         gst_element_link(vconv, flip);
-        gst_element_link(flip, vconv2);
+        gst_element_link(flip, videobox);
+        gst_element_link(videobox, vconv2);
 
         stream->post_sink = gst_element_get_static_pad(deinterlace, "sink");
         stream->post_src = gst_element_get_static_pad(vconv2, "src");
         stream->flip = flip;
+        stream->videobox = videobox;
     }
     else if (!strcmp(name, "audio/x-raw"))
     {
-- 
2.33.0




More information about the wine-devel mailing list