Blame ext/gl/caopengllayersink.h

Packit Service 4387a0
/*
Packit Service 4387a0
 * GStreamer
Packit Service 4387a0
 * Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
Packit Service 4387a0
 *
Packit Service 4387a0
 * This library is free software; you can redistribute it and/or
Packit Service 4387a0
 * modify it under the terms of the GNU Library General Public
Packit Service 4387a0
 * License as published by the Free Software Foundation; either
Packit Service 4387a0
 * version 2 of the License, or (at your option) any later version.
Packit Service 4387a0
 *
Packit Service 4387a0
 * This library is distributed in the hope that it will be useful,
Packit Service 4387a0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 4387a0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 4387a0
 * Library General Public License for more details.
Packit Service 4387a0
 *
Packit Service 4387a0
 * You should have received a copy of the GNU Library General Public
Packit Service 4387a0
 * License along with this library; if not, write to the
Packit Service 4387a0
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit Service 4387a0
 * Boston, MA 02110-1301, USA.
Packit Service 4387a0
 */
Packit Service 4387a0
Packit Service 4387a0
#ifndef __CA_OPENGL_LAYER_SINK_H__
Packit Service 4387a0
#define __CA_OPENGL_LAYER_SINK_H__
Packit Service 4387a0
Packit Service 4387a0
#include <gst/gst.h>
Packit Service 4387a0
#include <gst/video/gstvideosink.h>
Packit Service 4387a0
#include <gst/video/video.h>
Packit Service 4387a0
Packit Service 4387a0
#include <gst/gl/gl.h>
Packit Service 4387a0
#include <gst/gl/gstglfuncs.h>
Packit Service 4387a0
#include <gst/gl/cocoa/gstglcaopengllayer.h>
Packit Service 4387a0
Packit Service 4387a0
G_BEGIN_DECLS
Packit Service 4387a0
Packit Service 4387a0
#define GST_TYPE_CA_OPENGL_LAYER_SINK \
Packit Service 4387a0
    (gst_ca_opengl_layer_sink_get_type())
Packit Service 4387a0
#define GST_CA_OPENGL_LAYER_SINK(obj) \
Packit Service 4387a0
    (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CA_OPENGL_LAYER_SINK,GstCAOpenGLLayerSink))
Packit Service 4387a0
#define GST_CA_OPENGL_LAYER_SINK_CLASS(klass) \
Packit Service 4387a0
    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CA_OPENGL_LAYER_SINK,GstCAOpenGLLayerSinkClass))
Packit Service 4387a0
#define GST_IS_CA_OPENGL_LAYER_SINK(obj) \
Packit Service 4387a0
    (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CA_OPENGL_LAYER_SINK))
Packit Service 4387a0
#define GST_IS_CA_OPENGL_LAYER_SINK_CLASS(klass) \
Packit Service 4387a0
    (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CA_OPENGL_LAYER_SINK))
Packit Service 4387a0
Packit Service 4387a0
typedef struct _GstCAOpenGLLayerSink GstCAOpenGLLayerSink;
Packit Service 4387a0
typedef struct _GstCAOpenGLLayerSinkClass GstCAOpenGLLayerSinkClass;
Packit Service 4387a0
Packit Service 4387a0
struct _GstCAOpenGLLayerSink
Packit Service 4387a0
{
Packit Service 4387a0
    GstVideoSink video_sink;
Packit Service 4387a0
Packit Service 4387a0
    /* caps */
Packit Service 4387a0
    GstVideoInfo info;
Packit Service 4387a0
    GstCaps *gl_caps;
Packit Service 4387a0
Packit Service 4387a0
    /* gl state */
Packit Service 4387a0
    GstGLDisplay *display;
Packit Service 4387a0
    GstGLContext *other_context;
Packit Service 4387a0
    GstGLContext *context;
Packit Service 4387a0
Packit Service 4387a0
    guint      next_tex;
Packit Service 4387a0
    GstBuffer *next_buffer;
Packit Service 4387a0
    GstBuffer *next_sync;
Packit Service 4387a0
Packit Service 4387a0
    gpointer layer;
Packit Service 4387a0
Packit Service 4387a0
    gboolean keep_aspect_ratio;
Packit Service 4387a0
Packit Service 4387a0
    /* avoid replacing the stored_buffer while drawing */
Packit Service 4387a0
    GMutex drawing_lock;
Packit Service 4387a0
    GstBuffer *stored_buffer;
Packit Service 4387a0
    GstBuffer *stored_sync;
Packit Service 4387a0
    GLuint redisplay_texture;
Packit Service 4387a0
Packit Service 4387a0
    gboolean caps_change;
Packit Service 4387a0
    guint window_width;
Packit Service 4387a0
    guint window_height;
Packit Service 4387a0
Packit Service 4387a0
    /* gl state */
Packit Service 4387a0
    GstGLShader *redisplay_shader;
Packit Service 4387a0
    GLuint vao;
Packit Service 4387a0
    GLuint vertex_buffer;
Packit Service 4387a0
    GLuint vbo_indices;
Packit Service 4387a0
    GLint  attr_position;
Packit Service 4387a0
    GLint  attr_texture;
Packit Service 4387a0
};
Packit Service 4387a0
Packit Service 4387a0
struct _GstCAOpenGLLayerSinkClass
Packit Service 4387a0
{
Packit Service 4387a0
    GstVideoSinkClass video_sink_class;
Packit Service 4387a0
};
Packit Service 4387a0
Packit Service 4387a0
GType gst_ca_opengl_layer_sink_get_type(void);
Packit Service 4387a0
GType gst_ca_opengl_layer_sink_bin_get_type (void);
Packit Service 4387a0
Packit Service 4387a0
G_END_DECLS
Packit Service 4387a0
Packit Service 4387a0
#endif /* __CA_OPENGL_LAYER_SINK__ */