diff options
Diffstat (limited to 'ext/gl/gstgluploadelement.c')
-rw-r--r-- | ext/gl/gstgluploadelement.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/ext/gl/gstgluploadelement.c b/ext/gl/gstgluploadelement.c index bebb6f3e5..3340e95be 100644 --- a/ext/gl/gstgluploadelement.c +++ b/ext/gl/gstgluploadelement.c @@ -39,8 +39,6 @@ G_DEFINE_TYPE_WITH_CODE (GstGLUploadElement, gst_gl_upload_element, static gboolean gst_gl_upload_element_get_unit_size (GstBaseTransform * trans, GstCaps * caps, gsize * size); -static gboolean gst_gl_upload_element_query (GstBaseTransform * bt, - GstPadDirection direction, GstQuery * query); static GstCaps *_gst_gl_upload_element_transform_caps (GstBaseTransform * bt, GstPadDirection direction, GstCaps * caps, GstCaps * filter); static gboolean _gst_gl_upload_element_set_caps (GstBaseTransform * bt, @@ -71,7 +69,6 @@ gst_gl_upload_element_class_init (GstGLUploadElementClass * klass) GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstCaps *upload_caps; - bt_class->query = gst_gl_upload_element_query; bt_class->transform_caps = _gst_gl_upload_element_transform_caps; bt_class->set_caps = _gst_gl_upload_element_set_caps; bt_class->filter_meta = gst_gl_upload_element_filter_meta; @@ -199,38 +196,21 @@ _gst_gl_upload_element_set_caps (GstBaseTransform * bt, GstCaps * in_caps, gst_caps_replace (&upload->in_caps, in_caps); gst_caps_replace (&upload->out_caps, out_caps); - if (upload->upload) { - gst_gl_upload_release_buffer (upload->upload); + if (upload->upload) return gst_gl_upload_set_caps (upload->upload, in_caps, out_caps); - } return TRUE; } -static gboolean -gst_gl_upload_element_query (GstBaseTransform * bt, GstPadDirection direction, - GstQuery * query) -{ - GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (bt); - - switch (GST_QUERY_TYPE (query)) { - case GST_QUERY_DRAIN: - if (upload->upload) - gst_gl_upload_release_buffer (upload->upload); - break; - default: - break; - } - - return GST_BASE_TRANSFORM_CLASS (parent_class)->query (bt, direction, query); -} - GstFlowReturn gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt, GstBuffer * buffer, GstBuffer ** outbuf) { GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (bt); GstGLUploadReturn ret; + GstBaseTransformClass *bclass; + + bclass = GST_BASE_TRANSFORM_GET_CLASS (bt); if (gst_base_transform_is_passthrough (bt)) { *outbuf = buffer; @@ -241,10 +221,14 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt, return GST_FLOW_NOT_NEGOTIATED; ret = gst_gl_upload_perform_with_buffer (upload->upload, buffer, outbuf); + /* FIXME Having to release after perform is an aberation */ + gst_gl_upload_release_buffer (upload->upload); /* basetransform doesn't unref if they're the same */ if (buffer == *outbuf) gst_buffer_unref (*outbuf); + else + bclass->copy_metadata (bt, buffer, *outbuf); return ret == GST_GL_UPLOAD_DONE ? GST_FLOW_OK : GST_FLOW_ERROR; } |