mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
[354/906] fix and add gldeinterlace filter to the builds
This commit is contained in:
parent
3eddae28a9
commit
df4e712ca2
4 changed files with 19 additions and 10 deletions
|
@ -37,6 +37,7 @@ add_library (gstopengl SHARED
|
|||
gltestsrc.c
|
||||
gstgltestsrc.c
|
||||
gstgloverlay.c
|
||||
gstgldeinterlace.c
|
||||
gstgldifferencematte.c
|
||||
gstglbumper.c
|
||||
gstgleffects.c
|
||||
|
|
|
@ -26,6 +26,8 @@ libgstopengl_la_SOURCES = \
|
|||
gstglfilterapp.h \
|
||||
gstglcolorscale.c \
|
||||
gstglcolorscale.h \
|
||||
gstgldeinterlace.c \
|
||||
gstgldeinterlace.h \
|
||||
gstgldifferencematte.c \
|
||||
gstgloverlay.c \
|
||||
gltestsrc.c \
|
||||
|
|
|
@ -151,12 +151,12 @@ static const gchar *greedyh_fragment_source =
|
|||
""
|
||||
"" //STEP 3
|
||||
" vec3 mov;\n"
|
||||
" mov.r = 256.0 * min(max(abs(L2.r - LP2.r) - motion_threshold, 0.0) * motion_sense, 1.0);\n" //no equivalent to 256 so we put 1.0 * 256.0
|
||||
" last.r = (last.r * (256.0 - mov.r) + avg_sc.r * mov.r) / 256.0;\n"
|
||||
" mov.g = 256.0 * min(max(abs(L2.g - LP2.g) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last.g = (last.g * (256.0 - mov.g) + avg_sc.g * mov.g) / 256.0;\n"
|
||||
" mov.b = 256.0 * min(max(abs(L2.b - LP2.b) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last.b = (last.b * (256.0 - mov.b) + avg_sc.b * mov.b) / 256.0;\n"
|
||||
" mov.r = min(max(abs(L2.r - LP2.r) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last.r = (last.r * (1.0 - mov.r) + avg_sc.r * mov.r);\n"
|
||||
" mov.g = min(max(abs(L2.g - LP2.g) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last.g = (last.g * (1.0 - mov.g) + avg_sc.g * mov.g);\n"
|
||||
" mov.b = min(max(abs(L2.b - LP2.b) - motion_threshold, 0.0) * motion_sense, 1.0);\n"
|
||||
" last.b = last.b * (1.0 - mov.b) + avg_sc.b * mov.b;\n"
|
||||
""
|
||||
" gl_FragColor = vec4(last, 1.0);\n"
|
||||
" }\n"
|
||||
|
@ -289,9 +289,9 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1i (deinterlace_filter->shader, "tex", 0);
|
||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, texture);
|
||||
|
||||
gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "max_comb", 5.0/255.0);
|
||||
gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "motion_threshold", 25.0/255.0);
|
||||
gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "motion_sense", 30.0/255.0);
|
||||
gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "max_comb", 5.0f/255.0f);
|
||||
gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "motion_threshold", 25.0f/255.0f);
|
||||
gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "motion_sense", 30.0f/255.0f);
|
||||
|
||||
gst_gl_shader_set_uniform_1i (deinterlace_filter->shader, "width", filter->width);
|
||||
gst_gl_shader_set_uniform_1i (deinterlace_filter->shader, "height", filter->height);
|
||||
|
|
|
@ -57,14 +57,15 @@ GType gst_gl_filter_cube_get_type (void);
|
|||
#include "gstglfilterglass.h"
|
||||
#include "gstglfilterapp.h"
|
||||
#include "gstglcolorscale.h"
|
||||
#include "gstgldeinterlace.h"
|
||||
#include "gstgleffects.h"
|
||||
#include "gstglbumper.h"
|
||||
|
||||
GType gst_gl_effects_get_type (void);
|
||||
GType gst_gl_deinterlace_get_type (void);
|
||||
GType gst_gl_filter_app_get_type (void);
|
||||
GType gst_gl_filterblur_get_type (void);
|
||||
GType gst_gl_filtersobel_get_type (void);
|
||||
GType gst_gl_filter_edge_get_type (void);
|
||||
GType gst_gl_filter_laplacian_get_type (void);
|
||||
GType gst_gl_filter_glass_get_type (void);
|
||||
GType gst_gl_overlay_get_type (void);
|
||||
|
@ -150,6 +151,11 @@ plugin_init (GstPlugin * plugin)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gst_element_register (plugin, "gldeinterlace",
|
||||
GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gst_element_register (plugin, "glcolorscale",
|
||||
GST_RANK_NONE, GST_TYPE_GL_COLORSCALE)) {
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue