## GstGLSyncMeta

GstGLSyncMeta — synchronization primitives

## Functions

const GstMetaInfo * | gst_gl_sync_meta_get_info ()
GstGLSyncMeta * | gst_buffer_add_gl_sync_meta ()
GstGLSyncMeta * | gst_buffer_add_gl_sync_meta_full ()
#define | gst_buffer_get_gl_sync_meta()
void | gst_gl_sync_meta_set_sync_point ()
void | gst_gl_sync_meta_wait ()
void | gst_gl_sync_meta_wait_cpu ()

## Types and Values

struct | GstGLSyncMeta
#define | GST_BUFFER_POOL_OPTION_GL_SYNC_META

## Includes

    #include <gst/codecparsers/gstmpeg4parser.h>

## Description

GstGLSyncMeta provides the ability to synchronize the OpenGL command stream with the CPU or with other OpenGL contexts.

## Functions

### gst_gl_sync_meta_get_info ()

    const GstMetaInfo *
    gst_gl_sync_meta_get_info (void);

### gst_buffer_add_gl_sync_meta ()

    GstGLSyncMeta *
    gst_buffer_add_gl_sync_meta (GstGLContext *context,
                                 GstBuffer *buffer);

#### Parameters

context | a GstGLContext |
buffer | a GstBuffer |

#### Returns

the GstGLSyncMeta added to GstBuffer.

[transfer none]

Since: 1.6

### gst_buffer_add_gl_sync_meta_full ()

    GstGLSyncMeta *
    gst_buffer_add_gl_sync_meta_full (GstGLContext *context,
                                      GstBuffer *buffer,
                                      gpointer data);

#### Parameters

context | a GstGLContext |
buffer | a GstBuffer |
data | sync data to hold |

#### Returns

the GstGLSyncMeta added to GstBuffer.

[transfer none]

Since: 1.8

### gst_buffer_get_gl_sync_meta()

    #define gst_buffer_get_gl_sync_meta(b) ((GstGLSyncMeta*)gst_buffer_get_meta((b),GST_GL_SYNC_META_API_TYPE))

### gst_gl_sync_meta_set_sync_point ()

    void
    gst_gl_sync_meta_set_sync_point (GstGLSyncMeta *sync_meta,
                                     GstGLContext *context);

Set a sync point to possibly wait on at a later time.

#### Parameters

sync_meta | a GstGLSyncMeta |
context | a GstGLContext |

Since: 1.6

### gst_gl_sync_meta_wait ()

    void
    gst_gl_sync_meta_wait (GstGLSyncMeta *sync_meta,
                           GstGLContext *context);

Insert a wait into `context` 's command stream ensuring all previous OpenGL commands before `sync_meta` have completed.

#### Parameters

sync_meta | a GstGLSyncMeta |
context | a GstGLContext |

Since: 1.6

### gst_gl_sync_meta_wait_cpu ()

    void
    gst_gl_sync_meta_wait_cpu (GstGLSyncMeta *sync_meta,
                               GstGLContext *context);

Perform a wait so that the sync point has passed from the CPU's perspective What that means, is that all GL operations changing CPU-visible data before the sync point are now visible.

#### Parameters

sync_meta | a GstGLSyncMeta |
context | a GstGLContext |

Since: 1.8

## Types and Values

### struct GstGLSyncMeta

    struct GstGLSyncMeta {
      GstMeta parent;

      GstGLContext *context;

      gpointer      data;

      void (*set_sync) (GstGLSyncMeta * sync, GstGLContext * context);
      void (*set_sync_gl) (GstGLSyncMeta * sync, GstGLContext * context);
      void (*wait) (GstGLSyncMeta * sync, GstGLContext * context);
      void (*wait_gl) (GstGLSyncMeta * sync, GstGLContext * context);
      void (*wait_cpu) (GstGLSyncMeta * sync, GstGLContext * context);
      void (*wait_cpu_gl) (GstGLSyncMeta * sync, GstGLContext * context);
      void (*copy) (GstGLSyncMeta * src, GstBuffer * sbuffer, GstGLSyncMeta * dest, GstBuffer * dbuffer);
      void (*free) (GstGLSyncMeta * sync, GstGLContext * context);
      void (*free_gl) (GstGLSyncMeta * sync, GstGLContext * context);
    };

#### Members

GstMeta `parent`; | the parent GstMeta |
GstGLContext *`context`; | the GstGLContext used to allocate the meta |
gpointer `data`; | a custom data pointer for the implementation |
`set_sync` () | set a sync point in the OpenGL command stream |
`set_sync_gl` () | the same as `set_sync` but called from `context` 's thread |
`wait` () | execute a wait on the previously set sync point into the OpenGL command stream |
`wait_gl` () | the same as `wait` but called from `context` 's thread |
`wait_cpu` () | wait for the previously set sync point to pass from the CPU |
`wait_cpu_gl` () | the same as `wait_cpu` but called from `context` 's thread |
`copy` () | copy `data` into a new GstGLSyncMeta |
`free` () | free `data` |
`free_gl` () | free `data` in `context` 's thread |

### GST_BUFFER_POOL_OPTION_GL_SYNC_META

    #define GST_BUFFER_POOL_OPTION_GL_SYNC_META "GstBufferPoolOptionGLSyncMeta"

An option that can be activated on bufferpools to request OpenGL synchronization metadata on buffers from the pool.

## See Also

GstGLBaseMemory, GstGLContext