mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
[868/906] upload: fix compilation for GLES2
This commit is contained in:
parent
5168d86d9e
commit
8d67249633
1 changed files with 11 additions and 11 deletions
|
@ -69,6 +69,15 @@ static gboolean _do_upload_draw_gles2 (GstGLContext * context,
|
||||||
"const vec3 gcoeff = vec3(1.164,-0.391,-0.813);\n" \
|
"const vec3 gcoeff = vec3(1.164,-0.391,-0.813);\n" \
|
||||||
"const vec3 bcoeff = vec3(1.164, 2.018, 0.000);\n"
|
"const vec3 bcoeff = vec3(1.164, 2.018, 0.000);\n"
|
||||||
|
|
||||||
|
/** GRAY16 to RGB conversion
|
||||||
|
* data transfered as GL_LUMINANCE_ALPHA then convert back to GRAY16
|
||||||
|
* high byte weight as : 255*256/65535
|
||||||
|
* ([0~1] denormalize to [0~255],shift to high byte,normalize to [0~1])
|
||||||
|
* low byte weight as : 255/65535 (similar)
|
||||||
|
* */
|
||||||
|
#define COMPOSE_WEIGHT \
|
||||||
|
"const vec2 compose_weight = vec2(0.996109, 0.003891);\n"
|
||||||
|
|
||||||
#if GST_GL_HAVE_OPENGL
|
#if GST_GL_HAVE_OPENGL
|
||||||
|
|
||||||
static const char *frag_AYUV_opengl = {
|
static const char *frag_AYUV_opengl = {
|
||||||
|
@ -143,15 +152,6 @@ static const char *frag_REORDER_opengl = {
|
||||||
"}"
|
"}"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** GRAY16 to RGB conversion
|
|
||||||
* data transfered as GL_LUMINANCE_ALPHA then convert back to GRAY16
|
|
||||||
* high byte weight as : 255*256/65535
|
|
||||||
* ([0~1] denormalize to [0~255],shift to high byte,normalize to [0~1])
|
|
||||||
* low byte weight as : 255/65535 (similar)
|
|
||||||
* */
|
|
||||||
#define COMPOSE_WEIGHT \
|
|
||||||
"const vec2 compose_weight = vec2(0.996109, 0.003891);\n"
|
|
||||||
|
|
||||||
/* Compose LUMINANCE/ALPHA as 8bit-8bit value */
|
/* Compose LUMINANCE/ALPHA as 8bit-8bit value */
|
||||||
static const char *frag_COMPOSE_opengl = {
|
static const char *frag_COMPOSE_opengl = {
|
||||||
"uniform sampler2D tex;\n"
|
"uniform sampler2D tex;\n"
|
||||||
|
@ -1449,12 +1449,12 @@ _do_upload_fill (GstGLContext * context, GstGLUpload * upload)
|
||||||
|
|
||||||
switch (v_format) {
|
switch (v_format) {
|
||||||
case GST_VIDEO_FORMAT_GRAY8:
|
case GST_VIDEO_FORMAT_GRAY8:
|
||||||
gl->TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, in_width, in_height,
|
gl->TexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, in_width, in_height,
|
||||||
GL_LUMINANCE, GL_UNSIGNED_BYTE, upload->data[0]);
|
GL_LUMINANCE, GL_UNSIGNED_BYTE, upload->data[0]);
|
||||||
break;
|
break;
|
||||||
case GST_VIDEO_FORMAT_GRAY16_BE:
|
case GST_VIDEO_FORMAT_GRAY16_BE:
|
||||||
case GST_VIDEO_FORMAT_GRAY16_LE:
|
case GST_VIDEO_FORMAT_GRAY16_LE:
|
||||||
gl->TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, in_width, in_height,
|
gl->TexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, in_width, in_height,
|
||||||
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, upload->data[0]);
|
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, upload->data[0]);
|
||||||
break;
|
break;
|
||||||
case GST_VIDEO_FORMAT_RGB:
|
case GST_VIDEO_FORMAT_RGB:
|
||||||
|
|
Loading…
Reference in a new issue