GstMemory: GStreamer 1.0 Core Reference Manual

## GstMemory GstMemory |

## Functions

#define | GST_MEMORY_FLAGS()
#define | GST_MEMORY_FLAG_IS_SET()
#define | GST_MEMORY_FLAG_UNSET()
#define | GST_MEMORY_IS_READONLY()
#define | GST_MEMORY_IS_NO_SHARE()
#define | GST_MEMORY_IS_ZERO_PADDED()
#define | GST_MEMORY_IS_ZERO_PREFIXED()
#define | GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS()
#define | GST_MEMORY_IS_NOT_MAPPABLE()
gpointer | (*GstMemoryMapFunction) ()
gpointer | (*GstMemoryMapFullFunction) ()
void | (*GstMemoryUnmapFunction) ()
void | (*GstMemoryUnmapFullFunction) ()
GstMemory * | (*GstMemoryCopyFunction) ()
GstMemory * | (*GstMemoryShareFunction) ()
gboolean | (*GstMemoryIsSpanFunction) ()
void | gst_memory_init ()
gboolean | gst_memory_is_type ()
GstMemory * | gst_memory_ref ()
void | gst_memory_unref ()
gsize | gst_memory_get_sizes ()
void | gst_memory_resize ()
#define | gst_memory_lock()
#define | gst_memory_unlock()
#define | gst_memory_is_writable()
#define | gst_memory_make_writable()
GstMemory * | gst_memory_make_mapped ()
gboolean | gst_memory_map ()
void | gst_memory_unmap ()
GstMemory * | gst_memory_copy ()
GstMemory * | gst_memory_share ()
gboolean | gst_memory_is_span ()

## Types and Values

enum | GstMemoryFlags
struct | GstMemory
enum | GstMapFlags
#define | GST_MAP_READWRITE
| GstMapInfo
#define | GST_MAP_INFO_INIT

## Object Hierarchy

        GBoxed
        ╰── GstMemory

## Includes

    #include <gst/gst.h>

## Description

## Functions

### GST_MEMORY_FLAGS()

    #define GST_MEMORY_FLAGS(mem)  GST_MINI_OBJECT_FLAGS (mem)

### GST_MEMORY_FLAG_IS_SET()

    #define GST_MEMORY_FLAG_IS_SET(mem,flag)   GST_MINI_OBJECT_FLAG_IS_SET (mem,flag)

### GST_MEMORY_FLAG_UNSET()

    #define GST_MEMORY_FLAG_UNSET(mem,flag)   GST_MINI_OBJECT_FLAG_UNSET (mem, flag)

### GST_MEMORY_IS_READONLY()

    #define GST_MEMORY_IS_READONLY(mem)        GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_READONLY)

### GST_MEMORY_IS_NO_SHARE()

    #define GST_MEMORY_IS_NO_SHARE(mem)        GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_NO_SHARE)

### GST_MEMORY_IS_ZERO_PADDED()

    #define GST_MEMORY_IS_ZERO_PADDED(mem)     GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_ZERO_PADDED)

### GST_MEMORY_IS_ZERO_PREFIXED()

    #define GST_MEMORY_IS_ZERO_PREFIXED(mem)   GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_ZERO_PREFIXED)

### GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS()

    #define GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS(mem)     GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS)

### GST_MEMORY_IS_NOT_MAPPABLE()

    #define GST_MEMORY_IS_NOT_MAPPABLE(mem)     GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_NOT_MAPPABLE)

### GstMemoryMapFunction ()

    gpointer
    (*GstMemoryMapFunction) (GstMemory *mem,
                             gsize maxsize,
                             GstMapFlags flags);

### GstMemoryMapFullFunction ()

    gpointer
    (*GstMemoryMapFullFunction) (GstMemory *mem,
                                 GstMapInfo *info,
                                 gsize maxsize);

### GstMemoryUnmapFunction ()

    void
    (*GstMemoryUnmapFunction) (GstMemory *mem);

### GstMemoryUnmapFullFunction ()

    void
    (*GstMemoryUnmapFullFunction) (GstMemory *mem,
                                   GstMapInfo *info);

### GstMemoryCopyFunction ()

    GstMemory *
    (*GstMemoryCopyFunction) (GstMemory *mem,
                              gssize offset,
                              gssize size);

