GstMeta

GstMeta — Buffer metadata

Synopsis

#include <gst/gst.h>

struct              GstMeta;
struct              GstMetaInfo;
#define             GST_META_TRACE_NAME
gboolean            (*GstMetaInitFunction)              (GstMeta *meta,
                                                         gpointer params,
                                                         GstBuffer *buffer);
void                (*GstMetaFreeFunction)              (GstMeta *meta,
                                                         GstBuffer *buffer);
void                (*GstMetaCopyFunction)              (GstBuffer *dest,
                                                         GstMeta *meta,
                                                         GstBuffer *buffer,
                                                         gsize offset,
                                                         gsize size);
void                (*GstMetaTransformFunction)         (GstBuffer *transbuf,
                                                         GstMeta *meta,
                                                         GstBuffer *buffer,
                                                         gpointer data);
const GstMetaInfo * gst_meta_register                   (const gchar *api,
                                                         const gchar *impl,
                                                         gsize size,
                                                         GstMetaInitFunction init_func,
                                                         GstMetaFreeFunction free_func,
                                                         GstMetaCopyFunction copy_func,
                                                         GstMetaTransformFunction transform_func);
const GstMetaInfo * gst_meta_get_info                   (const gchar *impl);

Description

Last reviewed on December 17th, 2009 (0.10.26)

Details

struct GstMeta

struct GstMeta {
  const GstMetaInfo *info;
};

Base structure for metadata. Custom metadata will put this structure as the first member of their structure.

const GstMetaInfo *info;

pointer to the GstMetaInfo

struct GstMetaInfo

struct GstMetaInfo {
  GQuark                     api;
  GType                      type;
  gsize                      size;

  GstMetaInitFunction        init_func;
  GstMetaFreeFunction        free_func;
  GstMetaCopyFunction        copy_func;
  GstMetaTransformFunction   transform_func;
};

The GstMetaInfo provides information about a specific metadata structure.

GQuark api;

tag indentifying the metadata structure and api

GType type;

type indentifying the implementor of the api

gsize size;

size of the metadata

GstMetaInitFunction init_func;

function for initializing the metadata

GstMetaFreeFunction free_func;

function for freeing the metadata

GstMetaCopyFunction copy_func;

function for copying the metadata

GstMetaTransformFunction transform_func;

function for transforming the metadata

GST_META_TRACE_NAME

#define GST_META_TRACE_NAME           "GstMeta"

The name used for tracing memory allocations.


GstMetaInitFunction ()

gboolean            (*GstMetaInitFunction)              (GstMeta *meta,
                                                         gpointer params,
                                                         GstBuffer *buffer);

Function called when meta is initialized in buffer.

meta :

a GstMeta

params :

parameters passed to the init function

buffer :

a GstBuffer

GstMetaFreeFunction ()

void                (*GstMetaFreeFunction)              (GstMeta *meta,
                                                         GstBuffer *buffer);

Function called when meta is freed in buffer.

meta :

a GstMeta

buffer :

a GstBuffer

GstMetaCopyFunction ()

void                (*GstMetaCopyFunction)              (GstBuffer *dest,
                                                         GstMeta *meta,
                                                         GstBuffer *buffer,
                                                         gsize offset,
                                                         gsize size);

GstMetaTransformFunction ()

void                (*GstMetaTransformFunction)         (GstBuffer *transbuf,
                                                         GstMeta *meta,
                                                         GstBuffer *buffer,
                                                         gpointer data);

Function called for each meta in buffer as a result of performing a transformation on transbuf. Additional type specific transform data is passed to the function.

Implementations should check the type of the transform data and parse additional type specific field that should be used to perform the transform.

transbuf :

a GstBuffer

meta :

a GstMeta

buffer :

a GstBuffer

data :

transform specific data.

gst_meta_register ()

const GstMetaInfo * gst_meta_register                   (const gchar *api,
                                                         const gchar *impl,
                                                         gsize size,
                                                         GstMetaInitFunction init_func,
                                                         GstMetaFreeFunction free_func,
                                                         GstMetaCopyFunction copy_func,
                                                         GstMetaTransformFunction transform_func);

gst_meta_get_info ()

const GstMetaInfo * gst_meta_get_info                   (const gchar *impl);

Lookup a previously registered meta info structure by its implementor name impl.

impl :

the name

Returns :

a GstMetaInfo with impl or NULL when no such metainfo exists.