1ad1ae13bb3cedbb408b94aa74276ba89064cd03
[platform/upstream/gstreamer.git] / gst-libs / gst / gl / gstglsyncmeta.h
1 /*
2  * GStreamer
3  * Copyright (C) 2014 Matthew Waters <matthew@centricular.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 #ifndef __GST_GL_SYNC_META_H__
22 #define __GST_GL_SYNC_META_H__
23
24 #include <gst/gl/gstgl_fwd.h>
25
26 G_BEGIN_DECLS
27
28 #define GST_GL_SYNC_META_API_TYPE (gst_gl_sync_meta_api_get_type())
29 #define GST_GL_SYNC_META_INFO     (gst_gl_sync_meta_get_info())
30 typedef struct _GstGLSyncMeta GstGLSyncMeta;
31
32 #define GST_BUFFER_POOL_OPTION_GL_SYNC_META "GstBufferPoolOptionGLSyncMeta"
33
34 struct _GstGLSyncMeta {
35   /*< private >*/
36   GstMeta parent;
37
38   GstGLContext *context;
39
40   GLsync        glsync;
41 };
42
43 GType gst_gl_sync_meta_api_get_type (void);
44 const GstMetaInfo * gst_gl_sync_meta_get_info (void);
45
46 #define gst_buffer_get_gl_sync_meta(b) ((GstGLSyncMeta*)gst_buffer_get_meta((b),GST_GL_SYNC_META_API_TYPE))
47
48 GstGLSyncMeta *     gst_buffer_add_gl_sync_meta         (GstGLContext * context, GstBuffer *buffer);
49 void                gst_gl_sync_meta_set_sync_point     (GstGLSyncMeta * sync, GstGLContext * context);
50 void                gst_gl_sync_meta_wait               (GstGLSyncMeta * sync);
51
52 G_END_DECLS
53
54 #endif /* __GST_GL_SYNC_META_H__ */