[586/906] fix up some debug statements to get them into the right categories

This commit is contained in:
Matthew Waters 2012-09-20 23:21:19 +10:00
parent e7b918efbc
commit 28863c4bb4
2 changed files with 40 additions and 13 deletions

View file

@ -39,11 +39,16 @@ struct _GstGLBufferPoolPrivate
static void gst_gl_buffer_pool_finalize (GObject * object); static void gst_gl_buffer_pool_finalize (GObject * object);
GST_DEBUG_CATEGORY_STATIC (GST_CAT_GL_BUFFER_POOL);
#define GST_CAT_DEFAULT GST_CAT_GL_BUFFER_POOL
#define GST_GL_BUFFER_POOL_GET_PRIVATE(obj) \ #define GST_GL_BUFFER_POOL_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_BUFFER_POOL, GstGLBufferPoolPrivate)) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_BUFFER_POOL, GstGLBufferPoolPrivate))
#define gst_gl_buffer_pool_parent_class parent_class #define gst_gl_buffer_pool_parent_class parent_class
G_DEFINE_TYPE (GstGLBufferPool, gst_gl_buffer_pool, GST_TYPE_BUFFER_POOL); G_DEFINE_TYPE_WITH_CODE (GstGLBufferPool, gst_gl_buffer_pool,
GST_TYPE_BUFFER_POOL, GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_BUFFER_POOL,
"glbufferpool", 0, "GL Buffer Pool"));
static const gchar ** static const gchar **
gst_gl_buffer_pool_get_options (GstBufferPool * pool) gst_gl_buffer_pool_get_options (GstBufferPool * pool)

View file

