mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
gl: Don't use the full transform_caps() method for reconfiguration check
When checking if we need to reconfigure when uploading, check specifically the output caps of the current method will result in compatible/incompatible caps, not the full set of output caps from all upload methods. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2687>
This commit is contained in:
parent
ae781610c8
commit
342f02015b
1 changed files with 19 additions and 5 deletions
|
@ -2544,6 +2544,9 @@ gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer,
|
|||
GstGLUploadReturn ret = GST_GL_UPLOAD_ERROR;
|
||||
GstBuffer *outbuf = NULL;
|
||||
gpointer last_impl = upload->priv->method_impl;
|
||||
#if !defined (GST_DISABLE_DEBUG)
|
||||
const UploadMethod *last_method = upload->priv->method;
|
||||
#endif
|
||||
|
||||
g_return_val_if_fail (GST_IS_GL_UPLOAD (upload), FALSE);
|
||||
g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
|
||||
|
@ -2589,14 +2592,25 @@ restart:
|
|||
gst_buffer_replace (&outbuf, NULL);
|
||||
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_subset (caps, upload->priv->out_caps)) {
|
||||
if (last_impl != upload->priv->method_impl
|
||||
&& upload->priv->method_impl != NULL) {
|
||||
/* Transform the input caps using the new method. If they are compatible with the
|
||||
* existing upload method, we can skip reconfiguration */
|
||||
GstCaps *caps =
|
||||
upload->priv->method->transform_caps (upload->priv->method_impl,
|
||||
upload->context, GST_PAD_SINK, upload->priv->in_caps);
|
||||
|
||||
GST_LOG_OBJECT (upload,
|
||||
"Changing uploader from %s to %s with src caps %" GST_PTR_FORMAT
|
||||
" and old src caps %" GST_PTR_FORMAT,
|
||||
last_method != NULL ? last_method->name : "None",
|
||||
upload->priv->method->name, caps, upload->priv->out_caps);
|
||||
|
||||
if (caps == NULL || !gst_caps_is_subset (caps, upload->priv->out_caps)) {
|
||||
gst_buffer_replace (&outbuf, NULL);
|
||||
ret = GST_GL_UPLOAD_RECONFIGURE;
|
||||
}
|
||||
gst_caps_unref (caps);
|
||||
gst_caps_replace (&caps, NULL);
|
||||
}
|
||||
/* we are done */
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue