Blame gst-libs/gst/gl/gstgldebug.c

Packit 971217
/*
Packit 971217
 * GStreamer
Packit 971217
 * Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
Packit 971217
 *
Packit 971217
 * This library is free software; you can redistribute it and/or
Packit 971217
 * modify it under the terms of the GNU Library General Public
Packit 971217
 * License as published by the Free Software Foundation; either
Packit 971217
 * version 2 of the License, or (at your option) any later version.
Packit 971217
 *
Packit 971217
 * This library is distributed in the hope that it will be useful,
Packit 971217
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 971217
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 971217
 * Library General Public License for more details.
Packit 971217
 *
Packit 971217
 * You should have received a copy of the GNU Library General Public
Packit 971217
 * License along with this library; if not, write to the
Packit 971217
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 971217
 * Boston, MA 02110-1301, USA.
Packit 971217
 */
Packit 971217
Packit 971217
#ifdef HAVE_CONFIG_H
Packit 971217
#include "config.h"
Packit 971217
#endif
Packit 971217
Packit 971217
#include "gstgldebug.h"
Packit 971217
Packit 971217
#include <glib/gprintf.h>
Packit 971217
#include <string.h>
Packit 971217
Packit 971217
#include "gstglcontext.h"
Packit 971217
#include "gstglcontext_private.h"
Packit 971217
#include "gstglfuncs.h"
Packit 971217
Packit 971217
/**
Packit 971217
 * SECTION:gstgldebug
Packit 971217
 * @short_description: helper routines for dealing with OpenGL debugging
Packit 971217
 * @title: OpenGL debugging
Packit 971217
 * @see_also: #GstGLContext
Packit 971217
 */
