mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
[509/906] GstGLDisplay: update for 1.0
This commit is contained in:
parent
590c3f4060
commit
528816def4
3 changed files with 29 additions and 17 deletions
|
@ -20,6 +20,8 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -2805,9 +2807,15 @@ gst_gl_display_thread_do_upload_make (GstGLDisplay * display)
|
||||||
void
|
void
|
||||||
gst_gl_display_thread_do_upload_fill (GstGLDisplay * display)
|
gst_gl_display_thread_do_upload_fill (GstGLDisplay * display)
|
||||||
{
|
{
|
||||||
gint width = display->upload_data_width;
|
GstVideoInfo vinfo;
|
||||||
gint height = display->upload_data_height;
|
gint width, height;
|
||||||
gpointer data = display->upload_data;
|
gpointer data;
|
||||||
|
|
||||||
|
width = display->upload_data_width;
|
||||||
|
height = display->upload_data_height;
|
||||||
|
data = display->upload_data;
|
||||||
|
gst_video_info_set_format (&vinfo, display->upload_video_format, width,
|
||||||
|
height);
|
||||||
|
|
||||||
switch (display->upload_video_format) {
|
switch (display->upload_video_format) {
|
||||||
case GST_VIDEO_FORMAT_RGB:
|
case GST_VIDEO_FORMAT_RGB:
|
||||||
|
@ -2936,17 +2944,13 @@ gst_gl_display_thread_do_upload_fill (GstGLDisplay * display)
|
||||||
glTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0,
|
glTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0,
|
||||||
GST_ROUND_UP_2 (width) / 2, GST_ROUND_UP_2 (height) / 2,
|
GST_ROUND_UP_2 (width) / 2, GST_ROUND_UP_2 (height) / 2,
|
||||||
GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
||||||
(guint8 *) data +
|
(guint8 *) data + GST_VIDEO_INFO_COMP_OFFSET (&vinfo, 2));
|
||||||
gst_video_format_get_component_offset (display->upload_video_format,
|
|
||||||
1, width, height));
|
|
||||||
|
|
||||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, display->upload_intex_v);
|
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, display->upload_intex_v);
|
||||||
glTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0,
|
glTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0,
|
||||||
GST_ROUND_UP_2 (width) / 2, GST_ROUND_UP_2 (height) / 2,
|
GST_ROUND_UP_2 (width) / 2, GST_ROUND_UP_2 (height) / 2,
|
||||||
GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
||||||
(guint8 *) data +
|
(guint8 *) data + GST_VIDEO_INFO_COMP_OFFSET (&vinfo, 2));
|
||||||
gst_video_format_get_component_offset (display->upload_video_format,
|
|
||||||
2, width, height));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -3393,10 +3397,16 @@ gst_gl_display_thread_do_download_draw_rgb (GstGLDisplay * display)
|
||||||
void
|
void
|
||||||
gst_gl_display_thread_do_download_draw_yuv (GstGLDisplay * display)
|
gst_gl_display_thread_do_download_draw_yuv (GstGLDisplay * display)
|
||||||
{
|
{
|
||||||
gint width = display->download_width;
|
gint width, height;
|
||||||
gint height = display->download_height;
|
GstVideoFormat video_format;
|
||||||
GstVideoFormat video_format = display->download_video_format;
|
GstVideoInfo vinfo;
|
||||||
gpointer data = display->download_data;
|
gpointer data;
|
||||||
|
|
||||||
|
width = display->download_width;
|
||||||
|
height = display->download_height;
|
||||||
|
video_format = display->download_video_format;
|
||||||
|
data = display->download_data;
|
||||||
|
gst_video_info_set_format (&vinfo, video_format, width, height);
|
||||||
|
|
||||||
#ifdef OPENGL_ES2
|
#ifdef OPENGL_ES2
|
||||||
GLint viewport_dim[4];
|
GLint viewport_dim[4];
|
||||||
|
@ -3606,15 +3616,13 @@ gst_gl_display_thread_do_download_draw_yuv (GstGLDisplay * display)
|
||||||
#endif
|
#endif
|
||||||
glReadPixels (0, 0, GST_ROUND_UP_2 (width) / 2,
|
glReadPixels (0, 0, GST_ROUND_UP_2 (width) / 2,
|
||||||
GST_ROUND_UP_2 (height) / 2, GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
GST_ROUND_UP_2 (height) / 2, GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
||||||
(guint8 *) data + gst_video_format_get_component_offset (video_format,
|
(guint8 *) data + GST_VIDEO_INFO_COMP_OFFSET (&vinfo, 1));
|
||||||
1, width, height));
|
|
||||||
#ifndef OPENGL_ES2
|
#ifndef OPENGL_ES2
|
||||||
glReadBuffer (GL_COLOR_ATTACHMENT2_EXT);
|
glReadBuffer (GL_COLOR_ATTACHMENT2_EXT);
|
||||||
#endif
|
#endif
|
||||||
glReadPixels (0, 0, GST_ROUND_UP_2 (width) / 2,
|
glReadPixels (0, 0, GST_ROUND_UP_2 (width) / 2,
|
||||||
GST_ROUND_UP_2 (height) / 2, GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
GST_ROUND_UP_2 (height) / 2, GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
||||||
(guint8 *) data + gst_video_format_get_component_offset (video_format,
|
(guint8 *) data + GST_VIDEO_INFO_COMP_OFFSET (&vinfo, 2));
|
||||||
2, width, height));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue