• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2013, Fluendo S.A.
3  *   Author: Andoni Morales <amorales@fluendo.com>
4  *
5  * Copyright (C) 2014,2018 Collabora Ltd.
6  *   Author: Matthieu Bouron <matthieu.bouron@collabora.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation
11  * version 2.1 of the License.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
21  *
22  */
23 
24 #ifndef __GST_AMC_SURFACE_TEXTURE_H__
25 #define __GST_AMC_SURFACE_TEXTURE_H__
26 
27 #include <glib.h>
28 #include <glib-object.h>
29 
30 G_BEGIN_DECLS
31 
32 #define GST_TYPE_AMC_SURFACE_TEXTURE gst_amc_surface_texture_get_type ()
33 G_DECLARE_DERIVABLE_TYPE (GstAmcSurfaceTexture, gst_amc_surface_texture, GST, AMC_SURFACE_TEXTURE, GObject)
34 
35 typedef void (* GstAmcSurfaceTextureOnFrameAvailableCallback) (GstAmcSurfaceTexture * self, gpointer user_data);
36 
37 struct _GstAmcSurfaceTextureClass
38 {
39   GObjectClass parent_class;
40 
41   gboolean (* update_tex_image)        (GstAmcSurfaceTexture *texture,
42                                         GError ** err);
43 
44   gboolean (* detach_from_gl_context)  (GstAmcSurfaceTexture *texture,
45                                         GError ** err);
46 
47   gboolean (* attach_to_gl_context)    (GstAmcSurfaceTexture *texture,
48                                         gint index,
49                                         GError ** err);
50 
51   gboolean (* get_transform_matrix)    (GstAmcSurfaceTexture *texture,
52                                         gfloat *matrix,
53                                         GError ** err);
54 
55   gboolean (* get_timestamp)           (GstAmcSurfaceTexture *texture,
56                                         gint64 * result,
57                                         GError ** err);
58 
59   gboolean (* release)                 (GstAmcSurfaceTexture *texture,
60                                         GError ** err);
61 
62   gboolean (* set_on_frame_available_callback) (GstAmcSurfaceTexture * self,
63                                                 GstAmcSurfaceTextureOnFrameAvailableCallback callback,
64                                                 gpointer user_data,
65                                                 GError ** err);
66 };
67 
68 gboolean gst_amc_surface_texture_static_init (void);
69 
70 gboolean gst_amc_surface_texture_update_tex_image        (GstAmcSurfaceTexture *texture,
71                                                          GError ** err);
72 
73 gboolean gst_amc_surface_texture_detach_from_gl_context  (GstAmcSurfaceTexture *texture,
74                                                          GError ** err);
75 
76 gboolean gst_amc_surface_texture_attach_to_gl_context    (GstAmcSurfaceTexture *texture,
77                                                          gint index,
78                                                          GError ** err);
79 
80 gboolean gst_amc_surface_texture_get_transform_matrix    (GstAmcSurfaceTexture *texture,
81                                                          gfloat *matrix,
82                                                          GError ** err);
83 
84 gboolean gst_amc_surface_texture_get_timestamp           (GstAmcSurfaceTexture *texture,
85                                                          gint64 * result,
86                                                          GError ** err);
87 
88 gboolean gst_amc_surface_texture_release                 (GstAmcSurfaceTexture *texture,
89                                                          GError ** err);
90 
91 gboolean gst_amc_surface_texture_set_on_frame_available_callback (GstAmcSurfaceTexture * self,
92                                                                   GstAmcSurfaceTextureOnFrameAvailableCallback callback,
93                                                                   gpointer user_data,
94                                                                   GError ** err);
95 
96 G_END_DECLS
97 
98 #endif
99