mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
[304/906] only load RGBA files.png
This commit is contained in:
parent
b6735ace5d
commit
92e733dce0
4 changed files with 14 additions and 14 deletions
|
@ -519,7 +519,7 @@ gst_gl_shader_get_attribute_location (GstGLShader * shader, const gchar *name)
|
||||||
|
|
||||||
g_return_val_if_fail (priv->program_handle != 0, 0);
|
g_return_val_if_fail (priv->program_handle != 0, 0);
|
||||||
|
|
||||||
return glGetUniformLocationARB (priv->program_handle, name);
|
return glGetAttribLocationARB (priv->program_handle, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
GQuark
|
GQuark
|
||||||
|
|
|
@ -302,7 +302,7 @@ static void init_pixbuf_texture (GstGLDisplay *display, gpointer data)
|
||||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, differencematte->newbgtexture);
|
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, differencematte->newbgtexture);
|
||||||
glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA,
|
glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA,
|
||||||
filter->width, filter->height, 0,
|
filter->width, filter->height, 0,
|
||||||
GL_RGB, GL_UNSIGNED_BYTE, differencematte->pixbuf); //FIXME: RGBA
|
GL_RGBA, GL_UNSIGNED_BYTE, differencematte->pixbuf);
|
||||||
|
|
||||||
if (differencematte->savedbgtexture == 0) {
|
if (differencematte->savedbgtexture == 0) {
|
||||||
glGenTextures (1, &differencematte->savedbgtexture);
|
glGenTextures (1, &differencematte->savedbgtexture);
|
||||||
|
@ -562,7 +562,7 @@ gst_gl_differencematte_loader (GstGLFilter* filter)
|
||||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
||||||
&interlace_type, int_p_NULL, int_p_NULL);
|
&interlace_type, int_p_NULL, int_p_NULL);
|
||||||
|
|
||||||
if (color_type != PNG_COLOR_TYPE_RGB) //FIXME: RGBA
|
if (color_type != PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
{
|
{
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
||||||
|
@ -572,12 +572,12 @@ gst_gl_differencematte_loader (GstGLFilter* filter)
|
||||||
filter->width = width;
|
filter->width = width;
|
||||||
filter->height = height;
|
filter->height = height;
|
||||||
|
|
||||||
differencematte->pixbuf = (guchar*) malloc ( sizeof(guchar) * width * height * 3 ); //FIXME: g_alloc, RGBA
|
differencematte->pixbuf = (guchar*) malloc ( sizeof(guchar) * width * height * 4 );
|
||||||
|
|
||||||
rows = (guchar**)malloc(sizeof(guchar*) * height); //FIXME: g_alloc
|
rows = (guchar**)malloc(sizeof(guchar*) * height);
|
||||||
|
|
||||||
for (y = 0; y < height; ++y)
|
for (y = 0; y < height; ++y)
|
||||||
rows[y] = (guchar*) (differencematte->pixbuf + y * width * 3);
|
rows[y] = (guchar*) (differencematte->pixbuf + y * width * 4);
|
||||||
|
|
||||||
png_read_image(png_ptr, rows);
|
png_read_image(png_ptr, rows);
|
||||||
|
|
||||||
|
|
|
@ -310,7 +310,7 @@ static void init_pixbuf_texture (GstGLDisplay *display, gpointer data)
|
||||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, pixbufoverlay->pbuftexture);
|
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, pixbufoverlay->pbuftexture);
|
||||||
glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA,
|
glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA,
|
||||||
(gint)pixbufoverlay->width, (gint)pixbufoverlay->height, 0,
|
(gint)pixbufoverlay->width, (gint)pixbufoverlay->height, 0,
|
||||||
GL_RGB, GL_UNSIGNED_BYTE, pixbufoverlay->pixbuf); //FIXME: RGBA
|
GL_RGBA, GL_UNSIGNED_BYTE, pixbufoverlay->pixbuf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
display->isAlive = FALSE;
|
display->isAlive = FALSE;
|
||||||
|
@ -402,7 +402,7 @@ gst_gl_pixbufoverlay_loader (GstGLFilter* filter)
|
||||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
||||||
&interlace_type, int_p_NULL, int_p_NULL);
|
&interlace_type, int_p_NULL, int_p_NULL);
|
||||||
|
|
||||||
if (color_type != PNG_COLOR_TYPE_RGB) //FIXME: RGBA
|
if (color_type != PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
{
|
{
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
||||||
|
@ -412,12 +412,12 @@ gst_gl_pixbufoverlay_loader (GstGLFilter* filter)
|
||||||
pixbufoverlay->width = width;
|
pixbufoverlay->width = width;
|
||||||
pixbufoverlay->height = height;
|
pixbufoverlay->height = height;
|
||||||
|
|
||||||
pixbufoverlay->pixbuf = (guchar*) malloc ( sizeof(guchar) * width * height * 3 ); //FIXME: g_alloc, RGBA
|
pixbufoverlay->pixbuf = (guchar*) malloc ( sizeof(guchar) * width * height * 4 );
|
||||||
|
|
||||||
rows = (guchar**)malloc(sizeof(guchar*) * height); //FIXME: g_alloc
|
rows = (guchar**)malloc(sizeof(guchar*) * height);
|
||||||
|
|
||||||
for (y = 0; y < height; ++y)
|
for (y = 0; y < height; ++y)
|
||||||
rows[y] = (guchar*) (pixbufoverlay->pixbuf + y * width * 3);
|
rows[y] = (guchar*) (pixbufoverlay->pixbuf + y * width * 4);
|
||||||
|
|
||||||
png_read_image(png_ptr, rows);
|
png_read_image(png_ptr, rows);
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#include "gstglimagesink.h"
|
#include "gstglimagesink.h"
|
||||||
#include "gstglcolorscale.h"
|
#include "gstglcolorscale.h"
|
||||||
#include "gstgleffects.h"
|
#include "gstgleffects.h"
|
||||||
#ifdef HAVE_GDKPIXBUF //FIXME: HAVE_LIBPNG
|
#ifdef HAVE_LIBPNG
|
||||||
#include "gstglbumper.h"
|
#include "gstglbumper.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ GType gst_gl_filtersobel_get_type (void);
|
||||||
GType gst_gl_filter_edge_get_type (void);
|
GType gst_gl_filter_edge_get_type (void);
|
||||||
GType gst_gl_filter_laplacian_get_type (void);
|
GType gst_gl_filter_laplacian_get_type (void);
|
||||||
GType gst_gl_filter_glass_get_type (void);
|
GType gst_gl_filter_glass_get_type (void);
|
||||||
#ifdef HAVE_GDKPIXBUF //FIXME: HAVE_LIBPNG
|
#ifdef HAVE_LIBPNG
|
||||||
GType gst_gl_pixbufoverlay_get_type (void);
|
GType gst_gl_pixbufoverlay_get_type (void);
|
||||||
GType gst_gl_differencematte_get_type (void);
|
GType gst_gl_differencematte_get_type (void);
|
||||||
GType gst_gl_bumper_get_type (void);
|
GType gst_gl_bumper_get_type (void);
|
||||||
|
@ -94,7 +94,7 @@ plugin_init (GstPlugin * plugin)
|
||||||
GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) {
|
GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_GDKPIXBUF //FIXME: HAVE_LIBPNG
|
#ifdef HAVE_LIBPNG
|
||||||
if (!gst_element_register (plugin, "glpixbufoverlay",
|
if (!gst_element_register (plugin, "glpixbufoverlay",
|
||||||
GST_RANK_NONE, gst_gl_pixbufoverlay_get_type())) {
|
GST_RANK_NONE, gst_gl_pixbufoverlay_get_type())) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue