2 * Copyright (C) 2013, Fluendo S.A.
3 * Author: Andoni Morales <amorales@fluendo.com>
5 * Copyright (C) 2014,2018 Collabora Ltd.
6 * Author: Matthieu Bouron <matthieu.bouron@collabora.com>
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.
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.
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
28 #include "gstamcsurfacetexture.h"
30 G_DEFINE_ABSTRACT_TYPE (GstAmcSurfaceTexture, gst_amc_surface_texture,
34 gst_amc_surface_texture_init (GstAmcSurfaceTexture * self)
39 gst_amc_surface_texture_class_init (GstAmcSurfaceTextureClass * klass)
44 gst_amc_surface_texture_set_default_buffer_size (GstAmcSurfaceTexture * self,
45 gint width, gint height, GError ** err)
47 GstAmcSurfaceTextureClass *klass;
48 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
49 return klass->set_default_buffer_size (self, width, height, err);
53 gst_amc_surface_texture_update_tex_image (GstAmcSurfaceTexture * self,
56 GstAmcSurfaceTextureClass *klass;
57 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
58 return klass->update_tex_image (self, err);
62 gst_amc_surface_texture_detach_from_gl_context (GstAmcSurfaceTexture * self,
65 GstAmcSurfaceTextureClass *klass;
66 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
67 return klass->detach_from_gl_context (self, err);
71 gst_amc_surface_texture_attach_to_gl_context (GstAmcSurfaceTexture * self,
72 gint texture_id, GError ** err)
74 GstAmcSurfaceTextureClass *klass;
75 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
76 return klass->attach_to_gl_context (self, texture_id, err);
80 gst_amc_surface_texture_get_transform_matrix (GstAmcSurfaceTexture * self,
81 gfloat * matrix, GError ** err)
83 GstAmcSurfaceTextureClass *klass;
84 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
85 return klass->get_transform_matrix (self, matrix, err);
89 gst_amc_surface_texture_get_timestamp (GstAmcSurfaceTexture * self,
90 gint64 * result, GError ** err)
92 GstAmcSurfaceTextureClass *klass;
93 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
94 return klass->get_timestamp (self, result, err);
98 gst_amc_surface_texture_release (GstAmcSurfaceTexture * self, GError ** err)
100 GstAmcSurfaceTextureClass *klass;
101 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
102 return klass->release (self, err);
106 gst_amc_surface_texture_set_on_frame_available_callback (GstAmcSurfaceTexture *
107 self, GstAmcSurfaceTextureOnFrameAvailableCallback callback,
108 gpointer user_data, GError ** err)
110 GstAmcSurfaceTextureClass *klass;
111 klass = GST_AMC_SURFACE_TEXTURE_GET_CLASS (self);
112 return klass->set_on_frame_available_callback (self, callback, user_data,