diff options
author | Alessandro Decina <alessandro.d@gmail.com> | 2016-08-29 15:43:10 +1000 |
---|---|---|
committer | Alessandro Decina <alessandro.d@gmail.com> | 2016-08-29 16:06:06 +1000 |
commit | a7dccec0fff373b0fb86374dd0026126ff7bbaa7 (patch) | |
tree | d1117e05e6984cca0e3ed7853096d912642e2e36 /gst-libs | |
parent | 2fb716409c928583ab2e8384eca261d0f45822dc (diff) | |
download | gstreamer-plugins-bad-a7dccec0fff373b0fb86374dd0026126ff7bbaa7.tar.gz |
glupload: fix tests and check for the new RECONFIGURE behaviour
The tests were broken since 91fea30, which changed glupload to return
GST_GL_UPLOAD_RECONFIGURE if the texture target in the input buffers doesn't
match the texture-target configured in the output caps.
This commit fixes that and adds more checks for the new behaviour.
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/gl/gstglupload.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 7075944ed..bfa5f2251 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -204,6 +204,7 @@ struct GLMemoryUpload { GstGLUpload *upload; GstGLTextureTarget input_target; + GstGLTextureTarget output_target; }; static gpointer @@ -213,6 +214,7 @@ _gl_memory_upload_new (GstGLUpload * upload) mem->upload = upload; mem->input_target = GST_GL_TEXTURE_TARGET_NONE; + mem->output_target = GST_GL_TEXTURE_TARGET_NONE; return mem; } @@ -420,8 +422,17 @@ _gl_memory_upload_perform (gpointer impl, GstBuffer * buffer, gl_mem->mem.context)) return GST_GL_UPLOAD_UNSHARED_GL_CONTEXT; - if (upload->input_target != gl_mem->tex_target) { - upload->input_target = gl_mem->tex_target; + if (upload->output_target == GST_GL_TEXTURE_TARGET_NONE && + upload->upload->priv->out_caps) { + upload->output_target = + _caps_get_texture_target (upload->upload->priv->out_caps, + GST_GL_TEXTURE_TARGET_NONE); + } + + /* always track the last input texture target so ::transform_caps() can + * use it to build the output caps */ + upload->input_target = gl_mem->tex_target; + if (upload->output_target != gl_mem->tex_target) { *outbuf = NULL; return GST_GL_UPLOAD_RECONFIGURE; } |