mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 22:46:24 +00:00
gl: pass large structure by const pointer, not value
Avoids large pointless memcpy. Coverity 206236, 206237
This commit is contained in:
parent
07565d0ff7
commit
2767aae4e2
4 changed files with 12 additions and 12 deletions
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
||||||
GstGLEffectsCurve curve,
|
const GstGLEffectsCurve * curve,
|
||||||
gint curve_index, gint width, gint height, GLuint texture)
|
gint curve_index, gint width, gint height, GLuint texture)
|
||||||
{
|
{
|
||||||
GstGLShader *shader;
|
GstGLShader *shader;
|
||||||
|
@ -65,8 +65,8 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
||||||
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||||
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||||
|
|
||||||
gl->TexImage1D (GL_TEXTURE_1D, 0, curve.bytes_per_pixel,
|
gl->TexImage1D (GL_TEXTURE_1D, 0, curve->bytes_per_pixel,
|
||||||
curve.width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve.pixel_data);
|
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_1D);
|
gl->Disable (GL_TEXTURE_1D);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ gst_gl_effects_heat_callback (gint width, gint height, guint texture,
|
||||||
{
|
{
|
||||||
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
||||||
|
|
||||||
gst_gl_effects_luma_to_curve (effects, heat_curve, GST_GL_EFFECTS_CURVE_HEAT,
|
gst_gl_effects_luma_to_curve (effects, &heat_curve, GST_GL_EFFECTS_CURVE_HEAT,
|
||||||
width, height, texture);
|
width, height, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ gst_gl_effects_sepia_callback (gint width, gint height, guint texture,
|
||||||
{
|
{
|
||||||
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
||||||
|
|
||||||
gst_gl_effects_luma_to_curve (effects, sepia_curve,
|
gst_gl_effects_luma_to_curve (effects, &sepia_curve,
|
||||||
GST_GL_EFFECTS_CURVE_SEPIA, width, height, texture);
|
GST_GL_EFFECTS_CURVE_SEPIA, width, height, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ gst_gl_effects_luma_xpro_callback (gint width, gint height, guint texture,
|
||||||
{
|
{
|
||||||
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
||||||
|
|
||||||
gst_gl_effects_luma_to_curve (effects, luma_xpro_curve,
|
gst_gl_effects_luma_to_curve (effects, &luma_xpro_curve,
|
||||||
GST_GL_EFFECTS_CURVE_LUMA_XPRO, width, height, texture);
|
GST_GL_EFFECTS_CURVE_LUMA_XPRO, width, height, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
void gst_gl_effects_luma_to_curve (GstGLEffects *effects,
|
void gst_gl_effects_luma_to_curve (GstGLEffects *effects,
|
||||||
GstGLEffectsCurve curve,
|
const GstGLEffectsCurve *curve,
|
||||||
gint curve_index,
|
gint curve_index,
|
||||||
gint width, gint height,
|
gint width, gint height,
|
||||||
GLuint texture);
|
GLuint texture);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
||||||
GstGLEffectsCurve curve,
|
const GstGLEffectsCurve * curve,
|
||||||
gint curve_index, gint width, gint height, GLuint texture)
|
gint curve_index, gint width, gint height, GLuint texture)
|
||||||
{
|
{
|
||||||
GstGLShader *shader;
|
GstGLShader *shader;
|
||||||
|
@ -65,8 +65,8 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
||||||
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||||
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||||
|
|
||||||
gl->TexImage1D (GL_TEXTURE_1D, 0, curve.bytes_per_pixel,
|
gl->TexImage1D (GL_TEXTURE_1D, 0, curve->bytes_per_pixel,
|
||||||
curve.width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve.pixel_data);
|
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_1D);
|
gl->Disable (GL_TEXTURE_1D);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ gst_gl_effects_xpro_callback (gint width, gint height, guint texture,
|
||||||
{
|
{
|
||||||
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
||||||
|
|
||||||
gst_gl_effects_rgb_to_curve (effects, xpro_curve, GST_GL_EFFECTS_CURVE_XPRO,
|
gst_gl_effects_rgb_to_curve (effects, &xpro_curve, GST_GL_EFFECTS_CURVE_XPRO,
|
||||||
width, height, texture);
|
width, height, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ gst_gl_effects_xray_step_one (gint width, gint height, guint texture,
|
||||||
{
|
{
|
||||||
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
GstGLEffects *effects = GST_GL_EFFECTS (data);
|
||||||
|
|
||||||
gst_gl_effects_luma_to_curve (effects, xray_curve, GST_GL_EFFECTS_CURVE_XRAY,
|
gst_gl_effects_luma_to_curve (effects, &xray_curve, GST_GL_EFFECTS_CURVE_XRAY,
|
||||||
width, height, texture);
|
width, height, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue