blob: 4e8d158eed04dd622ca2b751e7f36b25c1fc8d9c [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GstMemory: GStreamer 1.0 Core Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GStreamer 1.0 Core Reference Manual">
<link rel="up" href="libgstreamer.html" title="GStreamer Core Library">
<link rel="prev" href="gstreamer-GstIterator.html" title="GstIterator">
<link rel="next" href="GstMessage.html" title="GstMessage">
<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#GstMemory.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
<a href="#GstMemory.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libgstreamer.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gstreamer-GstIterator.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GstMessage.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GstMemory"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GstMemory.top_of_page"></a>GstMemory</span></h2>
<p>GstMemory — refcounted wrapper for memory blocks</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GstMemory.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-FLAGS:CAPS" title="GST_MEMORY_FLAGS()">GST_MEMORY_FLAGS</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-FLAG-IS-SET:CAPS" title="GST_MEMORY_FLAG_IS_SET()">GST_MEMORY_FLAG_IS_SET</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-FLAG-UNSET:CAPS" title="GST_MEMORY_FLAG_UNSET()">GST_MEMORY_FLAG_UNSET</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-IS-READONLY:CAPS" title="GST_MEMORY_IS_READONLY()">GST_MEMORY_IS_READONLY</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-IS-NO-SHARE:CAPS" title="GST_MEMORY_IS_NO_SHARE()">GST_MEMORY_IS_NO_SHARE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-IS-ZERO-PADDED:CAPS" title="GST_MEMORY_IS_ZERO_PADDED()">GST_MEMORY_IS_ZERO_PADDED</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-IS-ZERO-PREFIXED:CAPS" title="GST_MEMORY_IS_ZERO_PREFIXED()">GST_MEMORY_IS_ZERO_PREFIXED</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-IS-PHYSICALLY-CONTIGUOUS:CAPS" title="GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS()">GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#GST-MEMORY-IS-NOT-MAPPABLE:CAPS" title="GST_MEMORY_IS_NOT_MAPPABLE()">GST_MEMORY_IS_NOT_MAPPABLE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstMemory.html#GstMemoryMapFunction" title="GstMemoryMapFunction ()">*GstMemoryMapFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstMemory.html#GstMemoryMapFullFunction" title="GstMemoryMapFullFunction ()">*GstMemoryMapFullFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstMemory.html#GstMemoryUnmapFunction" title="GstMemoryUnmapFunction ()">*GstMemoryUnmapFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstMemory.html#GstMemoryUnmapFullFunction" title="GstMemoryUnmapFullFunction ()">*GstMemoryUnmapFullFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstMemory.html#GstMemoryCopyFunction" title="GstMemoryCopyFunction ()">*GstMemoryCopyFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstMemory.html#GstMemoryShareFunction" title="GstMemoryShareFunction ()">*GstMemoryShareFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstMemory.html#GstMemoryIsSpanFunction" title="GstMemoryIsSpanFunction ()">*GstMemoryIsSpanFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-init" title="gst_memory_init ()">gst_memory_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-is-type" title="gst_memory_is_type ()">gst_memory_is_type</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-ref" title="gst_memory_ref ()">gst_memory_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-unref" title="gst_memory_unref ()">gst_memory_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-get-sizes" title="gst_memory_get_sizes ()">gst_memory_get_sizes</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-resize" title="gst_memory_resize ()">gst_memory_resize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-lock" title="gst_memory_lock()">gst_memory_lock</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-unlock" title="gst_memory_unlock()">gst_memory_unlock</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-is-writable" title="gst_memory_is_writable()">gst_memory_is_writable</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-make-writable" title="gst_memory_make_writable()">gst_memory_make_writable</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-make-mapped" title="gst_memory_make_mapped ()">gst_memory_make_mapped</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()">gst_memory_map</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-unmap" title="gst_memory_unmap ()">gst_memory_unmap</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-copy" title="gst_memory_copy ()">gst_memory_copy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-share" title="gst_memory_share ()">gst_memory_share</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstMemory.html#gst-memory-is-span" title="gst_memory_is_span ()">gst_memory_is_span</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstMemory.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GstMemory.html#GstMemoryFlags" title="enum GstMemoryFlags">GstMemoryFlags</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GstMemory.html#GstMemory-struct" title="struct GstMemory">GstMemory</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GstMemory.html#GstMapFlags" title="enum GstMapFlags">GstMapFlags</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="GstMemory.html#GST-MAP-READWRITE:CAPS" title="GST_MAP_READWRITE">GST_MAP_READWRITE</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo">GstMapInfo</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="GstMemory.html#GST-MAP-INFO-INIT:CAPS" title="GST_MAP_INFO_INIT">GST_MAP_INFO_INIT</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstMemory.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="https://developer.gnome.org/gobject/unstable/gobject-Boxed-Types.html">GBoxed</a>
<span class="lineart">╰──</span> GstMemory
</pre>
</div>
<div class="refsect1">
<a name="GstMemory.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gst/gst.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GstMemory.description"></a><h2>Description</h2>
<p>GstMemory is a lightweight refcounted object that wraps a region of memory.
They are typically used to manage the data of a <a class="link" href="GstBuffer.html" title="GstBuffer"><span class="type">GstBuffer</span></a>.</p>
<p>A GstMemory object has an allocated region of memory of maxsize. The maximum
size does not change during the lifetime of the memory object. The memory
also has an offset and size property that specifies the valid range of memory
in the allocated region.</p>
<p>Memory is usually created by allocators with a <a class="link" href="GstAllocator.html#gst-allocator-alloc" title="gst_allocator_alloc ()"><code class="function">gst_allocator_alloc()</code></a>
method call. When <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is used as the allocator, the default allocator will
be used.</p>
<p>New allocators can be registered with <a class="link" href="GstAllocator.html#gst-allocator-register" title="gst_allocator_register ()"><code class="function">gst_allocator_register()</code></a>.
Allocators are identified by name and can be retrieved with
<a class="link" href="GstAllocator.html#gst-allocator-find" title="gst_allocator_find ()"><code class="function">gst_allocator_find()</code></a>. <a class="link" href="GstAllocator.html#gst-allocator-set-default" title="gst_allocator_set_default ()"><code class="function">gst_allocator_set_default()</code></a> can be used to change the
default allocator.</p>
<p>New memory can be created with <a class="link" href="GstAllocator.html#gst-memory-new-wrapped" title="gst_memory_new_wrapped ()"><code class="function">gst_memory_new_wrapped()</code></a> that wraps the memory
allocated elsewhere.</p>
<p>Refcounting of the memory block is performed with <a class="link" href="GstMemory.html#gst-memory-ref" title="gst_memory_ref ()"><code class="function">gst_memory_ref()</code></a> and
<a class="link" href="GstMemory.html#gst-memory-unref" title="gst_memory_unref ()"><code class="function">gst_memory_unref()</code></a>.</p>
<p>The size of the memory can be retrieved and changed with
<a class="link" href="GstMemory.html#gst-memory-get-sizes" title="gst_memory_get_sizes ()"><code class="function">gst_memory_get_sizes()</code></a> and <a class="link" href="GstMemory.html#gst-memory-resize" title="gst_memory_resize ()"><code class="function">gst_memory_resize()</code></a> respectively.</p>
<p>Getting access to the data of the memory is performed with <a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()"><code class="function">gst_memory_map()</code></a>.
The call will return a pointer to offset bytes into the region of memory.
After the memory access is completed, <a class="link" href="GstMemory.html#gst-memory-unmap" title="gst_memory_unmap ()"><code class="function">gst_memory_unmap()</code></a> should be called.</p>
<p>Memory can be copied with <a class="link" href="GstMemory.html#gst-memory-copy" title="gst_memory_copy ()"><code class="function">gst_memory_copy()</code></a>, which will return a writable
copy. <a class="link" href="GstMemory.html#gst-memory-share" title="gst_memory_share ()"><code class="function">gst_memory_share()</code></a> will create a new memory block that shares the
memory with an existing memory block at a custom offset and with a custom
size.</p>
<p>Memory can be efficiently merged when <a class="link" href="GstMemory.html#gst-memory-is-span" title="gst_memory_is_span ()"><code class="function">gst_memory_is_span()</code></a> returns <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
</div>
<div class="refsect1">
<a name="GstMemory.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="GST-MEMORY-FLAGS:CAPS"></a><h3>GST_MEMORY_FLAGS()</h3>
<pre class="programlisting">#define GST_MEMORY_FLAGS(mem) GST_MINI_OBJECT_FLAGS (mem)
</pre>
<p>A flags word containing <a class="link" href="GstMemory.html#GstMemoryFlags" title="enum GstMemoryFlags"><span class="type">GstMemoryFlags</span></a> flags set on <em class="parameter"><code>mem</code></em>
</p>
<div class="refsect3">
<a name="GST-MEMORY-FLAGS.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MEMORY-FLAG-IS-SET:CAPS"></a><h3>GST_MEMORY_FLAG_IS_SET()</h3>
<pre class="programlisting">#define GST_MEMORY_FLAG_IS_SET(mem,flag) GST_MINI_OBJECT_FLAG_IS_SET (mem,flag)
</pre>
<p>Gives the status of a specific flag on a <em class="parameter"><code>mem</code></em>
.</p>
<div class="refsect3">
<a name="GST-MEMORY-FLAG-IS-SET.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flag</p></td>
<td class="parameter_description"><p>the <a class="link" href="GstMemory.html#GstMemoryFlags" title="enum GstMemoryFlags"><span class="type">GstMemoryFlags</span></a> to check.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MEMORY-FLAG-UNSET:CAPS"></a><h3>GST_MEMORY_FLAG_UNSET()</h3>
<pre class="programlisting">#define GST_MEMORY_FLAG_UNSET(mem,flag) GST_MINI_OBJECT_FLAG_UNSET (mem, flag)
</pre>
<p>Clear a specific flag on a <em class="parameter"><code>mem</code></em>
.</p>
<div class="refsect3">
<a name="GST-MEMORY-FLAG-UNSET.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flag</p></td>
<td class="parameter_description"><p>the <a class="link" href="GstMemory.html#GstMemoryFlags" title="enum GstMemoryFlags"><span class="type">GstMemoryFlags</span></a> to clear.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MEMORY-IS-READONLY:CAPS"></a><h3>GST_MEMORY_IS_READONLY()</h3>
<pre class="programlisting">#define GST_MEMORY_IS_READONLY(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_READONLY)
</pre>
<p>Check if <em class="parameter"><code>mem</code></em>
is readonly.</p>
<div class="refsect3">
<a name="GST-MEMORY-IS-READONLY.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MEMORY-IS-NO-SHARE:CAPS"></a><h3>GST_MEMORY_IS_NO_SHARE()</h3>
<pre class="programlisting">#define GST_MEMORY_IS_NO_SHARE(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_NO_SHARE)
</pre>
<p>Check if <em class="parameter"><code>mem</code></em>
cannot be shared between buffers</p>
<div class="refsect3">
<a name="GST-MEMORY-IS-NO-SHARE.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MEMORY-IS-ZERO-PADDED:CAPS"></a><h3>GST_MEMORY_IS_ZERO_PADDED()</h3>
<pre class="programlisting">#define GST_MEMORY_IS_ZERO_PADDED(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_ZERO_PADDED)
</pre>
<p>Check if the padding in <em class="parameter"><code>mem</code></em>
is 0 filled.</p>
<div class="refsect3">
<a name="GST-MEMORY-IS-ZERO-PADDED.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MEMORY-IS-ZERO-PREFIXED:CAPS"></a><h3>GST_MEMORY_IS_ZERO_PREFIXED()</h3>
<pre class="programlisting">#define GST_MEMORY_IS_ZERO_PREFIXED(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_ZERO_PREFIXED)
</pre>
<p>Check if the prefix in <em class="parameter"><code>mem</code></em>
is 0 filled.</p>
<div class="refsect3">
<a name="GST-MEMORY-IS-ZERO-PREFIXED.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MEMORY-IS-PHYSICALLY-CONTIGUOUS:CAPS"></a><h3>GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS()</h3>
<pre class="programlisting">#define GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS)
</pre>
<p>Check if <em class="parameter"><code>mem</code></em>
is physically contiguous.</p>
<div class="refsect3">
<a name="GST-MEMORY-IS-PHYSICALLY-CONTIGUOUS.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix08.html#api-index-1.2">1.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GST-MEMORY-IS-NOT-MAPPABLE:CAPS"></a><h3>GST_MEMORY_IS_NOT_MAPPABLE()</h3>
<pre class="programlisting">#define GST_MEMORY_IS_NOT_MAPPABLE(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_NOT_MAPPABLE)
</pre>
<p>Check if <em class="parameter"><code>mem</code></em>
can't be mapped via <a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()"><code class="function">gst_memory_map()</code></a> without any preconditions</p>
<div class="refsect3">
<a name="GST-MEMORY-IS-NOT-MAPPABLE.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix08.html#api-index-1.2">1.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GstMemoryMapFunction"></a><h3>GstMemoryMapFunction ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
<span class="c_punctuation">(</span>*GstMemoryMapFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> maxsize</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMapFlags" title="enum GstMapFlags"><span class="type">GstMapFlags</span></a> flags</code></em>);</pre>
<p>Get the memory of <em class="parameter"><code>mem</code></em>
that can be accessed according to the mode specified
in <em class="parameter"><code>flags</code></em>
. The function should return a pointer that contains at least
<em class="parameter"><code>maxsize</code></em>
bytes.</p>
<div class="refsect3">
<a name="GstMemoryMapFunction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>maxsize</p></td>
<td class="parameter_description"><p>size to map</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>access mode for the memory</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GstMemoryMapFunction.returns"></a><h4>Returns</h4>
<p> a pointer to memory of which at least <em class="parameter"><code>maxsize</code></em>
bytes can be
accessed according to the access pattern in <em class="parameter"><code>flags</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstMemoryMapFullFunction"></a><h3>GstMemoryMapFullFunction ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
<span class="c_punctuation">(</span>*GstMemoryMapFullFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a> *info</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> maxsize</code></em>);</pre>
<p>Get the memory of <em class="parameter"><code>mem</code></em>
that can be accessed according to the mode specified
in <em class="parameter"><code>info</code></em>
's flags. The function should return a pointer that contains at least
<em class="parameter"><code>maxsize</code></em>
bytes.</p>
<div class="refsect3">
<a name="GstMemoryMapFullFunction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p>the <a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a> to map with</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>maxsize</p></td>
<td class="parameter_description"><p>size to map</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GstMemoryMapFullFunction.returns"></a><h4>Returns</h4>
<p> a pointer to memory of which at least <em class="parameter"><code>maxsize</code></em>
bytes can be
accessed according to the access pattern in <em class="parameter"><code>info</code></em>
's flags.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstMemoryUnmapFunction"></a><h3>GstMemoryUnmapFunction ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GstMemoryUnmapFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>);</pre>
<p>Return the pointer previously retrieved with <a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()"><code class="function">gst_memory_map()</code></a>.</p>
<div class="refsect3">
<a name="GstMemoryUnmapFunction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstMemoryUnmapFullFunction"></a><h3>GstMemoryUnmapFullFunction ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GstMemoryUnmapFullFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a> *info</code></em>);</pre>
<p>Return the pointer previously retrieved with <a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()"><code class="function">gst_memory_map()</code></a> with <em class="parameter"><code>info</code></em>
.</p>
<div class="refsect3">
<a name="GstMemoryUnmapFullFunction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstMemoryCopyFunction"></a><h3>GstMemoryCopyFunction ()</h3>
<pre class="programlisting"><a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
<span class="c_punctuation">(</span>*GstMemoryCopyFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> offset</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> size</code></em>);</pre>
<p>Copy <em class="parameter"><code>size</code></em>
bytes from <em class="parameter"><code>mem</code></em>
starting at <em class="parameter"><code>offset</code></em>
and return them wrapped in a
new GstMemory object.
If <em class="parameter"><code>size</code></em>
is set to -1, all bytes starting at <em class="parameter"><code>offset</code></em>
are copied.</p>
<div class="refsect3">
<a name="GstMemoryCopyFunction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>an offset</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>a size or -1</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GstMemoryCopyFunction.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> object wrapping a copy of the requested region in
<em class="parameter"><code>mem</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstMemoryShareFunction"></a><h3>GstMemoryShareFunction ()</h3>
<pre class="programlisting"><a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
<span class="c_punctuation">(</span>*GstMemoryShareFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> offset</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> size</code></em>);</pre>
<p>Share <em class="parameter"><code>size</code></em>
bytes from <em class="parameter"><code>mem</code></em>
starting at <em class="parameter"><code>offset</code></em>
and return them wrapped in a
new GstMemory object. If <em class="parameter"><code>size</code></em>
is set to -1, all bytes starting at <em class="parameter"><code>offset</code></em>
are
shared. This function does not make a copy of the bytes in <em class="parameter"><code>mem</code></em>
.</p>
<div class="refsect3">
<a name="GstMemoryShareFunction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>an offset</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>a size or -1</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GstMemoryShareFunction.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> object sharing the requested region in <em class="parameter"><code>mem</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstMemoryIsSpanFunction"></a><h3>GstMemoryIsSpanFunction ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="c_punctuation">(</span>*GstMemoryIsSpanFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem1</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem2</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *offset</code></em>);</pre>
<p>Check if <em class="parameter"><code>mem1</code></em>
and <em class="parameter"><code>mem2</code></em>
occupy contiguous memory and return the offset of
<em class="parameter"><code>mem1</code></em>
in the parent buffer in <em class="parameter"><code>offset</code></em>
.</p>
<div class="refsect3">
<a name="GstMemoryIsSpanFunction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem1</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mem2</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>a result offset</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GstMemoryIsSpanFunction.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>mem1</code></em>
and <em class="parameter"><code>mem2</code></em>
are in contiguous memory.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-init"></a><h3>gst_memory_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_memory_init (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMemoryFlags" title="enum GstMemoryFlags"><span class="type">GstMemoryFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="GstAllocator.html" title="GstAllocator"><span class="type">GstAllocator</span></a> *allocator</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *parent</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> maxsize</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> align</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> offset</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);</pre>
<p>Initializes a newly allocated <em class="parameter"><code>mem</code></em>
with the given parameters. This function
will call <a class="link" href="gstreamer-GstMiniObject.html#gst-mini-object-init" title="gst_mini_object_init ()"><code class="function">gst_mini_object_init()</code></a> with the default memory parameters.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gst-memory-init.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p><a class="link" href="GstMemory.html#GstMemoryFlags" title="enum GstMemoryFlags"><span class="type">GstMemoryFlags</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>allocator</p></td>
<td class="parameter_description"><p>the <a class="link" href="GstAllocator.html" title="GstAllocator"><span class="type">GstAllocator</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>parent</p></td>
<td class="parameter_description"><p>the parent of <em class="parameter"><code>mem</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>maxsize</p></td>
<td class="parameter_description"><p>the total size of the memory</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>align</p></td>
<td class="parameter_description"><p>the alignment of the memory</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>The offset in the memory</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the size of valid data in the memory</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-is-type"></a><h3>gst_memory_is_type ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_memory_is_type (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *mem_type</code></em>);</pre>
<p>Check if <em class="parameter"><code>mem</code></em>
if allocated with an allocator for <em class="parameter"><code>mem_type</code></em>
.</p>
<div class="refsect3">
<a name="gst-memory-is-type.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mem_type</p></td>
<td class="parameter_description"><p>a memory type</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-memory-is-type.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>mem</code></em>
was allocated from an allocator for <em class="parameter"><code>mem_type</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="ix08.html#api-index-1.2">1.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-ref"></a><h3>gst_memory_ref ()</h3>
<pre class="programlisting"><a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
gst_memory_ref (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *memory</code></em>);</pre>
<p>Increase the refcount of this memory.</p>
<div class="refsect3">
<a name="gst-memory-ref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>memory</p></td>
<td class="parameter_description"><p>The memory to refcount</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-memory-ref.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>memory</code></em>
(for convenience when doing assignments). </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-unref"></a><h3>gst_memory_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_memory_unref (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *memory</code></em>);</pre>
<p>Decrease the refcount of an memory, freeing it if the refcount reaches 0.</p>
<div class="refsect3">
<a name="gst-memory-unref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>memory</p></td>
<td class="parameter_description"><p> the memory to refcount. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-get-sizes"></a><h3>gst_memory_get_sizes ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a>
gst_memory_get_sizes (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *offset</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *maxsize</code></em>);</pre>
<p>Get the current <em class="parameter"><code>size</code></em>
, <em class="parameter"><code>offset</code></em>
and <em class="parameter"><code>maxsize</code></em>
of <em class="parameter"><code>mem</code></em>
.</p>
<div class="refsect3">
<a name="gst-memory-get-sizes.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>pointer to offset</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>maxsize</p></td>
<td class="parameter_description"><p>pointer to maxsize</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-memory-get-sizes.returns"></a><h4>Returns</h4>
<p> the current sizes of <em class="parameter"><code>mem</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-resize"></a><h3>gst_memory_resize ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_memory_resize (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> offset</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>);</pre>
<p>Resize the memory region. <em class="parameter"><code>mem</code></em>
should be writable and offset + size should be
less than the maxsize of <em class="parameter"><code>mem</code></em>
.</p>
<p><a class="link" href="GstMemory.html#GST-MEMORY-FLAG-ZERO-PREFIXED:CAPS"><span class="type">GST_MEMORY_FLAG_ZERO_PREFIXED</span></a> and <a class="link" href="GstMemory.html#GST-MEMORY-FLAG-ZERO-PADDED:CAPS"><span class="type">GST_MEMORY_FLAG_ZERO_PADDED</span></a> will be
cleared when offset or padding is increased respectively.</p>
<div class="refsect3">
<a name="gst-memory-resize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>a new offset</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>a new size</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-lock"></a><h3>gst_memory_lock()</h3>
<pre class="programlisting">#define gst_memory_lock(m,f) gst_mini_object_lock (GST_MINI_OBJECT_CAST (m), (f))
</pre>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-unlock"></a><h3>gst_memory_unlock()</h3>
<pre class="programlisting">#define gst_memory_unlock(m,f) gst_mini_object_unlock (GST_MINI_OBJECT_CAST (m), (f))
</pre>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-is-writable"></a><h3>gst_memory_is_writable()</h3>
<pre class="programlisting">#define gst_memory_is_writable(m) gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (m))
</pre>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-make-writable"></a><h3>gst_memory_make_writable()</h3>
<pre class="programlisting">#define gst_memory_make_writable(m) GST_MEMORY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (m)))
</pre>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-make-mapped"></a><h3>gst_memory_make_mapped ()</h3>
<pre class="programlisting"><a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
gst_memory_make_mapped (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a> *info</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMapFlags" title="enum GstMapFlags"><span class="type">GstMapFlags</span></a> flags</code></em>);</pre>
<p>Create a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> object that is mapped with <em class="parameter"><code>flags</code></em>
. If <em class="parameter"><code>mem</code></em>
is mappable
with <em class="parameter"><code>flags</code></em>
, this function returns the mapped <em class="parameter"><code>mem</code></em>
directly. Otherwise a
mapped copy of <em class="parameter"><code>mem</code></em>
is returned.</p>
<p>This function takes ownership of old <em class="parameter"><code>mem</code></em>
and returns a reference to a new
<a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p>
<div class="refsect3">
<a name="gst-memory-make-mapped.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p> a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p> pointer for info. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>mapping flags</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-memory-make-mapped.returns"></a><h4>Returns</h4>
<p> a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> object mapped
with <em class="parameter"><code>flags</code></em>
or <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> when a mapping is not possible. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-map"></a><h3>gst_memory_map ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_memory_map (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a> *info</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMapFlags" title="enum GstMapFlags"><span class="type">GstMapFlags</span></a> flags</code></em>);</pre>
<p>Fill <em class="parameter"><code>info</code></em>
with the pointer and sizes of the memory in <em class="parameter"><code>mem</code></em>
that can be
accessed according to <em class="parameter"><code>flags</code></em>
.</p>
<p>This function can return <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> for various reasons:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>the memory backed by <em class="parameter"><code>mem</code></em>
is not accessible with the given <em class="parameter"><code>flags</code></em>
.</p></li>
<li class="listitem"><p>the memory was already mapped with a different mapping.</p></li>
</ul></div>
<p><em class="parameter"><code>info</code></em>
and its contents remain valid for as long as <em class="parameter"><code>mem</code></em>
is valid and
until <a class="link" href="GstMemory.html#gst-memory-unmap" title="gst_memory_unmap ()"><code class="function">gst_memory_unmap()</code></a> is called.</p>
<p>For each <a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()"><code class="function">gst_memory_map()</code></a> call, a corresponding <a class="link" href="GstMemory.html#gst-memory-unmap" title="gst_memory_unmap ()"><code class="function">gst_memory_unmap()</code></a> call
should be done.</p>
<div class="refsect3">
<a name="gst-memory-map.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p> pointer for info. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>mapping flags</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-memory-map.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the map operation was successful.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-unmap"></a><h3>gst_memory_unmap ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_memory_unmap (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a> *info</code></em>);</pre>
<p>Release the memory obtained with <a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()"><code class="function">gst_memory_map()</code></a></p>
<div class="refsect3">
<a name="gst-memory-unmap.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-copy"></a><h3>gst_memory_copy ()</h3>
<pre class="programlisting"><a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
gst_memory_copy (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> offset</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> size</code></em>);</pre>
<p>Return a copy of <em class="parameter"><code>size</code></em>
bytes from <em class="parameter"><code>mem</code></em>
starting from <em class="parameter"><code>offset</code></em>
. This copy is
guaranteed to be writable. <em class="parameter"><code>size</code></em>
can be set to -1 to return a copy
from <em class="parameter"><code>offset</code></em>
to the end of the memory region.</p>
<div class="refsect3">
<a name="gst-memory-copy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>offset to copy from</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>size to copy, or -1 to copy to the end of the memory region</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-memory-copy.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-share"></a><h3>gst_memory_share ()</h3>
<pre class="programlisting"><a class="link" href="GstMemory.html" title="GstMemory"><span class="returnvalue">GstMemory</span></a> *
gst_memory_share (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> offset</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gssize"><span class="type">gssize</span></a> size</code></em>);</pre>
<p>Return a shared copy of <em class="parameter"><code>size</code></em>
bytes from <em class="parameter"><code>mem</code></em>
starting from <em class="parameter"><code>offset</code></em>
. No
memory copy is performed and the memory region is simply shared. The result
is guaranteed to be non-writable. <em class="parameter"><code>size</code></em>
can be set to -1 to return a shared
copy from <em class="parameter"><code>offset</code></em>
to the end of the memory region.</p>
<div class="refsect3">
<a name="gst-memory-share.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>offset to share from</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>size to share, or -1 to share to the end of the memory region</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-memory-share.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-memory-is-span"></a><h3>gst_memory_is_span ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_memory_is_span (<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem1</code></em>,
<em class="parameter"><code><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *mem2</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *offset</code></em>);</pre>
<p>Check if <em class="parameter"><code>mem1</code></em>
and mem2 share the memory with a common parent memory object
and that the memory is contiguous.</p>
<p>If this is the case, the memory of <em class="parameter"><code>mem1</code></em>
and <em class="parameter"><code>mem2</code></em>
can be merged
efficiently by performing <a class="link" href="GstMemory.html#gst-memory-share" title="gst_memory_share ()"><code class="function">gst_memory_share()</code></a> on the parent object from
the returned <em class="parameter"><code>offset</code></em>
.</p>
<div class="refsect3">
<a name="gst-memory-is-span.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>mem1</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mem2</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>a pointer to a result offset</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-memory-is-span.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the memory is contiguous and of a common parent.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="GstMemory.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GstMemoryFlags"></a><h3>enum GstMemoryFlags</h3>
<p>Flags for wrapped memory.</p>
<div class="refsect3">
<a name="GstMemoryFlags.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GST-MEMORY-FLAG-READONLY:CAPS"></a>GST_MEMORY_FLAG_READONLY</p></td>
<td class="enum_member_description">
<p>memory is readonly. It is not allowed to map the
memory with <a class="link" href="GstMemory.html#GST-MAP-WRITE:CAPS"><span class="type">GST_MAP_WRITE</span></a>.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-MEMORY-FLAG-NO-SHARE:CAPS"></a>GST_MEMORY_FLAG_NO_SHARE</p></td>
<td class="enum_member_description">
<p>memory must not be shared. Copies will have to be
made when this memory needs to be shared between buffers.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-MEMORY-FLAG-ZERO-PREFIXED:CAPS"></a>GST_MEMORY_FLAG_ZERO_PREFIXED</p></td>
<td class="enum_member_description">
<p>the memory prefix is filled with 0 bytes</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-MEMORY-FLAG-ZERO-PADDED:CAPS"></a>GST_MEMORY_FLAG_ZERO_PADDED</p></td>
<td class="enum_member_description">
<p>the memory padding is filled with 0 bytes</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-MEMORY-FLAG-PHYSICALLY-CONTIGUOUS:CAPS"></a>GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS</p></td>
<td class="enum_member_description">
<p>the memory is physically contiguous. (Since 1.2)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-MEMORY-FLAG-NOT-MAPPABLE:CAPS"></a>GST_MEMORY_FLAG_NOT_MAPPABLE</p></td>
<td class="enum_member_description">
<p>the memory can't be mapped via <a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()"><code class="function">gst_memory_map()</code></a> without any preconditions. (Since 1.2)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-MEMORY-FLAG-LAST:CAPS"></a>GST_MEMORY_FLAG_LAST</p></td>
<td class="enum_member_description">
<p>first flag that can be used for custom purposes</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstMemory-struct"></a><h3>struct GstMemory</h3>
<pre class="programlisting">struct GstMemory {
GstMiniObject mini_object;
GstAllocator *allocator;
GstMemory *parent;
gsize maxsize;
gsize align;
gsize offset;
gsize size;
};
</pre>
<p>Base structure for memory implementations. Custom memory will put this structure
as the first member of their structure.</p>
<div class="refsect3">
<a name="GstMemory.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="gstreamer-GstMiniObject.html#GstMiniObject" title="struct GstMiniObject"><span class="type">GstMiniObject</span></a> <em class="structfield"><code><a name="GstMemory-struct.mini-object"></a>mini_object</code></em>;</p></td>
<td class="struct_member_description"><p>parent structure</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="GstAllocator.html" title="GstAllocator"><span class="type">GstAllocator</span></a> *<em class="structfield"><code><a name="GstMemory-struct.allocator"></a>allocator</code></em>;</p></td>
<td class="struct_member_description"><p>pointer to the <a class="link" href="GstAllocator.html" title="GstAllocator"><span class="type">GstAllocator</span></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *<em class="structfield"><code><a name="GstMemory-struct.parent"></a>parent</code></em>;</p></td>
<td class="struct_member_description"><p>parent memory block</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GstMemory-struct.maxsize"></a>maxsize</code></em>;</p></td>
<td class="struct_member_description"><p>the maximum size allocated</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GstMemory-struct.align"></a>align</code></em>;</p></td>
<td class="struct_member_description"><p>the alignment of the memory</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GstMemory-struct.offset"></a>offset</code></em>;</p></td>
<td class="struct_member_description"><p>the offset where valid data starts</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GstMemory-struct.size"></a>size</code></em>;</p></td>
<td class="struct_member_description"><p>the size of valid data</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstMapFlags"></a><h3>enum GstMapFlags</h3>
<p>Flags used when mapping memory</p>
<div class="refsect3">
<a name="GstMapFlags.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GST-MAP-READ:CAPS"></a>GST_MAP_READ</p></td>
<td class="enum_member_description">
<p>map for read access</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-MAP-WRITE:CAPS"></a>GST_MAP_WRITE</p></td>
<td class="enum_member_description">
<p>map for write access</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-MAP-FLAG-LAST:CAPS"></a>GST_MAP_FLAG_LAST</p></td>
<td class="enum_member_description">
<p>first flag that can be used for custom purposes</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MAP-READWRITE:CAPS"></a><h3>GST_MAP_READWRITE</h3>
<pre class="programlisting">#define GST_MAP_READWRITE (GST_MAP_READ | GST_MAP_WRITE)
</pre>
<p>GstMapFlags value alias for GST_MAP_READ | GST_MAP_WRITE</p>
</div>
<hr>
<div class="refsect2">
<a name="GstMapInfo"></a><h3>GstMapInfo</h3>
<pre class="programlisting">typedef struct {
GstMemory *memory;
GstMapFlags flags;
guint8 *data;
gsize size;
gsize maxsize;
} GstMapInfo;
</pre>
<p>A structure containing the result of a map operation such as
<a class="link" href="GstMemory.html#gst-memory-map" title="gst_memory_map ()"><code class="function">gst_memory_map()</code></a>. It contains the data and size.</p>
<div class="refsect3">
<a name="GstMapInfo.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="GstMemory.html" title="GstMemory"><span class="type">GstMemory</span></a> *<em class="structfield"><code><a name="GstMapInfo.memory"></a>memory</code></em>;</p></td>
<td class="struct_member_description"><p>a pointer to the mapped memory</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="GstMemory.html#GstMapFlags" title="enum GstMapFlags"><span class="type">GstMapFlags</span></a> <em class="structfield"><code><a name="GstMapInfo.flags"></a>flags</code></em>;</p></td>
<td class="struct_member_description"><p>flags used when mapping the memory</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *<em class="structfield"><code><a name="GstMapInfo.data"></a>data</code></em>;</p></td>
<td class="struct_member_description"><p> a pointer to the mapped data. </p></td>
<td class="struct_member_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=size]</span></td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GstMapInfo.size"></a>size</code></em>;</p></td>
<td class="struct_member_description"><p>the valid size in <em class="parameter"><code>data</code></em>
</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GstMapInfo.maxsize"></a>maxsize</code></em>;</p></td>
<td class="struct_member_description"><p>the maximum bytes in <em class="parameter"><code>data</code></em>
</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-MAP-INFO-INIT:CAPS"></a><h3>GST_MAP_INFO_INIT</h3>
<pre class="programlisting">#define GST_MAP_INFO_INIT { NULL, (GstMapFlags) 0, NULL, 0, 0, { NULL, NULL, NULL, NULL}, {NULL, NULL, NULL, NULL}}
</pre>
<p>Initializer for <a class="link" href="GstMemory.html#GstMapInfo" title="GstMapInfo"><span class="type">GstMapInfo</span></a></p>
</div>
</div>
<div class="refsect1">
<a name="GstMemory.see-also"></a><h2>See Also</h2>
<p><a class="link" href="GstBuffer.html" title="GstBuffer"><span class="type">GstBuffer</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>