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 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27
28 #include "gstamcsurfacetexture.h"
29
30 G_DEFINE_ABSTRACT_TYPE (GstAmcSurfaceTexture, gst_amc_surface_texture,
31 G_TYPE_OBJECT);
32
33 static void
gst_amc_surface_texture_init(GstAmcSurfaceTexture * self)34 gst_amc_surface_texture_init (GstAmcSurfaceTexture * self)
35 {
36 }
37
38 static void
gst_amc_surface_texture_class_init(GstAmcSurfaceTextureClass * klass)39 gst_amc_surface_texture_class_init (GstAmcSurfaceTextureClass * klass)
40 {
41 }
42
43 gboolean
gst_amc_surface_texture_update_tex_image(GstAmcSurfaceTexture * self,GError ** err)44 gst_amc_surface_texture_update_tex_image (GstAmcSurfaceTexture * self,
45 GError ** err)
46 {
47 GstAmcSurfaceTextureClass *klass;
48 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
49 return klass->update_tex_image (self, err);
50 }
51
52 gboolean
gst_amc_surface_texture_detach_from_gl_context(GstAmcSurfaceTexture * self,GError ** err)53 gst_amc_surface_texture_detach_from_gl_context (GstAmcSurfaceTexture * self,
54 GError ** err)
55 {
56 GstAmcSurfaceTextureClass *klass;
57 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
58 return klass->detach_from_gl_context (self, err);
59 }
60
61 gboolean
gst_amc_surface_texture_attach_to_gl_context(GstAmcSurfaceTexture * self,gint texture_id,GError ** err)62 gst_amc_surface_texture_attach_to_gl_context (GstAmcSurfaceTexture * self,
63 gint texture_id, GError ** err)
64 {
65 GstAmcSurfaceTextureClass *klass;
66 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
67 return klass->attach_to_gl_context (self, texture_id, err);
68 }
69
70 gboolean
gst_amc_surface_texture_get_transform_matrix(GstAmcSurfaceTexture * self,gfloat * matrix,GError ** err)71 gst_amc_surface_texture_get_transform_matrix (GstAmcSurfaceTexture * self,
72 gfloat * matrix, GError ** err)
73 {
74 GstAmcSurfaceTextureClass *klass;
75 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
76 return klass->get_transform_matrix (self, matrix, err);
77 }
78
79 gboolean
gst_amc_surface_texture_get_timestamp(GstAmcSurfaceTexture * self,gint64 * result,GError ** err)80 gst_amc_surface_texture_get_timestamp (GstAmcSurfaceTexture * self,
81 gint64 * result, GError ** err)
82 {
83 GstAmcSurfaceTextureClass *klass;
84 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
85 return klass->get_timestamp (self, result, err);
86 }
87
88 gboolean
gst_amc_surface_texture_release(GstAmcSurfaceTexture * self,GError ** err)89 gst_amc_surface_texture_release (GstAmcSurfaceTexture * self, GError ** err)
90 {
91 GstAmcSurfaceTextureClass *klass;
92 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
93 return klass->release (self, err);
94 }
95
96 gboolean
gst_amc_surface_texture_set_on_frame_available_callback(GstAmcSurfaceTexture * self,GstAmcSurfaceTextureOnFrameAvailableCallback callback,gpointer user_data,GError ** err)97 gst_amc_surface_texture_set_on_frame_available_callback (GstAmcSurfaceTexture *
98 self, GstAmcSurfaceTextureOnFrameAvailableCallback callback,
99 gpointer user_data, GError ** err)
100 {
101 GstAmcSurfaceTextureClass *klass;
102 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
103 return klass->set_on_frame_available_callback (self, callback, user_data,
104 err);
105 }
106