@ -64,7 +64,9 @@ _gl_mem_init (GstGLMemory * mem, GstAllocator * allocator, GstMemory * parent,
mem->download = mem->download =
gst_gl_display_find_download (display, v_format, width, height); gst_gl_display_find_download (display, v_format, width, height);
GST_DEBUG ("new GL texture memory"); GST_CAT_DEBUG (GST_CAT_GL_MEMORY,
"new GL texture memory:%p format:%u dimensions:%ux%u", mem, v_format,
width, height);
} }
static GstGLMemory * static GstGLMemory *
@ -77,10 +79,11 @@ _gl_mem_new (GstAllocator * allocator, GstMemory * parent,
gst_gl_display_gen_texture (display, &tex_id, v_format, width, height); gst_gl_display_gen_texture (display, &tex_id, v_format, width, height);
if (!tex_id) { if (!tex_id) {
GST_WARNING ("Could not create GL texture with display:%p", display); GST_CAT_WARNING (GST_CAT_GL_MEMORY,
"Could not create GL texture with display:%p", display);
} }
GST_TRACE ("created texture %u", tex_id); GST_CAT_TRACE (GST_CAT_GL_MEMORY, "created texture %u", tex_id);
mem = g_slice_alloc (sizeof (GstGLMemory)); mem = g_slice_alloc (sizeof (GstGLMemory));
_gl_mem_init (mem, allocator, parent, display, v_format, width, height, _gl_mem_init (mem, allocator, parent, display, v_format, width, height,
@ -100,6 +103,8 @@ _gl_mem_map (GstGLMemory * gl_mem, gsize maxsize, GstMapFlags flags)
if ((flags & GST_MAP_GL) == GST_MAP_GL) { if ((flags & GST_MAP_GL) == GST_MAP_GL) {
if ((flags & GST_MAP_READ) == GST_MAP_READ) { if ((flags & GST_MAP_READ) == GST_MAP_READ) {
GST_CAT_TRACE (GST_CAT_GL_MEMORY, "mapping GL texture:%u for reading",
gl_mem->tex_id);
if (GST_GL_MEMORY_FLAG_IS_SET (gl_mem, GST_GL_MEMORY_FLAG_NEED_UPLOAD)) { if (GST_GL_MEMORY_FLAG_IS_SET (gl_mem, GST_GL_MEMORY_FLAG_NEED_UPLOAD)) {
if (!GST_GL_MEMORY_FLAG_IS_SET (gl_mem, if (!GST_GL_MEMORY_FLAG_IS_SET (gl_mem,
GST_GL_MEMORY_FLAG_UPLOAD_INITTED)) { GST_GL_MEMORY_FLAG_UPLOAD_INITTED)) {
@ -110,11 +115,17 @@ _gl_mem_map (GstGLMemory * gl_mem, gsize maxsize, GstMapFlags flags)
gst_gl_upload_perform_with_memory (gl_mem->upload, gl_mem); gst_gl_upload_perform_with_memory (gl_mem->upload, gl_mem);
} }
} else {
GST_CAT_TRACE (GST_CAT_GL_MEMORY, "mapping GL texture:%u for writing",
gl_mem->tex_id);
} }
data = &gl_mem->tex_id; data = &gl_mem->tex_id;
} else { /* not GL */ } else { /* not GL */
if ((flags & GST_MAP_READ) == GST_MAP_READ) { if ((flags & GST_MAP_READ) == GST_MAP_READ) {
GST_CAT_TRACE (GST_CAT_GL_MEMORY,
"mapping GL texture:%u for reading from system memory",
gl_mem->tex_id);
if (GST_GL_MEMORY_FLAG_IS_SET (gl_mem, GST_GL_MEMORY_FLAG_NEED_DOWNLOAD)) { if (GST_GL_MEMORY_FLAG_IS_SET (gl_mem, GST_GL_MEMORY_FLAG_NEED_DOWNLOAD)) {
if (!GST_GL_MEMORY_FLAG_IS_SET (gl_mem, if (!GST_GL_MEMORY_FLAG_IS_SET (gl_mem,
GST_GL_MEMORY_FLAG_DOWNLOAD_INITTED)) { GST_GL_MEMORY_FLAG_DOWNLOAD_INITTED)) {
@ -125,6 +136,9 @@ _gl_mem_map (GstGLMemory * gl_mem, gsize maxsize, GstMapFlags flags)
gst_gl_download_perform_with_memory (gl_mem->download, gl_mem); gst_gl_download_perform_with_memory (gl_mem->download, gl_mem);
} }
} else {
GST_CAT_TRACE (GST_CAT_GL_MEMORY,
"mapping GL texture:%u for writing to system memory", gl_mem->tex_id);
} }
data = gl_mem->data; data = gl_mem->data;
@ -177,10 +191,11 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
gst_gl_display_gen_texture_thread (src->display, &tex_id, v_format, width, gst_gl_display_gen_texture_thread (src->display, &tex_id, v_format, width,
height); height);
if (!tex_id) { if (!tex_id) {
GST_WARNING ("Could not create GL texture with display:%p", src->display); GST_CAT_WARNING (GST_CAT_GL_MEMORY,
"Could not create GL texture with display:%p", src->display);
} }
GST_DEBUG ("created texture %i", tex_id); GST_CAT_DEBUG (GST_CAT_GL_MEMORY, "created texture %i", tex_id);
/* create a framebuffer object */ /* create a framebuffer object */
glGenFramebuffersEXT (1, &fboId); glGenFramebuffersEXT (1, &fboId);
@ -217,27 +232,30 @@ _gl_mem_copy_thread (GstGLDisplay * display, gpointer data)
if (status != GL_FRAMEBUFFER_COMPLETE) { if (status != GL_FRAMEBUFFER_COMPLETE) {
switch (status) { switch (status) {
case GL_FRAMEBUFFER_UNSUPPORTED_EXT: case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
GST_ERROR ("GL_FRAMEBUFFER_UNSUPPORTED"); GST_CAT_ERROR (GST_CAT_GL_MEMORY, "GL_FRAMEBUFFER_UNSUPPORTED");
break; break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
GST_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); GST_CAT_ERROR (GST_CAT_GL_MEMORY,
"GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT");
break; break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
GST_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); GST_CAT_ERROR (GST_CAT_GL_MEMORY,
"GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");
break; break;
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
GST_ERROR ("GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS"); GST_CAT_ERROR (GST_CAT_GL_MEMORY,
"GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS");
break; break;
#ifndef OPENGL_ES2 #ifndef OPENGL_ES2
case GL_FRAMEBUFFER_UNDEFINED: case GL_FRAMEBUFFER_UNDEFINED:
GST_ERROR ("GL_FRAMEBUFFER_UNDEFINED"); GST_CAT_ERROR (GST_CAT_GL_MEMORY, "GL_FRAMEBUFFER_UNDEFINED");
break; break;
#endif #endif
default: default:
GST_ERROR ("Unknown FBO error"); GST_CAT_ERROR (GST_CAT_GL_MEMORY, "Unknown FBO error");
} }
goto fbo_error; goto fbo_error;
} }
@ -283,15 +301,19 @@ _gl_mem_copy (GstGLMemory * src, gssize offset, gssize size)
src->width, src->height, NULL, NULL); src->width, src->height, NULL, NULL);
if (!copy_params.tex_id) if (!copy_params.tex_id)
GST_WARNING ("Could not copy GL Memory"); GST_CAT_WARNING (GST_CAT_GL_MEMORY, "Could not copy GL Memory");
dest->tex_id = copy_params.tex_id; dest->tex_id = copy_params.tex_id;
dest->data = g_malloc (src->mem.maxsize); dest->data = g_malloc (src->mem.maxsize);
if (dest->data == NULL) { if (dest->data == NULL) {
GST_CAT_WARNING (GST_CAT_GL_MEMORY, "Could not copy GL Memory");
gst_memory_unref ((GstMemory *) dest); gst_memory_unref ((GstMemory *) dest);
return NULL; return NULL;
} }
GST_CAT_DEBUG (GST_CAT_GL_MEMORY, "copied texture:%u into texture %u",
src->tex_id, dest->tex_id);
return (GstMemory *) dest; return (GstMemory *) dest;
} }