2014-05-27 10:40:09 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 2014 Lubosz Sarnecki <lubosz@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GST_GL_TRANSFORMATION_H_
|
|
|
|
#define _GST_GL_TRANSFORMATION_H_
|
|
|
|
|
|
|
|
#include <gst/gl/gstglfilter.h>
|
2015-02-18 22:10:48 +00:00
|
|
|
#include <graphene.h>
|
2014-05-27 10:40:09 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GST_TYPE_GL_TRANSFORMATION (gst_gl_transformation_get_type())
|
|
|
|
#define GST_GL_TRANSFORMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_TRANSFORMATION,GstGLTransformation))
|
|
|
|
#define GST_IS_GL_TRANSFORMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_TRANSFORMATION))
|
|
|
|
#define GST_GL_TRANSFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_TRANSFORMATION,GstGLTransformationClass))
|
|
|
|
#define GST_IS_GL_TRANSFORMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_TRANSFORMATION))
|
|
|
|
#define GST_GL_TRANSFORMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_TRANSFORMATION,GstGLTransformationClass))
|
|
|
|
|
|
|
|
typedef struct _GstGLTransformation GstGLTransformation;
|
|
|
|
typedef struct _GstGLTransformationClass GstGLTransformationClass;
|
|
|
|
|
|
|
|
struct _GstGLTransformation
|
|
|
|
{
|
|
|
|
GstGLFilter filter;
|
|
|
|
|
|
|
|
GstGLShader *shader;
|
2014-11-13 01:12:46 +00:00
|
|
|
GLuint vao;
|
2015-05-01 02:04:28 +00:00
|
|
|
GLuint vbo_indices;
|
2014-11-13 01:12:46 +00:00
|
|
|
GLuint vertex_buffer;
|
|
|
|
GLint attr_position;
|
|
|
|
GLint attr_texture;
|
2014-05-27 10:40:09 +00:00
|
|
|
|
2016-07-11 14:30:22 +00:00
|
|
|
GstGLMemory *in_tex;
|
|
|
|
GstGLMemory *out_tex;
|
2014-05-27 10:40:09 +00:00
|
|
|
|
|
|
|
gfloat xrotation;
|
|
|
|
gfloat yrotation;
|
|
|
|
gfloat zrotation;
|
|
|
|
|
|
|
|
gfloat xscale;
|
|
|
|
gfloat yscale;
|
|
|
|
|
|
|
|
gfloat xtranslation;
|
|
|
|
gfloat ytranslation;
|
|
|
|
gfloat ztranslation;
|
|
|
|
|
2015-02-28 00:07:44 +00:00
|
|
|
gfloat xpivot;
|
|
|
|
gfloat ypivot;
|
|
|
|
gfloat zpivot;
|
|
|
|
|
2014-05-27 10:40:09 +00:00
|
|
|
/* perspective */
|
2014-07-07 08:52:57 +00:00
|
|
|
gfloat fov;
|
2014-05-27 10:40:09 +00:00
|
|
|
gfloat aspect;
|
|
|
|
gfloat znear;
|
|
|
|
gfloat zfar;
|
|
|
|
gboolean ortho;
|
|
|
|
|
2016-01-14 06:45:03 +00:00
|
|
|
graphene_matrix_t model_matrix;
|
|
|
|
graphene_matrix_t view_matrix;
|
|
|
|
graphene_matrix_t projection_matrix;
|
2016-08-19 05:35:49 +00:00
|
|
|
graphene_matrix_t inv_model_matrix;
|
|
|
|
graphene_matrix_t inv_view_matrix;
|
|
|
|
graphene_matrix_t inv_projection_matrix;
|
2014-05-27 10:40:09 +00:00
|
|
|
graphene_matrix_t mvp_matrix;
|
2014-11-13 01:12:46 +00:00
|
|
|
|
2016-08-19 05:35:49 +00:00
|
|
|
graphene_vec3_t camera_position;
|
|
|
|
|
2016-05-14 13:32:06 +00:00
|
|
|
gboolean downstream_supports_affine_meta;
|
2014-11-13 01:12:46 +00:00
|
|
|
gboolean caps_change;
|
2014-05-27 10:40:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstGLTransformationClass
|
|
|
|
{
|
|
|
|
GstGLFilterClass filter_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_gl_transformation_get_type (void);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* _GST_GL_TRANSFORMATION_H_ */
|