mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
[379/906] gloverlay: add support to use RGB png images
Previously restricted to RGBA, now gloverlay can also handle a RGB image.
This commit is contained in:
parent
30631c4626
commit
5943045bf6
1 changed files with 7 additions and 0 deletions
|
@ -393,6 +393,7 @@ gst_gl_overlay_loader (GstGLFilter * filter)
|
|||
png_FILE_p fp = NULL;
|
||||
guint y = 0;
|
||||
guchar **rows = NULL;
|
||||
gint filler;
|
||||
|
||||
if (!filter->display)
|
||||
return TRUE;
|
||||
|
@ -425,6 +426,12 @@ gst_gl_overlay_loader (GstGLFilter * filter)
|
|||
png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
||||
&interlace_type, int_p_NULL, int_p_NULL);
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_RGB) {
|
||||
filler = 0xff;
|
||||
png_set_filler (png_ptr, filler, PNG_FILLER_AFTER);
|
||||
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
|
||||
}
|
||||
|
||||
if (color_type != PNG_COLOR_TYPE_RGB_ALPHA) {
|
||||
fclose (fp);
|
||||
png_destroy_read_struct (&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
||||
|
|
Loading…
Reference in a new issue