winegstreamer: Add a second videoconvert to handle 15/16-bit RGB formats.

Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Anton Baskanov 2020-10-07 01:04:58 +07:00 committed by Alexandre Julliard
parent 9afc5ed72e
commit e484056171
1 changed files with 17 additions and 2 deletions

View File

@ -1003,7 +1003,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
if (!strcmp(typename, "video/x-raw"))
{
GstElement *vconv, *flip, *deinterlace;
GstElement *deinterlace, *vconv, *flip, *vconv2;
/* DirectShow can express interlaced video, but downstream filters can't
* necessarily consume it. In particular, the video renderer can't. */
@ -1035,6 +1035,18 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
goto out;
}
/* videoflip does not support 15 and 16-bit RGB so add a second videoconvert
* 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",
8 * (int)sizeof(void *));
goto out;
}
/* Avoid expensive color matrix conversions. */
gst_util_set_object_arg(G_OBJECT(vconv2), "matrix-mode", "none");
/* The bin takes ownership of these elements. */
gst_bin_add(GST_BIN(This->container), deinterlace);
gst_element_sync_state_with_parent(deinterlace);
@ -1042,12 +1054,15 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
gst_element_sync_state_with_parent(vconv);
gst_bin_add(GST_BIN(This->container), flip);
gst_element_sync_state_with_parent(flip);
gst_bin_add(GST_BIN(This->container), vconv2);
gst_element_sync_state_with_parent(vconv2);
gst_element_link(deinterlace, vconv);
gst_element_link(vconv, flip);
gst_element_link(flip, vconv2);
pin->post_sink = gst_element_get_static_pad(deinterlace, "sink");
pin->post_src = gst_element_get_static_pad(flip, "src");
pin->post_src = gst_element_get_static_pad(vconv2, "src");
pin->flip = flip;
}
else if (!strcmp(typename, "audio/x-raw"))