|
Packit |
971217 |
/*
|
|
Packit |
971217 |
* GStreamer
|
|
Packit |
971217 |
* Copyright (C) 2016 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 |
#ifndef __GST_GL_QUERY_H__
|
|
Packit |
971217 |
#define __GST_GL_QUERY_H__
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#include <gst/gl/gstgl_fwd.h>
|
|
Packit |
971217 |
#include <gst/gl/gstgldebug.h>
|
|
Packit |
971217 |
|
|
Packit |
971217 |
G_BEGIN_DECLS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/**
|
|
Packit |
971217 |
* GstGLQueryType:
|
|
Packit |
971217 |
* @GST_GL_QUERY_NONE: no query
|
|
Packit |
971217 |
* @GST_GL_QUERY_TIME_ELAPSED: query the time elapsed
|
|
Packit |
971217 |
* @GST_GL_QUERY_TIMESTAMP: query the current time
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
typedef enum
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
GST_GL_QUERY_NONE,
|
|
Packit |
971217 |
GST_GL_QUERY_TIME_ELAPSED,
|
|
Packit |
971217 |
GST_GL_QUERY_TIMESTAMP,
|
|
Packit |
971217 |
} GstGLQueryType;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/**
|
|
Packit |
971217 |
* GstGLQuery:
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* Opaque #GstGLQuery struct
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
struct _GstGLQuery
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
/* <private> */
|
|
Packit |
971217 |
GstGLContext * context;
|
|
Packit |
971217 |
guint query_type;
|
|
Packit |
971217 |
guint query_id;
|
|
Packit |
971217 |
gboolean supported;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
gboolean start_called;
|
|
Packit |
971217 |
GstGLAsyncDebug debug;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* <private> */
|
|
Packit |
971217 |
gpointer _padding[GST_PADDING];
|
|
Packit |
971217 |
};
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_GL_API
|
|
Packit |
971217 |
void gst_gl_query_init (GstGLQuery * query,
|
|
Packit |
971217 |
GstGLContext * context,
|
|
Packit |
971217 |
GstGLQueryType query_type);
|
|
Packit |
971217 |
GST_GL_API
|
|
Packit |
971217 |
void gst_gl_query_unset (GstGLQuery * query);
|
|
Packit |
971217 |
GST_GL_API
|
|
Packit |
971217 |
GstGLQuery * gst_gl_query_new (GstGLContext * context,
|
|
Packit |
971217 |
GstGLQueryType query_type);
|
|
Packit |
971217 |
GST_GL_API
|
|
Packit |
971217 |
void gst_gl_query_free (GstGLQuery * query);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_GL_API
|
|
Packit |
971217 |
void gst_gl_query_start (GstGLQuery * query);
|
|
Packit |
971217 |
GST_GL_API
|
|
Packit |
971217 |
void gst_gl_query_end (GstGLQuery * query);
|
|
Packit |
971217 |
GST_GL_API
|
|
Packit |
971217 |
void gst_gl_query_counter (GstGLQuery * query);
|
|
Packit |
971217 |
GST_GL_API
|
|
Packit |
971217 |
guint64 gst_gl_query_result (GstGLQuery * query);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#define gst_gl_query_start_log_valist(query,cat,level,object,format,varargs) \
|
|
Packit |
971217 |
G_STMT_START { \
|
|
Packit |
971217 |
GST_GL_ASYNC_CAT_LEVEL_LOG_valist (&(query)->debug, cat, level, object, format, varargs); \
|
|
Packit |
971217 |
gst_gl_async_debug_freeze (&(query)->debug); \
|
|
Packit |
971217 |
gst_gl_query_start (query); \
|
|
Packit |
971217 |
gst_gl_async_debug_thaw (&(query)->debug); \
|
|
Packit |
971217 |
} G_STMT_END
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#define gst_gl_query_counter_log_valist(query,cat,level,object,format,varargs) \
|
|
Packit |
971217 |
G_STMT_START { \
|
|
Packit |
971217 |
GST_GL_ASYNC_CAT_LEVEL_LOG_valist (&(query)->debug, cat, level, object, format, varargs); \
|
|
Packit |
971217 |
gst_gl_async_debug_freeze (&(query)->debug); \
|
|
Packit |
971217 |
gst_gl_query_counter (query); \
|
|
Packit |
971217 |
gst_gl_async_debug_thaw (&(query)->debug); \
|
|
Packit |
971217 |
} G_STMT_END
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#if G_HAVE_ISO_VARARGS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#define gst_gl_query_start_log(query,cat,level,object,format,...) \
|
|
Packit |
971217 |
G_STMT_START { \
|
|
Packit |
971217 |
GST_GL_ASYNC_CAT_LEVEL_LOG (&(query)->debug, cat, level, object, format, __VA_ARGS__); \
|
|
Packit |
971217 |
gst_gl_async_debug_freeze (&(query)->debug); \
|
|
Packit |
971217 |
gst_gl_query_start (query); \
|
|
Packit |
971217 |
gst_gl_async_debug_thaw (&(query)->debug); \
|
|
Packit |
971217 |
} G_STMT_END
|
|
Packit |
971217 |
#define gst_gl_query_counter_log(query,cat,level,object,format,...) \
|
|
Packit |
971217 |
G_STMT_START { \
|
|
Packit |
971217 |
GST_GL_ASYNC_CAT_LEVEL_LOG (&(query)->debug, cat, level, object, format, __VA_ARGS__); \
|
|
Packit |
971217 |
gst_gl_async_debug_freeze (&(query)->debug); \
|
|
Packit |
971217 |
gst_gl_query_counter (query); \
|
|
Packit |
971217 |
gst_gl_async_debug_thaw (&(query)->debug); \
|
|
Packit |
971217 |
} G_STMT_END
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#else /* G_HAVE_ISO_VARARGS */
|
|
Packit |
971217 |
#if G_HAVE_GNUC_VARARGS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#define gst_gl_query_start_log(query,cat,level,object,format,args...) \
|
|
Packit |
971217 |
G_STMT_START { \
|
|
Packit |
971217 |
GST_GL_ASYNC_CAT_LEVEL_LOG (&(query)->debug, cat, level, object, format, ##args); \
|
|
Packit |
971217 |
gst_gl_async_debug_freeze (&(query)->debug); \
|
|
Packit |
971217 |
gst_gl_query_start (query); \
|
|
Packit |
971217 |
gst_gl_async_debug_thaw (&(query)->debug); \
|
|
Packit |
971217 |
} G_STMT_END
|
|
Packit |
971217 |
#define gst_gl_query_counter_log(query,cat,level,object,format,args...) \
|
|
Packit |
971217 |
G_STMT_START { \
|
|
Packit |
971217 |
GST_GL_ASYNC_CAT_LEVEL_LOG (&(query)->debug, cat, level, object, format, ##args); \
|
|
Packit |
971217 |
gst_gl_async_debug_freeze (&(query)->debug); \
|
|
Packit |
971217 |
gst_gl_query_counter (query); \
|
|
Packit |
971217 |
gst_gl_async_debug_thaw (&(query)->debug); \
|
|
Packit |
971217 |
} G_STMT_END
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#else /* G_HAVE_GNUC_VARARGS */
|
|
Packit |
971217 |
|
|
Packit |
971217 |
static inline void
|
|
Packit |
971217 |
gst_gl_query_start_log(GstGLQuery * query, GstDebugCategory * cat,
|
|
Packit |
971217 |
GstDebugLevel level, GObject * object, const gchar * format, ...)
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
va_list varargs;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
va_start (varargs, format);
|
|
Packit |
971217 |
gst_gl_query_start_log_valist (query, cat, level, object, format, varargs);
|
|
Packit |
971217 |
va_end (varargs);
|
|
Packit |
971217 |
}
|
|
Packit |
971217 |
|
|
Packit |
971217 |
static inline void
|
|
Packit |
971217 |
gst_gl_query_counter_log(GstGLQuery * query, GstDebugCategory * cat,
|
|
Packit |
971217 |
GstDebugLevel level, GObject * object, const gchar * format, ...)
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
va_list varargs;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
va_start (varargs, format);
|
|
Packit |
971217 |
gst_gl_query_counter_log_valist (query, cat, level, object, format, varargs);
|
|
Packit |
971217 |
va_end (varargs);
|
|
Packit |
971217 |
}
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#endif /* G_HAVE_GNUC_VARARGS */
|
|
Packit |
971217 |
#endif /* G_HAVE_ISO_VARARGS */
|
|
Packit |
971217 |
|
|
Packit |
971217 |
G_END_DECLS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#endif /* __GST_GL_QUERY_H__ */
|