Packit 971217
Packit 971217
#define ASYNC_DEBUG_FILLED (1 << 0)
Packit 971217
#define ASYNC_DEBUG_FROZEN (1 << 1)
Packit 971217
Packit 971217
/* compatibility defines */
Packit 971217
#ifndef GL_DEBUG_TYPE_ERROR
Packit 971217
#define GL_DEBUG_TYPE_ERROR 0x824C
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR
Packit 971217
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR
Packit 971217
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_TYPE_PORTABILITY
Packit 971217
#define GL_DEBUG_TYPE_PORTABILITY 0x824F
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_TYPE_PERFORMANCE
Packit 971217
#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_TYPE_MARKER
Packit 971217
#define GL_DEBUG_TYPE_MARKER 0x8268
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_TYPE_OTHER
Packit 971217
#define GL_DEBUG_TYPE_OTHER 0x8251
Packit 971217
#endif
Packit 971217
Packit 971217
#ifndef GL_DEBUG_SEVERITY_HIGH
Packit 971217
#define GL_DEBUG_SEVERITY_HIGH 0x9146
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_SEVERITY_MEDIUM
Packit 971217
#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_SEVERITY_LOW
Packit 971217
#define GL_DEBUG_SEVERITY_LOW 0x9148
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_SEVERITY_NOTIFICATION
Packit 971217
#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
Packit 971217
#endif
Packit 971217
Packit 971217
#ifndef GL_DEBUG_SOURCE_API
Packit 971217
#define GL_DEBUG_SOURCE_API 0x8246
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_SOURCE_WINDOW_SYSTEM
Packit 971217
#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_SOURCE_SHADER_COMPILER
Packit 971217
#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_SOURCE_THIRD_PARTY
Packit 971217
#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_SOURCE_APPLICATION
Packit 971217
#define GL_DEBUG_SOURCE_APPLICATION 0x824A
Packit 971217
#endif
Packit 971217
#ifndef GL_DEBUG_SOURCE_OTHER
Packit 971217
#define GL_DEBUG_SOURCE_OTHER 0x824B
Packit 971217
#endif
Packit 971217
Packit 971217
GST_DEBUG_CATEGORY_STATIC (gst_performance);
Packit 971217
#define GST_CAT_DEFAULT gst_gl_debug
Packit 971217
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
Packit 971217
GST_DEBUG_CATEGORY_STATIC (default_debug);
Packit 971217
GST_DEBUG_CATEGORY_STATIC (gst_gl_marker_debug);
Packit 971217
Packit 971217
static void
Packit 971217
_init_debug (void)
Packit 971217
{
Packit 971217
  static volatile gsize _init = 0;
Packit 971217
Packit 971217
  if (g_once_init_enter (&_init)) {
Packit 971217
    GST_DEBUG_CATEGORY_GET (gst_performance, "GST_PERFORMANCE");
Packit 971217
    GST_DEBUG_CATEGORY_GET (gst_gl_debug, "gldebug");
Packit 971217
    GST_DEBUG_CATEGORY_GET (default_debug, "default");
Packit 971217
    GST_DEBUG_CATEGORY_INIT (gst_gl_marker_debug, "gldebugmarker", 0,
Packit 971217
        "OpenGL Markers");
Packit 971217
    g_once_init_leave (&_init, 1);
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
static void
Packit 971217
_free_async_debug_data (GstGLAsyncDebug * ad)
Packit 971217
{
Packit 971217
  if (ad->debug_msg) {
Packit 971217
    g_free (ad->debug_msg);
Packit 971217
    ad->debug_msg = NULL;
Packit 971217
    if (ad->object)
Packit 971217
      g_object_unref (ad->object);
Packit 971217
    ad->object = NULL;
Packit 971217
    ad->state_flags &= ~ASYNC_DEBUG_FILLED;
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_init:
Packit 971217
 * @ad: a #GstGLAsyncDebug
Packit 971217
 *
Packit 971217
 * Initialize @ad.  Intended for use with #GstGLAsyncDebug's that are embedded
Packit 971217
 * in other structs.
Packit 971217
 *
Packit 971217
 * Since: 1.8
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_async_debug_init (GstGLAsyncDebug * ad)
Packit 971217
{
Packit 971217
  _init_debug ();
Packit 971217
Packit 971217
  memset (ad, 0, sizeof (*ad));
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_unset:
Packit 971217
 * @ad: a #GstGLAsyncDebug
Packit 971217
 *
Packit 971217
 * Unset any dynamically allocated data.  Intended for use with
Packit 971217
 * #GstGLAsyncDebug's that are embedded in other structs.
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_async_debug_unset (GstGLAsyncDebug * ad)
Packit 971217
{
Packit 971217
  gst_gl_async_debug_output_log_msg (ad);
Packit 971217
Packit 971217
  _free_async_debug_data (ad);
Packit 971217
Packit 971217
  if (ad->notify)
Packit 971217
    ad->notify (ad->user_data);
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_new: (skip)
Packit 971217
 *
Packit 971217
 * Free with gst_gl_async_debug_free()
Packit 971217
 *
Packit 971217
 * Returns: a new #GstGLAsyncDebug
Packit 971217
 *
Packit 971217
 * Since: 1.8
Packit 971217
 */
Packit 971217
GstGLAsyncDebug *
Packit 971217
gst_gl_async_debug_new (void)
Packit 971217
{
Packit 971217
  return g_new0 (GstGLAsyncDebug, 1);
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_free:
Packit 971217
 * @ad: a #GstGLAsyncDebug
Packit 971217
 *
Packit 971217
 * Frees @ad
Packit 971217
 *
Packit 971217
 * Since: 1.8
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_async_debug_free (GstGLAsyncDebug * ad)
Packit 971217
{
Packit 971217
  gst_gl_async_debug_unset (ad);
Packit 971217
  g_free (ad);
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_freeze:
Packit 971217
 * @ad: a #GstGLAsyncDebug
Packit 971217
 *
Packit 971217
 * freeze the debug output.  While frozen, any call to
Packit 971217
 * gst_gl_async_debug_output_log_msg() will not output any messages but
Packit 971217
 * subsequent calls to gst_gl_async_debug_store_log_msg() will overwrite previous
Packit 971217
 * messages.
Packit 971217
 *
Packit 971217
 * Since: 1.8
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_async_debug_freeze (GstGLAsyncDebug * ad)
Packit 971217
{
Packit 971217
  ad->state_flags |= ASYNC_DEBUG_FROZEN;
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_thaw:
Packit 971217
 * @ad: a #GstGLAsyncDebug
Packit 971217
 *
Packit 971217
 * unfreeze the debug output.  See gst_gl_async_debug_freeze() for what freezing means
Packit 971217
 *
Packit 971217
 * Since: 1.8
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_async_debug_thaw (GstGLAsyncDebug * ad)
Packit 971217
{
Packit 971217
  ad->state_flags &= ~ASYNC_DEBUG_FROZEN;
Packit 971217
}
Packit 971217
Packit 971217
#if !defined(GST_DISABLE_GST_DEBUG)
Packit 971217
Packit 971217
static inline const gchar *
Packit 971217
_debug_severity_to_string (GLenum severity)
Packit 971217
{
Packit 971217
  switch (severity) {
Packit 971217
    case GL_DEBUG_SEVERITY_HIGH:
Packit 971217
      return "high";
Packit 971217
    case GL_DEBUG_SEVERITY_MEDIUM:
Packit 971217
      return "medium";
Packit 971217
    case GL_DEBUG_SEVERITY_LOW:
Packit 971217
      return "low";
Packit 971217
    case GL_DEBUG_SEVERITY_NOTIFICATION:
Packit 971217
      return "notification";
Packit 971217
    default:
Packit 971217
      return "invalid";
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
static inline const gchar *
Packit 971217
_debug_source_to_string (GLenum source)
Packit 971217
{
Packit 971217
  switch (source) {
Packit 971217
    case GL_DEBUG_SOURCE_API:
Packit 971217
      return "API";
Packit 971217
    case GL_DEBUG_SOURCE_WINDOW_SYSTEM:
Packit 971217
      return "winsys";
Packit 971217
    case GL_DEBUG_SOURCE_SHADER_COMPILER:
Packit 971217
      return "shader compiler";
Packit 971217
    case GL_DEBUG_SOURCE_THIRD_PARTY:
Packit 971217
      return "third party";
Packit 971217
    case GL_DEBUG_SOURCE_APPLICATION:
Packit 971217
      return "application";
Packit 971217
    case GL_DEBUG_SOURCE_OTHER:
Packit 971217
      return "other";
Packit 971217
    default:
Packit 971217
      return "invalid";
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
static inline const gchar *
Packit 971217
_debug_type_to_string (GLenum type)
Packit 971217
{
Packit 971217
  switch (type) {
Packit 971217
    case GL_DEBUG_TYPE_ERROR:
Packit 971217
      return "error";
Packit 971217
    case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
Packit 971217
      return "deprecated";
Packit 971217
    case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
Packit 971217
      return "undefined";
Packit 971217
    case GL_DEBUG_TYPE_PORTABILITY:
Packit 971217
      return "portability";
Packit 971217
    case GL_DEBUG_TYPE_PERFORMANCE:
Packit 971217
      return "performance";
Packit 971217
    case GL_DEBUG_TYPE_MARKER:
Packit 971217
      return "debug marker";
Packit 971217
    case GL_DEBUG_TYPE_OTHER:
Packit 971217
      return "other";
Packit 971217
    default:
Packit 971217
      return "invalid";
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
static void GSTGLAPI
Packit 971217
_gst_gl_debug_callback (GLenum source, GLenum type, GLuint id, GLenum severity,
Packit 971217
    GLsizei length, const gchar * message, gpointer user_data)
Packit 971217
{
Packit 971217
  GstGLContext *context = user_data;
Packit 971217
  const gchar *severity_str = _debug_severity_to_string (severity);
Packit 971217
  const gchar *source_str = _debug_source_to_string (source);
Packit 971217
  const gchar *type_str = _debug_type_to_string (type);
Packit 971217
Packit 971217
  _init_debug ();
Packit 971217
Packit 971217
  switch (type) {
Packit 971217
    case GL_DEBUG_TYPE_ERROR:
Packit 971217
    case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
Packit 971217
      GST_ERROR_OBJECT (context, "%s: GL %s from %s id:%u, %s", severity_str,
Packit 971217
          type_str, source_str, id, message);
Packit 971217
      break;
Packit 971217
    case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
Packit 971217
    case GL_DEBUG_TYPE_PORTABILITY:
Packit 971217
      GST_FIXME_OBJECT (context, "%s: GL %s from %s id:%u, %s", severity_str,
Packit 971217
          type_str, source_str, id, message);
Packit 971217
      break;
Packit 971217
    case GL_DEBUG_TYPE_PERFORMANCE:
Packit 971217
      GST_CAT_DEBUG_OBJECT (gst_performance, context, "%s: GL %s from %s id:%u,"
Packit 971217
          " %s", severity_str, type_str, source_str, id, message);
Packit 971217
      break;
Packit 971217
    default:
Packit 971217
      GST_DEBUG_OBJECT (context, "%s: GL %s from %s id:%u, %s", severity_str,
Packit 971217
          type_str, source_str, id, message);
Packit 971217
      break;
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
G_GNUC_INTERNAL void _gst_gl_debug_enable (GstGLContext * context);
Packit 971217
Packit 971217
G_GNUC_INTERNAL void
Packit 971217
_gst_gl_debug_enable (GstGLContext * context)
Packit 971217
{
Packit 971217
  const GstGLFuncs *gl = context->gl_vtable;
Packit 971217
  GstDebugLevel level;
Packit 971217
  GLenum debug_types[8];
Packit 971217
  guint i, n = 0;
Packit 971217
Packit 971217
  _init_debug ();
Packit 971217
Packit 971217
  if (!gl->DebugMessageCallback) {
Packit 971217
    GST_CAT_INFO_OBJECT (gst_gl_context_debug, context,
Packit 971217
        "No debugging support available");
Packit 971217
    return;
Packit 971217
  }
Packit 971217
Packit 971217
  level = gst_debug_category_get_threshold (gst_gl_debug);
Packit 971217
Packit 971217
  if (level < GST_LEVEL_ERROR) {
Packit 971217
    GST_CAT_INFO_OBJECT (gst_gl_context_debug, context,
Packit 971217
        "Disabling GL context debugging (gldebug category debug level < error)");
Packit 971217
    return;
Packit 971217
  }
Packit 971217
Packit 971217
  GST_CAT_INFO_OBJECT (gst_gl_context_debug, context,
Packit 971217
      "Enabling GL context debugging");
Packit 971217
Packit 971217
  gl->DebugMessageCallback (_gst_gl_debug_callback, context);
Packit 971217
  if (level >= GST_LEVEL_DEBUG) {
Packit 971217
    /* enable them all */
Packit 971217
    gl->DebugMessageControl (GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, 0,
Packit 971217
        GL_TRUE);
Packit 971217
  } else {
Packit 971217
    if (level >= GST_LEVEL_FIXME) {
Packit 971217
      debug_types[n++] = GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
Packit 971217
      debug_types[n++] = GL_DEBUG_TYPE_PORTABILITY;
Packit 971217
    }
Packit 971217
    if (level >= GST_LEVEL_ERROR) {
Packit 971217
      debug_types[n++] = GL_DEBUG_TYPE_ERROR;
Packit 971217
      debug_types[n++] = GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
Packit 971217
    }
Packit 971217
    g_assert (n < G_N_ELEMENTS (debug_types));
Packit 971217
    for (i = 0; i < n; i++) {
Packit 971217
      gl->DebugMessageControl (GL_DONT_CARE, debug_types[i], GL_DONT_CARE,
Packit 971217
          0, 0, GL_TRUE);
Packit 971217
    }
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_insert_debug_marker:
Packit 971217
 * @context: a #GstGLContext
Packit 971217
 * @format: a printf-style format string
Packit 971217
 * @...: arguments form @format
Packit 971217
 *
Packit 971217
 * Inserts a marker into a GL debug stream.  Requires the 'gldebugmarker'
Packit 971217
 * debug category to be at least %GST_LEVEL_FIXME.
Packit 971217
 *
Packit 971217
 * Since: 1.8
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_insert_debug_marker (GstGLContext * context, const gchar * format, ...)
Packit 971217
{
Packit 971217
  const GstGLFuncs *gl = context->gl_vtable;
Packit 971217
  gchar *string;
Packit 971217
  gint len;
Packit 971217
  va_list args;
Packit 971217
Packit 971217
  _init_debug ();
Packit 971217
Packit 971217
  /* are we enabled */
Packit 971217
  if (gst_debug_category_get_threshold (gst_gl_marker_debug) < GST_LEVEL_FIXME)
Packit 971217
    return;
Packit 971217
Packit 971217
  va_start (args, format);
Packit 971217
  len = gst_info_vasprintf (&string, format, args);
Packit 971217
  va_end (args);
Packit 971217
Packit 971217
  /* gst_info_vasprintf() returns -1 on error, the various debug marker
Packit 971217
   * functions take len=-1 to mean null terminated */
Packit 971217
  if (len < 0 || string == NULL)
Packit 971217
    /* no debug output */
Packit 971217
    return;
Packit 971217
Packit 971217
  if (gl->DebugMessageInsert)
Packit 971217
    gl->DebugMessageInsert (GL_DEBUG_SOURCE_THIRD_PARTY, GL_DEBUG_TYPE_MARKER,
Packit 971217
        0, GL_DEBUG_SEVERITY_LOW, (gsize) len, string);
Packit 971217
  else if (gl->InsertEventMarker)
Packit 971217
    gl->InsertEventMarker (len, string);
Packit 971217
  else if (gl->StringMarker)
Packit 971217
    gl->StringMarker (len, string);
Packit 971217
Packit 971217
  g_free (string);
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_store_log_msg_valist:
Packit 971217
 * @ad: the #GstGLAsyncDebug to store the message in
Packit 971217
 * @cat: the #GstDebugCategory to output the message in
Packit 971217
 * @level: the #GstLevel
Packit 971217
 * @file: the file where the debug message originates from
Packit 971217
 * @function: the function where the debug message originates from
Packit 971217
 * @line: the line in @file where the debug message originates from
Packit 971217
 * @object: (allow-none): a #GObject to associate with the debug message
Packit 971217
 * @format: a printf style format string
Packit 971217
 * @varargs: the list of arguments for @format
Packit 971217
 *
Packit 971217
 * Stores a debug message for later output by gst_gl_async_debug_output_log_msg()
Packit 971217
 *
Packit 971217
 * Since: 1.8
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_async_debug_store_log_msg_valist (GstGLAsyncDebug * ad,
Packit 971217
    GstDebugCategory * cat, GstDebugLevel level, const gchar * file,
Packit 971217
    const gchar * function, gint line, GObject * object, const gchar * format,
Packit 971217
    va_list varargs)
Packit 971217
{
Packit 971217
  gst_gl_async_debug_output_log_msg (ad);
Packit 971217
  _free_async_debug_data (ad);
Packit 971217
Packit 971217
  if (G_UNLIKELY (level <= GST_LEVEL_MAX && level <= _gst_debug_min)) {
Packit 971217
    if (!cat)
Packit 971217
      cat = default_debug;
Packit 971217
Packit 971217
    ad->cat = cat;
Packit 971217
    ad->level = level;
Packit 971217
    ad->file = file;
Packit 971217
    ad->function = function;
Packit 971217
    ad->line = line;
Packit 971217
    if (object)
Packit 971217
      ad->object = g_object_ref (object);
Packit 971217
    else
Packit 971217
      ad->object = NULL;
Packit 971217
Packit 971217
    ad->debug_msg = gst_info_strdup_vprintf (format, varargs);
Packit 971217
    ad->state_flags |= ASYNC_DEBUG_FILLED;
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_output_log_msg:
Packit 971217
 * @ad: the #GstGLAsyncDebug to store the message in
Packit 971217
 *
Packit 971217
 * Outputs a previously stored debug message.
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_async_debug_output_log_msg (GstGLAsyncDebug * ad)
Packit 971217
{
Packit 971217
  if ((ad->state_flags & ASYNC_DEBUG_FILLED) != 0
Packit 971217
      && (ad->state_flags & ASYNC_DEBUG_FROZEN) == 0) {
Packit 971217
    gchar *msg = NULL;
Packit 971217
Packit 971217
    if (ad->callback)
Packit 971217
      msg = ad->callback (ad->user_data);
Packit 971217
Packit 971217
    gst_debug_log (ad->cat, ad->level, ad->file, ad->function, ad->line,
Packit 971217
        ad->object, "%s %s", GST_STR_NULL (ad->debug_msg), msg ? msg : "");
Packit 971217
    g_free (msg);
Packit 971217
    _free_async_debug_data (ad);
Packit 971217
  }
Packit 971217
}
Packit 971217
Packit 971217
/**
Packit 971217
 * gst_gl_async_debug_store_log_msg:
Packit 971217
 * @ad: the #GstGLAsyncDebug to store the message in
Packit 971217
 * @cat: the #GstDebugCategory to output the message in
Packit 971217
 * @level: the #GstLevel
Packit 971217
 * @file: the file where the debug message originates from
Packit 971217
 * @function: the function where the debug message originates from
Packit 971217
 * @line: the line in @file where the debug message originates from
Packit 971217
 * @object: (allow-none): a #GObject to associate with the debug message
Packit 971217
 * @format: a printf style format string
Packit 971217
 * @...: the list of arguments for @format
Packit 971217
 *
Packit 971217
 * Stores a debug message for later output by gst_gl_async_debug_output_log_msg()
Packit 971217
 *
Packit 971217
 * Since: 1.8
Packit 971217
 */
Packit 971217
void
Packit 971217
gst_gl_async_debug_store_log_msg (GstGLAsyncDebug * ad, GstDebugCategory * cat,
Packit 971217
    GstDebugLevel level, const gchar * file, const gchar * function, gint line,
Packit 971217
    GObject * object, const gchar * format, ...)
Packit 971217
{
Packit 971217
  va_list varargs;
Packit 971217
Packit 971217
  if (G_UNLIKELY (level <= GST_LEVEL_MAX && level <= _gst_debug_min)) {
Packit 971217
    va_start (varargs, format);
Packit 971217
    gst_gl_async_debug_store_log_msg_valist (ad, cat, level, file, function,
Packit 971217
        line, object, format, varargs);
Packit 971217
    va_end (varargs);
Packit 971217
  }
Packit 971217
}
Packit 971217
#else
Packit 971217
G_GNUC_INTERNAL void _gst_gl_debug_enable (GstGLContext * context);
Packit 971217
#endif