mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
[709/906] display: some more cleanups
This commit is contained in:
parent
6e86d0e920
commit
2ae5b50fa4
2 changed files with 11 additions and 30 deletions
|
@ -25,23 +25,10 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <gst/gst.h>
|
|
||||||
#include <gst/video/gstvideosink.h>
|
|
||||||
#include "gstgldownload.h"
|
|
||||||
#include "gstglmemory.h"
|
#include "gstglmemory.h"
|
||||||
#include "gstglfeature.h"
|
|
||||||
#include "gstglapi.h"
|
|
||||||
|
|
||||||
#include "gstgldisplay.h"
|
#include "gstgldisplay.h"
|
||||||
|
|
||||||
#define USING_OPENGL(display) (display->gl_api & GST_GL_API_OPENGL)
|
|
||||||
#define USING_OPENGL3(display) (display->gl_api & GST_GL_API_OPENGL3)
|
|
||||||
#define USING_GLES(display) (display->gl_api & GST_GL_API_GLES)
|
|
||||||
#define USING_GLES2(display) (display->gl_api & GST_GL_API_GLES2)
|
|
||||||
#define USING_GLES3(display) (display->gl_api & GST_GL_API_GLES3)
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);
|
||||||
#define GST_CAT_DEFAULT gst_gl_display_debug
|
#define GST_CAT_DEFAULT gst_gl_display_debug
|
||||||
|
|
||||||
|
@ -55,11 +42,11 @@ G_DEFINE_TYPE_WITH_CODE (GstGLDisplay, gst_gl_display, G_TYPE_OBJECT,
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_DISPLAY, GstGLDisplayPrivate))
|
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_DISPLAY, GstGLDisplayPrivate))
|
||||||
|
|
||||||
static void gst_gl_display_finalize (GObject * object);
|
static void gst_gl_display_finalize (GObject * object);
|
||||||
|
static void _gst_gl_display_thread_run_generic (GstGLDisplay * display);
|
||||||
|
|
||||||
struct _GstGLDisplayPrivate
|
struct _GstGLDisplayPrivate
|
||||||
{
|
{
|
||||||
/* generic gl code */
|
GstGLDisplayThreadFunc func;
|
||||||
GstGLDisplayThreadFunc generic_callback;
|
|
||||||
gpointer data;
|
gpointer data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -105,13 +92,13 @@ gst_gl_display_finalize (GObject * object)
|
||||||
G_OBJECT_CLASS (gst_gl_display_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gst_gl_display_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
gst_gl_display_thread_run_generic (GstGLDisplay * display)
|
_gst_gl_display_thread_run_generic (GstGLDisplay * display)
|
||||||
{
|
{
|
||||||
GST_TRACE ("running function:%p data:%p",
|
GST_TRACE ("running function:%p data:%p",
|
||||||
display->priv->generic_callback, display->priv->data);
|
display->priv->func, display->priv->data);
|
||||||
|
|
||||||
display->priv->generic_callback (display, display->priv->data);
|
display->priv->func (display, display->priv->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
GstGLDisplay *
|
GstGLDisplay *
|
||||||
|
@ -131,10 +118,10 @@ gst_gl_display_thread_add (GstGLDisplay * display,
|
||||||
gst_gl_display_lock (display);
|
gst_gl_display_lock (display);
|
||||||
|
|
||||||
display->priv->data = data;
|
display->priv->data = data;
|
||||||
display->priv->generic_callback = func;
|
display->priv->func = func;
|
||||||
|
|
||||||
gst_gl_window_send_message (display->window,
|
gst_gl_window_send_message (display->window,
|
||||||
GST_GL_WINDOW_CB (gst_gl_display_thread_run_generic), display);
|
GST_GL_WINDOW_CB (_gst_gl_display_thread_run_generic), display);
|
||||||
|
|
||||||
gst_gl_display_unlock (display);
|
gst_gl_display_unlock (display);
|
||||||
}
|
}
|
||||||
|
@ -151,13 +138,9 @@ gst_gl_display_get_gl_api (GstGLDisplay * display)
|
||||||
gpointer
|
gpointer
|
||||||
gst_gl_display_get_gl_vtable (GstGLDisplay * display)
|
gst_gl_display_get_gl_vtable (GstGLDisplay * display)
|
||||||
{
|
{
|
||||||
gpointer gl;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_GL_DISPLAY (display), NULL);
|
g_return_val_if_fail (GST_IS_GL_DISPLAY (display), NULL);
|
||||||
|
|
||||||
gl = display->gl_vtable;
|
return display->gl_vtable;
|
||||||
|
|
||||||
return gl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -94,10 +94,8 @@ void gst_gl_display_thread_add (GstGLDisplay * display,
|
||||||
GstGLDisplayThreadFunc func, gpointer data);
|
GstGLDisplayThreadFunc func, gpointer data);
|
||||||
|
|
||||||
#define GST_GL_DISPLAY_CONTEXT_TYPE "gst.gl.GLDisplay"
|
#define GST_GL_DISPLAY_CONTEXT_TYPE "gst.gl.GLDisplay"
|
||||||
void gst_context_set_gl_display (GstContext * context,
|
void gst_context_set_gl_display (GstContext * context, GstGLDisplay * display);
|
||||||
GstGLDisplay * display);
|
gboolean gst_context_get_gl_display (GstContext * context, GstGLDisplay ** display);
|
||||||
gboolean gst_context_get_gl_display (GstContext * context,
|
|
||||||
GstGLDisplay ** display);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue