1 | /* |
2 | * GStreamer |
3 | * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> |
4 | * Copyright (C) 2002,2007 David A. Schleef <ds@schleef.org> |
5 | * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com> |
6 | * Copyright (C) 2019 Philippe Normand <philn@igalia.com> |
7 | * |
8 | * This library is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU Library General Public |
10 | * License as published by the Free Software Foundation; either |
11 | * version 2 of the License, or (at your option) any later version. |
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 | * Library General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU Library General Public |
19 | * License along with this library; if not, write to the |
20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
21 | * Boston, MA 02110-1301, USA. |
22 | */ |
23 | |
24 | #ifndef __GST_GL_BASE_SRC_H__ |
25 | #define __GST_GL_BASE_SRC_H__ |
26 | |
27 | #include <gst/base/gstpushsrc.h> |
28 | #include <gst/gl/gstgl_fwd.h> |
29 | |
30 | G_BEGIN_DECLS |
31 | |
32 | GST_GL_API |
33 | GType gst_gl_base_src_get_type(void); |
34 | |
35 | #define GST_TYPE_GL_BASE_SRC (gst_gl_base_src_get_type()) |
36 | #define GST_GL_BASE_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_BASE_SRC,GstGLBaseSrc)) |
37 | #define GST_GL_BASE_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GL_BASE_SRC,GstGLBaseSrcClass)) |
38 | #define GST_IS_GL_BASE_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_BASE_SRC)) |
39 | #define GST_IS_GL_BASE_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_BASE_SRC)) |
40 | #define GST_GL_BASE_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_BASE_SRC,GstGLBaseSrcClass)) |
41 | |
42 | /** |
43 | * GstGLBaseSrc: |
44 | * @display: the currently configured #GstGLDisplay |
45 | * @context: the currently configured #GstGLContext |
46 | * @out_caps: the currently configured output #GstCaps |
47 | * @out_info: the currently configured output #GstVideoInfo |
48 | * @running_time: the total running time |
49 | * |
50 | * The parent instance type of a base GStreamer GL Video source. |
51 | * |
52 | * Since: 1.18 |
53 | */ |
54 | struct _GstGLBaseSrc { |
55 | GstPushSrc parent; |
56 | |
57 | /*< public >*/ |
58 | GstGLDisplay *display; |
59 | GstGLContext *context; |
60 | |
61 | /* video state */ |
62 | GstVideoInfo out_info; |
63 | GstCaps *out_caps; |
64 | |
65 | /* total running time */ |
66 | GstClockTime running_time; |
67 | |
68 | /*< private >*/ |
69 | gpointer _padding[GST_PADDING]; |
70 | |
71 | GstGLBaseSrcPrivate *priv; |
72 | }; |
73 | |
74 | /** |
75 | * GstGLBaseSrcClass: |
76 | * @supported_gl_api: the logical-OR of #GstGLAPI's supported by this element |
77 | * @gl_start: called in the GL thread to setup the element GL state. |
78 | * @gl_stop: called in the GL thread to setup the element GL state. |
79 | * @fill_gl_memory: called in the GL thread to fill the current video texture. |
80 | * |
81 | * The base class for GStreamer GL Video sources. |
82 | * |
83 | * Since: 1.18 |
84 | */ |
85 | struct _GstGLBaseSrcClass { |
86 | GstPushSrcClass parent_class; |
87 | |
88 | /*< public >*/ |
89 | GstGLAPI supported_gl_api; |
90 | gboolean (*gl_start) (GstGLBaseSrc *src); |
91 | void (*gl_stop) (GstGLBaseSrc *src); |
92 | gboolean (*fill_gl_memory) (GstGLBaseSrc *src, GstGLMemory *mem); |
93 | |
94 | /*< private >*/ |
95 | gpointer _padding[GST_PADDING]; |
96 | }; |
97 | |
98 | G_END_DECLS |
99 | |
100 | #endif /* __GST_GL_BASE_SRC_H__ */ |
101 | |