• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * GStreamer
3  * Copyright (C) 2013 Matthew Waters <ystreet00@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __GST_GL_UTILS_H__
22 #define __GST_GL_UTILS_H__
23 
24 #include <gst/video/video.h>
25 #include <gst/video/gstvideoaffinetransformationmeta.h>
26 
27 #include <gst/gl/gstgl_fwd.h>
28 
29 G_BEGIN_DECLS
30 
31 GST_GL_API
32 gboolean gst_gl_ensure_element_data (gpointer element,
33     GstGLDisplay **display_ptr, GstGLContext ** other_context_ptr);
34 GST_GL_API
35 gboolean gst_gl_handle_set_context (GstElement * element, GstContext * context,
36     GstGLDisplay ** display, GstGLContext ** other_context);
37 GST_GL_API
38 gboolean gst_gl_handle_context_query (GstElement * element, GstQuery * query,
39     GstGLDisplay * display, GstGLContext * context, GstGLContext * other_context);
40 GST_GL_API
41 gboolean gst_gl_query_local_gl_context (GstElement * element, GstPadDirection direction,
42     GstGLContext ** context_ptr);
43 
44 GST_GL_API
45 void gst_gl_element_propagate_display_context (GstElement * element, GstGLDisplay * display);
46 
47 GST_GL_API
48 gsize gst_gl_get_plane_data_size (const GstVideoInfo * info, const GstVideoAlignment * align,
49     guint plane);
50 GST_GL_API
51 gsize gst_gl_get_plane_start (const GstVideoInfo * info, const GstVideoAlignment * valign,
52     guint plane);
53 
54 GST_GL_API
55 gboolean gst_gl_value_set_texture_target_from_mask (GValue * value,
56     GstGLTextureTarget target_mask);
57 GST_GL_API
58 gboolean gst_gl_value_set_texture_target (GValue * value, GstGLTextureTarget target);
59 GST_GL_API
60 GstGLTextureTarget gst_gl_value_get_texture_target_mask (const GValue * value);
61 
62 GST_GL_API
63 void gst_gl_get_affine_transformation_meta_as_ndc (GstVideoAffineTransformationMeta * meta, gfloat * matrix);
64 GST_GL_API
65 void gst_gl_set_affine_transformation_meta_from_ndc (GstVideoAffineTransformationMeta * meta, const gfloat * matrix);
66 
67 GST_GL_API
68 void gst_gl_multiply_matrix4 (const gfloat * a, const gfloat * b, gfloat * result);
69 
70 
71 G_END_DECLS
72 
73 #endif /* __GST_GL_UTILS_H__ */
74