mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +00:00
glutils: remove unused functions for texture creation/deletion
Everyone uses GstGLMemory now and any future code should as well.
This commit is contained in:
parent
216b8eea6c
commit
27e4288de4
2 changed files with 0 additions and 191 deletions
|
@ -98,187 +98,6 @@ gst_gl_context_check_framebuffer_status (GstGLContext * context)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
typedef struct _GenTexture
|
||||
{
|
||||
guint width, height;
|
||||
GstVideoFormat format;
|
||||
guint result;
|
||||
} GenTexture;
|
||||
|
||||
static void
|
||||
_gen_texture (GstGLContext * context, GenTexture * data)
|
||||
{
|
||||
const GstGLFuncs *gl = context->gl_vtable;
|
||||
GLenum internal_format;
|
||||
|
||||
GST_TRACE ("Generating texture format:%u dimensions:%ux%u", data->format,
|
||||
data->width, data->height);
|
||||
|
||||
gl->GenTextures (1, &data->result);
|
||||
gl->BindTexture (GL_TEXTURE_2D, data->result);
|
||||
|
||||
internal_format =
|
||||
gst_gl_sized_gl_format_from_gl_format_type (context, GL_RGBA,
|
||||
GL_UNSIGNED_BYTE);
|
||||
if (data->width > 0 && data->height > 0)
|
||||
gl->TexImage2D (GL_TEXTURE_2D, 0, internal_format,
|
||||
data->width, data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
GST_LOG ("generated texture id:%d", data->result);
|
||||
}
|
||||
|
||||
/* deprecated. replaced by GstGLMemory */
|
||||
void
|
||||
gst_gl_context_gen_texture (GstGLContext * context, GLuint * pTexture,
|
||||
GstVideoFormat v_format, GLint width, GLint height)
|
||||
{
|
||||
GenTexture data = { width, height, v_format, 0 };
|
||||
|
||||
gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _gen_texture,
|
||||
&data);
|
||||
|
||||
*pTexture = data.result;
|
||||
}
|
||||
|
||||
static void
|
||||
_del_texture (GstGLContext * context, guint * texture)
|
||||
{
|
||||
context->gl_vtable->DeleteTextures (1, texture);
|
||||
}
|
||||
|
||||
/* deprecated. replaced by GstGLMemory */
|
||||
void
|
||||
gst_gl_context_del_texture (GstGLContext * context, GLuint * pTexture)
|
||||
{
|
||||
gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _del_texture,
|
||||
pTexture);
|
||||
}
|
||||
|
||||
typedef struct _GenTextureFull
|
||||
{
|
||||
const GstVideoInfo *info;
|
||||
const gint comp;
|
||||
guint result;
|
||||
} GenTextureFull;
|
||||
|
||||
static void
|
||||
_gen_texture_full (GstGLContext * context, GenTextureFull * data)
|
||||
{
|
||||
const GstGLFuncs *gl = context->gl_vtable;
|
||||
GstVideoGLTextureType tex_type;
|
||||
GstVideoFormat v_format;
|
||||
GLint glinternalformat = 0;
|
||||
GLenum glformat = 0;
|
||||
GLenum gltype = 0;
|
||||
|
||||
gl->GenTextures (1, &data->result);
|
||||
gl->BindTexture (GL_TEXTURE_2D, data->result);
|
||||
|
||||
v_format = GST_VIDEO_INFO_FORMAT (data->info);
|
||||
tex_type = gst_gl_texture_type_from_format (context, v_format, data->comp);
|
||||
glformat = gst_gl_format_from_gl_texture_type (tex_type);
|
||||
gltype = GL_UNSIGNED_BYTE;
|
||||
if (v_format == GST_VIDEO_FORMAT_RGB16)
|
||||
gltype = GL_UNSIGNED_SHORT_5_6_5;
|
||||
glinternalformat = gst_gl_sized_gl_format_from_gl_format_type (context,
|
||||
glformat, gltype);
|
||||
|
||||
gl->TexImage2D (GL_TEXTURE_2D, 0, glinternalformat,
|
||||
GST_VIDEO_INFO_COMP_WIDTH (data->info, data->comp),
|
||||
GST_VIDEO_INFO_COMP_HEIGHT (data->info, data->comp), 0, glformat, gltype,
|
||||
NULL);
|
||||
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
}
|
||||
|
||||
/* deprecated. replaced by GstGLMemory */
|
||||
void
|
||||
gst_gl_generate_texture_full (GstGLContext * context, const GstVideoInfo * info,
|
||||
const guint comp, gint stride[], gsize offset[], gsize size[],
|
||||
GLuint * pTexture)
|
||||
{
|
||||
GenTextureFull data = { info, comp, 0 };
|
||||
|
||||
switch (GST_VIDEO_INFO_FORMAT (info)) {
|
||||
case GST_VIDEO_FORMAT_RGB:
|
||||
case GST_VIDEO_FORMAT_BGR:
|
||||
{
|
||||
stride[0] = GST_ROUND_UP_4 (GST_VIDEO_INFO_WIDTH (info) * 3);
|
||||
offset[0] = 0;
|
||||
size[0] = stride[0] * GST_VIDEO_INFO_HEIGHT (info);
|
||||
break;
|
||||
}
|
||||
case GST_VIDEO_FORMAT_RGB16:
|
||||
{
|
||||
stride[0] = GST_ROUND_UP_4 (GST_VIDEO_INFO_WIDTH (info) * 2);
|
||||
offset[0] = 0;
|
||||
size[0] = stride[0] * GST_VIDEO_INFO_HEIGHT (info);
|
||||
break;
|
||||
}
|
||||
case GST_VIDEO_FORMAT_RGBA:
|
||||
case GST_VIDEO_FORMAT_BGRA:
|
||||
case GST_VIDEO_FORMAT_ARGB:
|
||||
case GST_VIDEO_FORMAT_ABGR:
|
||||
case GST_VIDEO_FORMAT_RGBx:
|
||||
case GST_VIDEO_FORMAT_BGRx:
|
||||
case GST_VIDEO_FORMAT_xRGB:
|
||||
case GST_VIDEO_FORMAT_xBGR:
|
||||
case GST_VIDEO_FORMAT_AYUV:
|
||||
{
|
||||
stride[0] = GST_ROUND_UP_4 (GST_VIDEO_INFO_WIDTH (info) * 4);
|
||||
offset[0] = 0;
|
||||
size[0] = stride[0] * GST_VIDEO_INFO_HEIGHT (info);
|
||||
break;
|
||||
}
|
||||
case GST_VIDEO_FORMAT_NV12:
|
||||
case GST_VIDEO_FORMAT_NV21:
|
||||
{
|
||||
size[comp] = stride[comp] * GST_VIDEO_INFO_COMP_HEIGHT (info, comp);
|
||||
if (comp == 0) {
|
||||
stride[0] = GST_ROUND_UP_4 (GST_VIDEO_INFO_COMP_WIDTH (info, 1));
|
||||
offset[0] = 0;
|
||||
} else {
|
||||
stride[1] = GST_ROUND_UP_4 (GST_VIDEO_INFO_COMP_WIDTH (info, 1) * 2);
|
||||
offset[1] = size[0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GST_VIDEO_FORMAT_I420:
|
||||
case GST_VIDEO_FORMAT_YV12:
|
||||
case GST_VIDEO_FORMAT_Y444:
|
||||
case GST_VIDEO_FORMAT_Y42B:
|
||||
case GST_VIDEO_FORMAT_Y41B:
|
||||
{
|
||||
stride[comp] = GST_ROUND_UP_4 (GST_VIDEO_INFO_COMP_WIDTH (info, comp));
|
||||
size[comp] = stride[comp] * GST_VIDEO_INFO_COMP_HEIGHT (info, comp);
|
||||
if (comp == 0)
|
||||
offset[0] = 0;
|
||||
else if (comp == 1)
|
||||
offset[1] = size[0];
|
||||
else
|
||||
offset[2] = offset[1] + size[1];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
GST_WARNING ("unsupported %s",
|
||||
gst_video_format_to_string (GST_VIDEO_INFO_FORMAT (info)));
|
||||
break;
|
||||
}
|
||||
|
||||
gst_gl_context_thread_add (context,
|
||||
(GstGLContextThreadFunc) _gen_texture_full, &data);
|
||||
|
||||
*pTexture = data.result;
|
||||
}
|
||||
|
||||
typedef struct _GenFBO
|
||||
{
|
||||
GstGLFramebuffer *frame;
|
||||
|
|
|
@ -68,16 +68,6 @@ typedef void (*GLCB) (gint, gint, guint, gpointer stuff);
|
|||
*/
|
||||
typedef void (*GLCB_V2) (gpointer stuff);
|
||||
|
||||
/* deprecated. replaced by GstGLMemory */
|
||||
void gst_gl_context_gen_texture (GstGLContext * context, GLuint * pTexture,
|
||||
GstVideoFormat v_format, GLint width, GLint height);
|
||||
/* deprecated. replaced by GstGLMemory */
|
||||
void gst_gl_context_del_texture (GstGLContext * context, GLuint * pTexture);
|
||||
|
||||
/* deprecated. replaced by GstGLMemory */
|
||||
void gst_gl_generate_texture_full (GstGLContext * context, const GstVideoInfo * info,
|
||||
const guint comp, gint stride[], gsize offset[], gsize size[], GLuint * pTexture);
|
||||
|
||||
gboolean gst_gl_context_gen_fbo (GstGLContext * context, gint width, gint height,
|
||||
GLuint * fbo, GLuint * depthbuffer);
|
||||
gboolean gst_gl_context_use_fbo_v2 (GstGLContext * context, gint texture_fbo_width,
|
||||
|
|
Loading…
Reference in a new issue