summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2017-03-13 14:28:47 +1100
committerMatthew Waters <matthew@centricular.com>2017-03-13 21:10:58 +1100
commit956c4d0bde4d6707ccae2b4ae6dfba8500e55217 (patch)
tree3357725e46e7294f3b398c13dd7fe391d7828692 /sys
parent04f8c7d7296aa278bd33e52db335c077a8a53d2a (diff)
downloadgstreamer-plugins-bad-956c4d0bde4d6707ccae2b4ae6dfba8500e55217.tar.gz
gl/format: use our own GL format enum's instead of gstvideo's
They can describe in more detail (such as component sizes) the requested format.
Diffstat (limited to 'sys')
-rw-r--r--sys/androidmedia/gstamcvideodec.c2
-rw-r--r--sys/applemedia/corevideobuffer.c7
-rw-r--r--sys/applemedia/iosglmemory.c8
-rw-r--r--sys/applemedia/iosglmemory.h2
-rw-r--r--sys/applemedia/iosurfacememory.c11
-rw-r--r--sys/applemedia/iosurfacememory.h2
-rw-r--r--sys/applemedia/videotexturecache.m17
7 files changed, 22 insertions, 27 deletions
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
index 1bab383ae..53d3879e2 100644
--- a/sys/androidmedia/gstamcvideodec.c
+++ b/sys/androidmedia/gstamcvideodec.c
@@ -1357,7 +1357,7 @@ retry:
params = gst_gl_video_allocation_params_new (self->gl_context, NULL,
&state->info, 0, NULL, GST_GL_TEXTURE_TARGET_EXTERNAL_OES,
- GST_VIDEO_GL_TEXTURE_TYPE_RGBA);
+ GST_GL_RGBA);
self->oes_mem = (GstGLMemory *) gst_gl_base_memory_alloc (base_mem_alloc,
(GstGLAllocationParams *) params);
diff --git a/sys/applemedia/corevideobuffer.c b/sys/applemedia/corevideobuffer.c
index bf201395d..eba2592fb 100644
--- a/sys/applemedia/corevideobuffer.c
+++ b/sys/applemedia/corevideobuffer.c
@@ -107,15 +107,14 @@ _create_glmem (GstAppleCoreVideoPixelBuffer * gpixbuf,
return gst_video_texture_cache_create_memory (cache, gpixbuf, plane, size);
#else
GstIOSurfaceMemory *mem;
- GstVideoGLTextureType tex_type =
- gst_gl_texture_type_from_format (cache->ctx, GST_VIDEO_INFO_FORMAT (info),
- plane);
+ GstGLFormat tex_format =
+ gst_gl_format_from_video_info (cache->ctx, info, plane);
CVPixelBufferRef pixel_buf = gpixbuf->buf;
IOSurfaceRef surface = CVPixelBufferGetIOSurface (pixel_buf);
CFRetain (pixel_buf);
mem = gst_io_surface_memory_wrapped (cache->ctx,
- surface, GST_GL_TEXTURE_TARGET_RECTANGLE, tex_type,
+ surface, GST_GL_TEXTURE_TARGET_RECTANGLE, tex_format,
info, plane, NULL, pixel_buf, (GDestroyNotify) CFRelease);
return GST_MEMORY_CAST (mem);
#endif
diff --git a/sys/applemedia/iosglmemory.c b/sys/applemedia/iosglmemory.c
index c19f5f31d..7b7db9bc6 100644
--- a/sys/applemedia/iosglmemory.c
+++ b/sys/applemedia/iosglmemory.c
@@ -132,7 +132,7 @@ static GstIOSGLMemory *
_ios_gl_memory_new (GstGLContext * context,
GstAppleCoreVideoMemory * cv_mem,
GstGLTextureTarget target,
- GstVideoGLTextureType tex_type,
+ GstGLFormat tex_format,
guint tex_id,
GstVideoInfo * info,
guint plane,
@@ -144,7 +144,7 @@ _ios_gl_memory_new (GstGLContext * context,
mem->gl_mem.tex_id = tex_id;
mem->gl_mem.texture_wrapped = TRUE;
gst_gl_memory_init (&mem->gl_mem, _ios_gl_memory_allocator, NULL, context,
- target, tex_type, NULL, info, plane, valign, NULL, NULL);
+ target, tex_format, NULL, info, plane, valign, NULL, NULL);
mem->cv_mem = cv_mem;
mem->gl_data = gl_data;
mem->gl_notify = gl_notify;
@@ -158,12 +158,12 @@ GstIOSGLMemory *
gst_ios_gl_memory_new_wrapped (GstGLContext * context,
GstAppleCoreVideoMemory * cv_mem,
GstGLTextureTarget target,
- GstVideoGLTextureType tex_type,
+ GstGLFormat tex_format,
guint tex_id,
GstVideoInfo * info,
guint plane,
GstVideoAlignment * valign, gpointer gl_data, GDestroyNotify gl_notify)
{
- return _ios_gl_memory_new (context, cv_mem, target, tex_type, tex_id, info,
+ return _ios_gl_memory_new (context, cv_mem, target, tex_format, tex_id, info,
plane, valign, gl_data, gl_notify);
}
diff --git a/sys/applemedia/iosglmemory.h b/sys/applemedia/iosglmemory.h
index 7e457d2bb..ec1035dd5 100644
--- a/sys/applemedia/iosglmemory.h
+++ b/sys/applemedia/iosglmemory.h
@@ -55,7 +55,7 @@ GstIOSGLMemory *
gst_ios_gl_memory_new_wrapped (GstGLContext * context,
GstAppleCoreVideoMemory *cv_mem,
GstGLTextureTarget target,
- GstVideoGLTextureType tex_type,
+ GstGLFormat tex_format,
guint tex_id,
GstVideoInfo * info,
guint plane,
diff --git a/sys/applemedia/iosurfacememory.c b/sys/applemedia/iosurfacememory.c
index e0d8b07c8..18a754301 100644
--- a/sys/applemedia/iosurfacememory.c
+++ b/sys/applemedia/iosurfacememory.c
@@ -166,7 +166,7 @@ static GstIOSurfaceMemory *
_io_surface_memory_new (GstGLContext * context,
IOSurfaceRef surface,
GstGLTextureTarget target,
- GstVideoGLTextureType tex_type,
+ GstGLFormat tex_format,
GstVideoInfo * info,
guint plane,
GstVideoAlignment * valign, gpointer user_data, GDestroyNotify notify)
@@ -177,7 +177,7 @@ _io_surface_memory_new (GstGLContext * context,
mem = g_new0 (GstIOSurfaceMemory, 1);
gst_gl_memory_init (&mem->gl_mem, _io_surface_memory_allocator, NULL, context,
- target, tex_type, NULL, info, plane, valign, user_data, notify);
+ target, tex_format, NULL, info, plane, valign, user_data, notify);
GST_MINI_OBJECT_FLAG_SET (mem, GST_MEMORY_FLAG_READONLY);
@@ -191,7 +191,7 @@ GstIOSurfaceMemory *
gst_io_surface_memory_wrapped (GstGLContext * context,
IOSurfaceRef surface,
GstGLTextureTarget target,
- GstVideoGLTextureType tex_type,
+ GstGLFormat tex_format,
GstVideoInfo * info,
guint plane,
GstVideoAlignment * valign, gpointer user_data, GDestroyNotify notify)
@@ -214,15 +214,12 @@ _io_surface_memory_set_surface (GstIOSurfaceMemory * memory,
if (surface) {
GLuint tex_id, tex_target, texifmt, texfmt;
guint plane;
- GstVideoGLTextureType textype;
CGLError cglError;
plane = gl_mem->plane;
tex_id = gl_mem->tex_id;
tex_target = gst_gl_texture_target_to_gl (gl_mem->tex_target);
- textype = gst_gl_texture_type_from_format (context,
- GST_VIDEO_INFO_FORMAT (&gl_mem->info), plane);
- texifmt = gst_gl_format_from_gl_texture_type (textype);
+ texifmt = gst_gl_format_from_video_info (context, &gl_mem->info, plane);
texfmt =
gst_gl_sized_gl_format_from_gl_format_type (context, texifmt,
GL_UNSIGNED_BYTE);
diff --git a/sys/applemedia/iosurfacememory.h b/sys/applemedia/iosurfacememory.h
index 5d281acd0..7fc9e4958 100644
--- a/sys/applemedia/iosurfacememory.h
+++ b/sys/applemedia/iosurfacememory.h
@@ -53,7 +53,7 @@ GstIOSurfaceMemory *
gst_io_surface_memory_wrapped (GstGLContext * context,
IOSurfaceRef surface,
GstGLTextureTarget target,
- GstVideoGLTextureType tex_type,
+ GstGLFormat tex_format,
GstVideoInfo * info,
guint plane,
GstVideoAlignment *valign,
diff --git a/sys/applemedia/videotexturecache.m b/sys/applemedia/videotexturecache.m
index 2aa87dd35..89bc33efe 100644
--- a/sys/applemedia/videotexturecache.m
+++ b/sys/applemedia/videotexturecache.m
@@ -159,7 +159,7 @@ _do_create_memory (GstGLContext * context, ContextThreadData * data)
GstGLTextureTarget gl_target;
GstAppleCoreVideoMemory *memory;
GstIOSGLMemory *gl_memory;
- GstVideoGLTextureType textype;
+ GstGLFormat texformat;
switch (GST_VIDEO_INFO_FORMAT (&cache->input_info)) {
case GST_VIDEO_FORMAT_BGRA:
@@ -170,21 +170,20 @@ _do_create_memory (GstGLContext * context, ContextThreadData * data)
GL_RGBA, GL_UNSIGNED_BYTE, 0, &texture) != kCVReturnSuccess)
goto error;
- textype = GST_VIDEO_GL_TEXTURE_TYPE_RGBA;
+ texformat = GST_GL_RGBA;
plane = 0;
goto success;
case GST_VIDEO_FORMAT_NV12: {
- GLenum texifmt, texfmt;
+ GstGLFormat texifmt, texfmt;
if (plane == 0)
- textype = GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE;
+ texformat = GST_GL_LUMINANCE;
else
- textype = GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA;
- texifmt = gst_gl_format_from_gl_texture_type (textype);
- texfmt = gst_gl_sized_gl_format_from_gl_format_type (cache->ctx, texifmt, GL_UNSIGNED_BYTE);
+ texformat = GST_GL_LUMINANCE_ALPHA;
+ texfmt = gst_gl_sized_gl_format_from_gl_format_type (cache->ctx, texformat, GL_UNSIGNED_BYTE);
if (CVOpenGLESTextureCacheCreateTextureFromImage (kCFAllocatorDefault,
- cache->cache, pixel_buf, NULL, GL_TEXTURE_2D, texifmt,
+ cache->cache, pixel_buf, NULL, GL_TEXTURE_2D, texformat,
GST_VIDEO_INFO_COMP_WIDTH (&cache->input_info, plane),
GST_VIDEO_INFO_COMP_HEIGHT (&cache->input_info, plane),
texfmt, GL_UNSIGNED_BYTE, plane, &texture) != kCVReturnSuccess)
@@ -205,7 +204,7 @@ success: {
gl_target = gst_gl_texture_target_from_gl (CVOpenGLESTextureGetTarget (texture));
memory = gst_apple_core_video_memory_new_wrapped (gpixbuf, plane, size);
gl_memory = gst_ios_gl_memory_new_wrapped (context, memory,
- gl_target, textype, CVOpenGLESTextureGetName (texture), &cache->input_info,
+ gl_target, texformat, CVOpenGLESTextureGetName (texture), &cache->input_info,
plane, NULL, texture_data, (GDestroyNotify) gst_video_texture_cache_release_texture);
data->memory = GST_MEMORY_CAST (gl_memory);