diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-07-04 09:21:00 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-30 12:25:08 +0100 |
commit | f349cdccf5e1538f3eb9caa31458b53fdd81671b (patch) | |
tree | 118e63c367cfec3b904487b7838588b4db6e3904 | |
parent | f3292dc1561a8d62812c3f1a2bb3de5c5bb6a807 (diff) | |
download | gst-plugins-base-f349cdccf5e1538f3eb9caa31458b53fdd81671b.tar.gz gst-plugins-base-f349cdccf5e1538f3eb9caa31458b53fdd81671b.tar.xz |
glupload: handle upload methods with different caps
If a upload method is selected then use it exclusively in transform_caps().
Also, reconfigure if the current caps don't match the current upload
method.
https://bugzilla.gnome.org/show_bug.cgi?id=783521
-rw-r--r-- | gst-libs/gst/gl/gstglupload.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 9df6c2afe..06878ed13 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -1665,6 +1665,21 @@ gst_gl_upload_transform_caps (GstGLUpload * upload, GstGLContext * context, GstCaps *result, *tmp; gint i; + if (upload->priv->method) { + tmp = upload->priv->method->transform_caps (upload->priv->method_impl, + context, direction, caps); + if (filter) { + result = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (tmp); + } else { + result = tmp; + } + if (!gst_caps_is_empty (result)) + return result; + else + gst_caps_unref (result); + } + tmp = gst_caps_new_empty (); for (i = 0; i < G_N_ELEMENTS (upload_methods); i++) { @@ -1868,6 +1883,15 @@ restart: } goto restart; } else if (ret == GST_GL_UPLOAD_DONE || ret == GST_GL_UPLOAD_RECONFIGURE) { + if (last_impl != upload->priv->method_impl) { + GstCaps *caps = gst_gl_upload_transform_caps (upload, upload->context, + GST_PAD_SINK, upload->priv->in_caps, NULL); + if (!gst_caps_is_equal (upload->priv->out_caps, caps)) { + gst_buffer_replace (&outbuf, NULL); + ret = GST_GL_UPLOAD_RECONFIGURE; + } + gst_caps_unref (caps); + } /* we are done */ } else { upload->priv->method_impl = NULL; |