### GstMemoryShareFunction ()

    GstMemory *
    (*GstMemoryShareFunction) (GstMemory *mem,
                               gssize offset,
                               gssize size);

### GstMemoryIsSpanFunction ()

    gboolean
    (*GstMemoryIsSpanFunction) (GstMemory *mem1,
                                GstMemory *mem2,
                                gsize *offset);

### gst_memory_init ()

    void
    gst_memory_init (GstMemory *mem,
                     GstMemoryFlags flags,
                     GstAllocator *allocator,
                     GstMemory *parent,
                     gsize maxsize,
                     gsize align,
                     gsize offset,
                     gsize size);

### gst_memory_is_type ()

    gboolean
    gst_memory_is_type (GstMemory *mem,
                        const gchar *mem_type);

### gst_memory_ref ()

    GstMemory *
    gst_memory_ref (GstMemory *memory);

### gst_memory_unref ()

    void
    gst_memory_unref (GstMemory *memory);

### gst_memory_get_sizes ()

    gsize
    gst_memory_get_sizes (GstMemory *mem,
                          gsize *offset,
                          gsize *maxsize);

### gst_memory_resize ()

    void
    gst_memory_resize (GstMemory *mem,
                       gssize offset,
                       gsize size);

### gst_memory_lock()

    #define        gst_memory_lock(m,f)        gst_mini_object_lock (GST_MINI_OBJECT_CAST (m), (f))

### gst_memory_unlock()

    #define        gst_memory_unlock(m,f)      gst_mini_object_unlock (GST_MINI_OBJECT_CAST (m), (f))

### gst_memory_is_writable()

    #define        gst_memory_is_writable(m)   gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (m))

### gst_memory_make_writable()

    #define        gst_memory_make_writable(m) GST_MEMORY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (m)))

### gst_memory_make_mapped ()

    GstMemory *
    gst_memory_make_mapped (GstMemory *mem,
                            GstMapInfo *info,
                            GstMapFlags flags);

### gst_memory_map ()

    gboolean
    gst_memory_map (GstMemory *mem,
                    GstMapInfo *info,
                    GstMapFlags flags);

### gst_memory_unmap ()

    void
    gst_memory_unmap (GstMemory *mem,
                      GstMapInfo *info);

### gst_memory_copy ()

    GstMemory *
    gst_memory_copy (GstMemory *mem,
                     gssize offset,
                     gssize size);

### gst_memory_share ()

    GstMemory *
    gst_memory_share (GstMemory *mem,
                      gssize offset,
                      gssize size);

### gst_memory_is_span ()

    gboolean
    gst_memory_is_span (GstMemory *mem1,
                        GstMemory *mem2,
                        gsize *offset);

## Types and Values

### enum GstMemoryFlags

#### Members

GST_MEMORY_FLAG_READONLY |  |
GST_MEMORY_FLAG_NO_SHARE |  |
GST_MEMORY_FLAG_ZERO_PREFIXED |  |
GST_MEMORY_FLAG_ZERO_PADDED |  |
GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS |  |
GST_MEMORY_FLAG_NOT_MAPPABLE |  |
GST_MEMORY_FLAG_LAST |  |

### struct GstMemory

    struct GstMemory {
      GstMiniObject   mini_object;

      GstAllocator   *allocator;

      GstMemory      *parent;
      gsize           maxsize;
      gsize           align;
      gsize           offset;
      gsize           size;
    };

### enum GstMapFlags

#### Members

GST_MAP_READ |  |
GST_MAP_WRITE |  |
GST_MAP_FLAG_LAST |  |

### GST_MAP_READWRITE

    #define GST_MAP_READWRITE      (GST_MAP_READ | GST_MAP_WRITE)

### GstMapInfo

    typedef struct {
      GstMemory *memory;
      GstMapFlags flags;
      guint8 *data;
      gsize size;
      gsize maxsize;
    } GstMapInfo;

### GST_MAP_INFO_INIT

    #define GST_MAP_INFO_INIT { NULL, (GstMapFlags) 0, NULL, 0, 0, { NULL, NULL, NULL, NULL}, {NULL, NULL, NULL, NULL}}