Blame gst-libs/gst/gl/gstglsyncmeta.h

Packit 971217
/*
Packit 971217
 * GStreamer
Packit 971217
 * Copyright (C) 2014 Matthew Waters <matthew@centricular.com>
Packit 971217
 *
Packit 971217
 * This library is free software; you can redistribute it and/or
Packit 971217
 * modify it under the terms of the GNU Library General Public
Packit 971217
 * License as published by the Free Software Foundation; either
Packit 971217
 * version 2 of the License, or (at your option) any later version.
Packit 971217
 *
Packit 971217
 * This library is distributed in the hope that it will be useful,
Packit 971217
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 971217
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 971217
 * Library General Public License for more details.
Packit 971217
 *
Packit 971217
 * You should have received a copy of the GNU Library General Public
Packit 971217
 * License along with this library; if not, write to the
Packit 971217
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 971217
 * Boston, MA 02110-1301, USA.
Packit 971217
 */
Packit 971217
Packit 971217
#ifndef __GST_GL_SYNC_META_H__
Packit 971217
#define __GST_GL_SYNC_META_H__
Packit 971217
Packit 971217
#include <gst/gl/gstgl_fwd.h>
Packit 971217
Packit 971217
G_BEGIN_DECLS
Packit 971217
Packit 971217
#define GST_GL_SYNC_META_API_TYPE (gst_gl_sync_meta_api_get_type())
Packit 971217
#define GST_GL_SYNC_META_INFO     (gst_gl_sync_meta_get_info())
Packit 971217
typedef struct _GstGLSyncMeta GstGLSyncMeta;
Packit 971217
Packit 971217
/**
Packit 971217
 * GST_BUFFER_POOL_OPTION_GL_SYNC_META:
Packit 971217
 *
Packit 971217
 * An option that can be activated on bufferpools to request OpenGL
Packit 971217
 * synchronization metadata on buffers from the pool.
Packit 971217
 */
Packit 971217
#define GST_BUFFER_POOL_OPTION_GL_SYNC_META "GstBufferPoolOptionGLSyncMeta"
Packit 971217
Packit 971217
/**
Packit 971217
 * GstGLSyncMeta:
Packit 971217
 * @parent: the parent #GstMeta
Packit 971217
 * @context: the #GstGLContext used to allocate the meta
Packit 971217
 * @data: a custom data pointer for the implementation
Packit 971217
 * @set_sync: set a sync point in the OpenGL command stream
Packit 971217
 * @set_sync_gl: the same as @set_sync but called from @context's thread
Packit 971217
 * @wait: execute a wait on the previously set sync point into the OpenGL command stream
Packit 971217
 * @wait_gl: the same as @wait but called from @context's thread
Packit 971217
 * @wait_cpu: wait for the previously set sync point to pass from the CPU
Packit 971217
 * @wait_cpu_gl: the same as @wait_cpu but called from @context's thread
Packit 971217
 * @copy: copy @data into a new #GstGLSyncMeta
Packit 971217
 * @free: free @data
Packit 971217
 * @free_gl: free @data in @context's thread
Packit 971217
 */
Packit 971217
struct _GstGLSyncMeta
Packit 971217
{
Packit 971217
  GstMeta parent;
Packit 971217
Packit 971217
  GstGLContext *context;
Packit 971217
Packit 971217
  gpointer      data;
Packit 971217
Packit 971217
  void (*set_sync) (GstGLSyncMeta * sync, GstGLContext * context);
Packit 971217
  void (*set_sync_gl) (GstGLSyncMeta * sync, GstGLContext * context);
Packit 971217
  void (*wait) (GstGLSyncMeta * sync, GstGLContext * context);
Packit 971217
  void (*wait_gl) (GstGLSyncMeta * sync, GstGLContext * context);
Packit 971217
  void (*wait_cpu) (GstGLSyncMeta * sync, GstGLContext * context);
Packit 971217
  void (*wait_cpu_gl) (GstGLSyncMeta * sync, GstGLContext * context);
Packit 971217
  void (*copy) (GstGLSyncMeta * src, GstBuffer * sbuffer, GstGLSyncMeta * dest, GstBuffer * dbuffer);
Packit 971217
  void (*free) (GstGLSyncMeta * sync, GstGLContext * context);
Packit 971217
  void (*free_gl) (GstGLSyncMeta * sync, GstGLContext * context);
Packit 971217
};
Packit 971217
Packit 971217
GST_GL_API
Packit 971217
GType gst_gl_sync_meta_api_get_type (void);
Packit 971217
GST_GL_API
Packit 971217
const GstMetaInfo * gst_gl_sync_meta_get_info (void);
Packit 971217
Packit 971217
#define gst_buffer_get_gl_sync_meta(b) ((GstGLSyncMeta*)gst_buffer_get_meta((b),GST_GL_SYNC_META_API_TYPE))
Packit 971217
Packit 971217
GST_GL_API
Packit 971217
GstGLSyncMeta *     gst_buffer_add_gl_sync_meta         (GstGLContext * context, GstBuffer *buffer);
Packit 971217
GST_GL_API
Packit 971217
GstGLSyncMeta *     gst_buffer_add_gl_sync_meta_full    (GstGLContext * context, GstBuffer * buffer,
Packit 971217
                                                         gpointer data);
Packit 971217
GST_GL_API
Packit 971217
void                gst_gl_sync_meta_set_sync_point     (GstGLSyncMeta * sync_meta, GstGLContext * context);
Packit 971217
GST_GL_API
Packit 971217
void                gst_gl_sync_meta_wait               (GstGLSyncMeta * sync_meta, GstGLContext * context);
Packit 971217
GST_GL_API
Packit 971217
void                gst_gl_sync_meta_wait_cpu           (GstGLSyncMeta * sync_meta, GstGLContext * context);
Packit 971217
Packit 971217
G_END_DECLS
Packit 971217
Packit 971217
#endif /* __GST_GL_SYNC_META_H__ */