Blame ext/gl/caopengllayersink.h

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
#ifndef __CA_OPENGL_LAYER_SINK_H__
Packit 971217
#define __CA_OPENGL_LAYER_SINK_H__
Packit 971217
Packit 971217
#include <gst/gst.h>
Packit 971217
#include <gst/video/gstvideosink.h>
Packit 971217
#include <gst/video/video.h>
Packit 971217
Packit 971217
#include <gst/gl/gl.h>
Packit 971217
#include <gst/gl/gstglfuncs.h>
Packit 971217
#include <gst/gl/cocoa/gstglcaopengllayer.h>
Packit 971217
Packit 971217
G_BEGIN_DECLS
Packit 971217
Packit 971217
#define GST_TYPE_CA_OPENGL_LAYER_SINK \
Packit 971217
    (gst_ca_opengl_layer_sink_get_type())
Packit 971217
#define GST_CA_OPENGL_LAYER_SINK(obj) \
Packit 971217
    (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CA_OPENGL_LAYER_SINK,GstCAOpenGLLayerSink))
Packit 971217
#define GST_CA_OPENGL_LAYER_SINK_CLASS(klass) \
Packit 971217
    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CA_OPENGL_LAYER_SINK,GstCAOpenGLLayerSinkClass))
Packit 971217
#define GST_IS_CA_OPENGL_LAYER_SINK(obj) \
Packit 971217
    (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CA_OPENGL_LAYER_SINK))
Packit 971217
#define GST_IS_CA_OPENGL_LAYER_SINK_CLASS(klass) \
Packit 971217
    (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CA_OPENGL_LAYER_SINK))
Packit 971217
Packit 971217
typedef struct _GstCAOpenGLLayerSink GstCAOpenGLLayerSink;
Packit 971217
typedef struct _GstCAOpenGLLayerSinkClass GstCAOpenGLLayerSinkClass;
Packit 971217
Packit 971217
struct _GstCAOpenGLLayerSink
Packit 971217
{
Packit 971217
    GstVideoSink video_sink;
Packit 971217
Packit 971217
    /* caps */
Packit 971217
    GstVideoInfo info;
Packit 971217
    GstCaps *gl_caps;
Packit 971217
Packit 971217
    /* gl state */
Packit 971217
    GstGLDisplay *display;
Packit 971217
    GstGLContext *other_context;
Packit 971217
    GstGLContext *context;
Packit 971217
Packit 971217
    guint      next_tex;
Packit 971217
    GstBuffer *next_buffer;
Packit 971217
    GstBuffer *next_sync;
Packit 971217
Packit 971217
    gpointer layer;
Packit 971217
Packit 971217
    gboolean keep_aspect_ratio;
Packit 971217
Packit 971217
    /* avoid replacing the stored_buffer while drawing */
Packit 971217
    GMutex drawing_lock;
Packit 971217
    GstBuffer *stored_buffer;
Packit 971217
    GstBuffer *stored_sync;
Packit 971217
    GLuint redisplay_texture;
Packit 971217
Packit 971217
    gboolean caps_change;
Packit 971217
    guint window_width;
Packit 971217
    guint window_height;
Packit 971217
Packit 971217
    /* gl state */
Packit 971217
    GstGLShader *redisplay_shader;
Packit 971217
    GLuint vao;
Packit 971217
    GLuint vertex_buffer;
Packit 971217
    GLuint vbo_indices;
Packit 971217
    GLint  attr_position;
Packit 971217
    GLint  attr_texture;
Packit 971217
};
Packit 971217
Packit 971217
struct _GstCAOpenGLLayerSinkClass
Packit 971217
{
Packit 971217
    GstVideoSinkClass video_sink_class;
Packit 971217
};
Packit 971217
Packit 971217
GType gst_ca_opengl_layer_sink_get_type(void);
Packit 971217
GType gst_ca_opengl_layer_sink_bin_get_type (void);
Packit 971217
Packit 971217
G_END_DECLS
Packit 971217
Packit 971217
#endif /* __CA_OPENGL_LAYER_SINK__ */