glmemory: remove uneeded gl api ifdefs

This commit is contained in:
Matthew Waters 2014-05-30 12:23:09 +10:00
parent 1f90323a4d
commit 0f4485fc66

View file

@ -75,6 +75,9 @@ static GstAllocator *_gl_allocator;
#ifndef GL_STREAM_COPY #ifndef GL_STREAM_COPY
#define GL_STREAM_COPY 0x88E2 #define GL_STREAM_COPY 0x88E2
#endif #endif
#ifndef GL_UNPACK_ROW_LENGTH
#define GL_UNPACK_ROW_LENGTH 0x0CF2
#endif
typedef struct typedef struct
{ {
@ -386,16 +389,11 @@ _upload_memory (GstGLContext * context, GstGLMemory * gl_mem)
gl_format = _gst_gl_format_from_gl_texture_type (gl_mem->tex_type); gl_format = _gst_gl_format_from_gl_texture_type (gl_mem->tex_type);
#if GST_GL_HAVE_OPENGL || GST_GL_HAVE_GLES3
if (USING_OPENGL (context) || USING_GLES3 (context)) { if (USING_OPENGL (context) || USING_GLES3 (context)) {
gl->PixelStorei (GL_UNPACK_ROW_LENGTH, gl_mem->unpack_length); gl->PixelStorei (GL_UNPACK_ROW_LENGTH, gl_mem->unpack_length);
} } else if (USING_GLES2 (context)) {
#endif
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (context)) {
gl->PixelStorei (GL_UNPACK_ALIGNMENT, gl_mem->unpack_length); gl->PixelStorei (GL_UNPACK_ALIGNMENT, gl_mem->unpack_length);
} }
#endif
GST_CAT_LOG (GST_CAT_GL_MEMORY, "upload for texture id:%u, %ux%u", GST_CAT_LOG (GST_CAT_GL_MEMORY, "upload for texture id:%u, %ux%u",
gl_mem->tex_id, gl_mem->width, gl_mem->height); gl_mem->tex_id, gl_mem->width, gl_mem->height);
@ -405,16 +403,12 @@ _upload_memory (GstGLContext * context, GstGLMemory * gl_mem)
gl_format, gl_type, gl_mem->data); gl_format, gl_type, gl_mem->data);
/* Reset to default values */ /* Reset to default values */
#if GST_GL_HAVE_OPENGL || GST_GL_HAVE_GLES3
if (USING_OPENGL (context) || USING_GLES3 (context)) { if (USING_OPENGL (context) || USING_GLES3 (context)) {
gl->PixelStorei (GL_UNPACK_ROW_LENGTH, 0); gl->PixelStorei (GL_UNPACK_ROW_LENGTH, 0);
} } else if (USING_GLES2 (context)) {
#endif
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (context)) {
gl->PixelStorei (GL_UNPACK_ALIGNMENT, 4); gl->PixelStorei (GL_UNPACK_ALIGNMENT, 4);
} }
#endif
gl->BindTexture (GL_TEXTURE_2D, 0); gl->BindTexture (GL_TEXTURE_2D, 0);
GST_GL_MEMORY_FLAG_UNSET (gl_mem, GST_GL_MEMORY_FLAG_NEED_UPLOAD); GST_GL_MEMORY_FLAG_UNSET (gl_mem, GST_GL_MEMORY_FLAG_NEED_UPLOAD);
@ -435,13 +429,10 @@ _calculate_unpack_length (GstGLMemory * gl_mem)
gl_mem->tex_type); gl_mem->tex_type);
return; return;
} }
#if GST_GL_HAVE_OPENGL || GST_GL_HAVE_GLES3
if (USING_OPENGL (gl_mem->context) || USING_GLES3 (gl_mem->context)) { if (USING_OPENGL (gl_mem->context) || USING_GLES3 (gl_mem->context)) {
gl_mem->unpack_length = gl_mem->stride / n_gl_bytes; gl_mem->unpack_length = gl_mem->stride / n_gl_bytes;
} else } else if (USING_GLES2 (gl_mem->context)) {
#endif
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (gl_mem->context)) {
guint j = 8; guint j = 8;
while (j >= n_gl_bytes) { while (j >= n_gl_bytes) {
@ -493,7 +484,6 @@ _calculate_unpack_length (GstGLMemory * gl_mem)
} }
} }
} }
#endif
} }
static void static void