Commit e4840561 authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

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

parent 9afc5ed7
......@@ -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"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment