mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
glcolorbalance: create the shader if it doesn't exist in the render callback
Changing the properties may result in glcolorbalance moving from passthrough to non-passthrough and we weren't creating the shader in that case.
This commit is contained in:
parent
5ecc3413fd
commit
e3f53deb32
1 changed files with 17 additions and 3 deletions
|
@ -161,10 +161,10 @@ gst_gl_color_balance_update_properties (GstGLColorBalance * glcolorbalance)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_color_balance_gl_start (GstGLBaseFilter * base_filter)
|
||||
_create_shader (GstGLColorBalance * balance)
|
||||
{
|
||||
GstGLColorBalance *balance = GST_GL_COLOR_BALANCE (base_filter);
|
||||
GstGLFilter *filter = GST_GL_FILTER (base_filter);
|
||||
GstGLBaseFilter *base_filter = GST_GL_BASE_FILTER (balance);
|
||||
GstGLFilter *filter = GST_GL_FILTER (balance);
|
||||
GError *error = NULL;
|
||||
|
||||
if (balance->shader)
|
||||
|
@ -188,6 +188,17 @@ gst_gl_color_balance_gl_start (GstGLBaseFilter * base_filter)
|
|||
filter->draw_attr_texture_loc =
|
||||
gst_gl_shader_get_attribute_location (balance->shader, "a_texcoord");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_gl_color_balance_gl_start (GstGLBaseFilter * base_filter)
|
||||
{
|
||||
GstGLColorBalance *balance = GST_GL_COLOR_BALANCE (base_filter);
|
||||
|
||||
if (!_create_shader (balance))
|
||||
return FALSE;
|
||||
|
||||
return GST_GL_BASE_FILTER_CLASS (parent_class)->gl_start (base_filter);
|
||||
}
|
||||
|
||||
|
@ -228,6 +239,9 @@ gst_gl_color_balance_callback (gint width, gint height, guint tex_id,
|
|||
GstGLFilter *filter = GST_GL_FILTER (data);
|
||||
const GstGLFuncs *gl = GST_GL_BASE_FILTER (data)->context->gl_vtable;
|
||||
|
||||
if (!balance->shader)
|
||||
_create_shader (balance);
|
||||
|
||||
gst_gl_shader_use (balance->shader);
|
||||
GST_OBJECT_LOCK (balance);
|
||||
gst_gl_shader_set_uniform_1f (balance->shader, "brightness",
|
||||
|
|
Loading…
Reference in a new issue