Commit 053252cc authored by Lubosz Sarnecki's avatar Lubosz Sarnecki Committed by Matthew Waters

opengl: add element for transforming video geometry

* add graphene as soft dependency for linear algebra
parent 7a618380
......@@ -284,6 +284,18 @@ if test "x$BUILD_EXAMPLES" = "xyes"; then
fi
AM_CONDITIONAL(HAVE_XCOMPOSITE, test "x$HAVE_XCOMPOSITE" = "xyes")
dnl graphene-1.0 is optional and used in gltransformation
HAVE_GRAPHENE=NO
PKG_CHECK_MODULES(GRAPHENE, graphene-1.0, HAVE_GRAPHENE=yes, HAVE_GRAPHENE=no)
if test "x$HAVE_GRAPHENE" = "xyes"; then
AC_DEFINE(HAVE_GRAPHENE, [1] , [Use graphene])
fi
AC_SUBST(HAVE_GRAPHENE)
AC_SUBST(GRAPHENE_LIBS)
AC_SUBST(GRAPHENE_CFLAGS)
AM_CONDITIONAL(HAVE_GRAPHENE, test "x$HAVE_GRAPHENE" = "xyes")
dnl sdl is optional and used in examples
HAVE_SDL=NO
if test "x$BUILD_EXAMPLES" = "xyes"; then
......
......@@ -1611,6 +1611,19 @@ GST_IS_ZBAR_CLASS
GST_TYPE_ZBAR
</SECTION>
<SECTION>
<FILE>element-gltransformation</FILE>
<TITLE>gltransformation</TITLE>
GstGLTransformation
<SUBSECTION Standard>
GstGLTransformationClass
GST_GL_TRANSFORMATION
GST_GL_TRANSFORMATION_CLASS
GST_IS_GL_TRANSFORMATION
GST_IS_GL_TRANSFORMATION_CLASS
GST_TYPE_GL_TRANSFORMATION
</SECTION>
# gst-libs
<SECTION>
......
......@@ -76,6 +76,12 @@ libgstopengl_la_SOURCES = \
gstglcolorscale.h \
$(OPENGL_SOURCES)
if HAVE_GRAPHENE
libgstopengl_la_SOURCES += \
gstgltransformation.c \
gstgltransformation.h
endif
# check order of CFLAGS and LIBS, shouldn't the order be the other way around
# (like in AM_CFLAGS)?
libgstopengl_la_CFLAGS = \
......@@ -85,7 +91,8 @@ libgstopengl_la_CFLAGS = \
$(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GL_CFLAGS) \
$(LIBPNG_CFLAGS)
$(LIBPNG_CFLAGS) \
$(GRAPHENE_CFLAGS)
libgstopengl_la_LIBADD = \
$(top_builddir)/gst-libs/gst/gl/libgstgl-$(GST_API_VERSION).la \
......@@ -94,8 +101,9 @@ libgstopengl_la_LIBADD = \
-lgstpbutils-$(GST_API_VERSION) \
$(GL_LIBS) \
$(LIBPNG_LIBS) \
$(JPEG_LIBS) \
$(LIBM)
$(JPEG_LIBS) \
$(LIBM) \
$(GRAPHENE_LIBS)
libgstopengl_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstopengl_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
......
This diff is collapsed.
/*
* 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>
#include <graphene-1.0/graphene.h>
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;
guint in_tex;
gfloat xrotation;
gfloat yrotation;
gfloat zrotation;
gfloat xscale;
gfloat yscale;
gfloat xtranslation;
gfloat ytranslation;
gfloat ztranslation;
/* perspective */
gfloat fovy;
gfloat aspect;
gfloat znear;
gfloat zfar;
gboolean ortho;
graphene_matrix_t mvp_matrix;
};
struct _GstGLTransformationClass
{
GstGLFilterClass filter_class;
};
GType gst_gl_transformation_get_type (void);
G_END_DECLS
#endif /* _GST_GL_TRANSFORMATION_H_ */
......@@ -48,6 +48,9 @@
#include "gstglfiltercube.h"
#include "gstgleffects.h"
#include "gstglcolorscale.h"
#if HAVE_GRAPHENE
#include "gstgltransformation.h"
#endif
#if GST_GL_HAVE_OPENGL
#include "gstgltestsrc.h"
......@@ -97,7 +100,12 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) {
return FALSE;
}
#if HAVE_GRAPHENE
if (!gst_element_register (plugin, "gltransformation",
GST_RANK_NONE, GST_TYPE_GL_TRANSFORMATION)) {
return FALSE;
}
#endif
if (!gst_element_register (plugin, "gleffects",
GST_RANK_NONE, gst_gl_effects_get_type ())) {
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment