d17c5fad83bcfa199c24d78a3d85c39b5779e494
[platform/upstream/gstreamer.git] / sys / androidmedia / gstamcsurfacetexture.c
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
34 gst_amc_surface_texture_init (GstAmcSurfaceTexture * self)
35 {
36 }
37
38 static void
39 gst_amc_surface_texture_class_init (GstAmcSurfaceTextureClass * klass)
40 {
41 }
42
43 gboolean
44 gst_amc_surface_texture_set_default_buffer_size (GstAmcSurfaceTexture * self,
45     gint width, gint height, GError ** err)
46 {
47   GstAmcSurfaceTextureClass *klass;
48   klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
49   return klass->set_default_buffer_size (self, width, height, err);
50 }
51
52 gboolean
53 gst_amc_surface_texture_update_tex_image (GstAmcSurfaceTexture * self,
54     GError ** err)
55 {
56   GstAmcSurfaceTextureClass *klass;
57   klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
58   return klass->update_tex_image (self, err);
59 }
60
61 gboolean
62 gst_amc_surface_texture_detach_from_gl_context (GstAmcSurfaceTexture * self,
63     GError ** err)
64 {
65   GstAmcSurfaceTextureClass *klass;
66   klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
67   return klass->detach_from_gl_context (self, err);
68 }
69
70 gboolean
71 gst_amc_surface_texture_attach_to_gl_context (GstAmcSurfaceTexture * self,
72     gint texture_id, GError ** err)
73 {
74   GstAmcSurfaceTextureClass *klass;
75   klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
76   return klass->attach_to_gl_context (self, texture_id, err);
77 }
78
79 gboolean
80 gst_amc_surface_texture_get_transform_matrix (GstAmcSurfaceTexture * self,
81     gfloat * matrix, GError ** err)
82 {
83   GstAmcSurfaceTextureClass *klass;
84   klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
85   return klass->get_transform_matrix (self, matrix, err);
86 }
87
88 gboolean
89 gst_amc_surface_texture_get_timestamp (GstAmcSurfaceTexture * self,
90     gint64 * result, GError ** err)
91 {
92   GstAmcSurfaceTextureClass *klass;
93   klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
94   return klass->get_timestamp (self, result, err);
95 }
96
97 gboolean
98 gst_amc_surface_texture_release (GstAmcSurfaceTexture * self, GError ** err)
99 {
100   GstAmcSurfaceTextureClass *klass;
101   klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
102   return klass->release (self, err);
103 }
104
105 gboolean
106 gst_amc_surface_texture_set_on_frame_available_callback (GstAmcSurfaceTexture *
107     self, GstAmcSurfaceTextureOnFrameAvailableCallback callback,
108     gpointer user_data, GError ** err)
109 {
110   GstAmcSurfaceTextureClass *klass;
111   klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
112   return klass->set_on_frame_available_callback (self, callback, user_data,
113       err);
114 }