Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GstSample: 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="GstCapsFeatures.html" title="GstCapsFeatures">
<link rel="next" href="GstChildProxy.html" title="GstChildProxy">
<meta name="generator" content="GTK-Doc V1.28 (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="#GstSample.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GstSample.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="GstCapsFeatures.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GstChildProxy.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GstSample"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GstSample.top_of_page"></a>GstSample</span></h2>
<p>GstSample — A media sample</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GstSample.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="function_type">
<a class="link" href="GstBuffer.html" title="GstBuffer"><span class="returnvalue">GstBuffer</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-get-buffer" title="gst_sample_get_buffer ()">gst_sample_get_buffer</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstBufferList.html" title="GstBufferList"><span class="returnvalue">GstBufferList</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-get-buffer-list" title="gst_sample_get_buffer_list ()">gst_sample_get_buffer_list</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstCaps.html" title="GstCaps"><span class="returnvalue">GstCaps</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-get-caps" title="gst_sample_get_caps ()">gst_sample_get_caps</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a class="link" href="GstStructure.html" title="GstStructure"><span class="returnvalue">GstStructure</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-get-info" title="gst_sample_get_info ()">gst_sample_get_info</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstSegment.html" title="GstSegment"><span class="returnvalue">GstSegment</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-get-segment" title="gst_sample_get_segment ()">gst_sample_get_segment</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="GstSample.html#gst-sample-set-buffer" title="gst_sample_set_buffer ()">gst_sample_set_buffer</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="GstSample.html#gst-sample-set-buffer-list" title="gst_sample_set_buffer_list ()">gst_sample_set_buffer_list</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="GstSample.html#gst-sample-set-caps" title="gst_sample_set_caps ()">gst_sample_set_caps</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="GstSample.html#gst-sample-set-segment" title="gst_sample_set_segment ()">gst_sample_set_segment</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-set-info" title="gst_sample_set_info ()">gst_sample_set_info</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstSample.html" title="GstSample"><span class="returnvalue">GstSample</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-new" title="gst_sample_new ()">gst_sample_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstSample.html" title="GstSample"><span class="returnvalue">GstSample</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-ref" title="gst_sample_ref ()">gst_sample_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="GstSample.html#gst-sample-unref" title="gst_sample_unref ()">gst_sample_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstSample.html" title="GstSample"><span class="returnvalue">GstSample</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-copy" title="gst_sample_copy ()">gst_sample_copy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstSample.html#gst-sample-is-writable" title="gst_sample_is_writable()">gst_sample_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="GstSample.html#gst-sample-make-writable" title="gst_sample_make_writable()">gst_sample_make_writable</a><span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstSample.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"> </td>
<td class="function_name"><a class="link" href="GstSample.html#GstSample-struct" title="GstSample">GstSample</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstSample.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-Boxed-Types.html">GBoxed</a>
    <span class="lineart">╰──</span> GstSample
</pre>
</div>
<div class="refsect1">
<a name="GstSample.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gst/gst.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GstSample.description"></a><h2>Description</h2>
<p>A <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> is a small object containing data, a type, timing and
extra arbitrary information.</p>
</div>
<div class="refsect1">
<a name="GstSample.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gst-sample-get-buffer"></a><h3>gst_sample_get_buffer ()</h3>
<pre class="programlisting"><a class="link" href="GstBuffer.html" title="GstBuffer"><span class="returnvalue">GstBuffer</span></a> *
gst_sample_get_buffer (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>);</pre>
<p>Get the buffer associated with <em class="parameter"><code>sample</code></em>
</p>
<div class="refsect3">
<a name="gst-sample-get-buffer.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>sample</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-get-buffer.returns"></a><h4>Returns</h4>
<p>the buffer of <em class="parameter"><code>sample</code></em>
or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
when there is no buffer. The buffer remains valid as long as
<em class="parameter"><code>sample</code></em>
is valid.  If you need to hold on to it for longer than
that, take a ref to the buffer with <a class="link" href="GstBuffer.html#gst-buffer-ref" title="gst_buffer_ref ()"><code class="function">gst_buffer_ref()</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</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-sample-get-buffer-list"></a><h3>gst_sample_get_buffer_list ()</h3>
<pre class="programlisting"><a class="link" href="GstBufferList.html" title="GstBufferList"><span class="returnvalue">GstBufferList</span></a> *
gst_sample_get_buffer_list (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>);</pre>
<p>Get the buffer list associated with <em class="parameter"><code>sample</code></em>
</p>
<div class="refsect3">
<a name="gst-sample-get-buffer-list.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>sample</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-get-buffer-list.returns"></a><h4>Returns</h4>
<p>the buffer list of <em class="parameter"><code>sample</code></em>
or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
when there is no buffer list. The buffer list remains valid as long as
<em class="parameter"><code>sample</code></em>
is valid.  If you need to hold on to it for longer than
that, take a ref to the buffer list with <a class="link" href="gstreamer-GstMiniObject.html#gst-mini-object-ref" title="gst_mini_object_ref ()"><code class="function">gst_mini_object_ref()</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</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>
<p class="since">Since: <a class="link" href="ix07.html#api-index-1.6">1.6</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-get-caps"></a><h3>gst_sample_get_caps ()</h3>
<pre class="programlisting"><a class="link" href="GstCaps.html" title="GstCaps"><span class="returnvalue">GstCaps</span></a> *
gst_sample_get_caps (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>);</pre>
<p>Get the caps associated with <em class="parameter"><code>sample</code></em>
</p>
<div class="refsect3">
<a name="gst-sample-get-caps.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>sample</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-get-caps.returns"></a><h4>Returns</h4>
<p>the caps of <em class="parameter"><code>sample</code></em>
or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
when there is no caps. The caps remain valid as long as <em class="parameter"><code>sample</code></em>
is
valid.  If you need to hold on to the caps for longer than that,
take a ref to the caps with <a class="link" href="GstCaps.html#gst-caps-ref" title="gst_caps_ref ()"><code class="function">gst_caps_ref()</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</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-sample-get-info"></a><h3>gst_sample_get_info ()</h3>
<pre class="programlisting">const <a class="link" href="GstStructure.html" title="GstStructure"><span class="returnvalue">GstStructure</span></a> *
gst_sample_get_info (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>);</pre>
<p>Get extra information associated with <em class="parameter"><code>sample</code></em>
.</p>
<div class="refsect3">
<a name="gst-sample-get-info.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>sample</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-get-info.returns"></a><h4>Returns</h4>
<p>the extra info of <em class="parameter"><code>sample</code></em>
.
The info remains valid as long as <em class="parameter"><code>sample</code></em>
is valid. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</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-sample-get-segment"></a><h3>gst_sample_get_segment ()</h3>
<pre class="programlisting"><a class="link" href="GstSegment.html" title="GstSegment"><span class="returnvalue">GstSegment</span></a> *
gst_sample_get_segment (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>);</pre>
<p>Get the segment associated with <em class="parameter"><code>sample</code></em>
</p>
<div class="refsect3">
<a name="gst-sample-get-segment.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>sample</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-get-segment.returns"></a><h4>Returns</h4>
<p>the segment of <em class="parameter"><code>sample</code></em>
.
The segment remains valid as long as <em class="parameter"><code>sample</code></em>
is valid. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-set-buffer"></a><h3>gst_sample_set_buffer ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_sample_set_buffer (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>,
                       <em class="parameter"><code><a class="link" href="GstBuffer.html" title="GstBuffer"><span class="type">GstBuffer</span></a> *buffer</code></em>);</pre>
<p>Set the buffer associated with <em class="parameter"><code>sample</code></em>
. <em class="parameter"><code>sample</code></em>
 must be writable.</p>
<div class="refsect3">
<a name="gst-sample-set-buffer.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>sample</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstBuffer.html" title="GstBuffer"><span class="type">GstBuffer</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-set-buffer-list"></a><h3>gst_sample_set_buffer_list ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_sample_set_buffer_list (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>,
                            <em class="parameter"><code><a class="link" href="GstBufferList.html" title="GstBufferList"><span class="type">GstBufferList</span></a> *buffer_list</code></em>);</pre>
<p>Set the buffer list associated with <em class="parameter"><code>sample</code></em>
. <em class="parameter"><code>sample</code></em>
 must be writable.</p>
<div class="refsect3">
<a name="gst-sample-set-buffer-list.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>sample</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer_list</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstBufferList.html" title="GstBufferList"><span class="type">GstBufferList</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix07.html#api-index-1.6">1.6</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-set-caps"></a><h3>gst_sample_set_caps ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_sample_set_caps (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>,
                     <em class="parameter"><code><a class="link" href="GstCaps.html" title="GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>);</pre>
<p>Set the caps associated with <em class="parameter"><code>sample</code></em>
. <em class="parameter"><code>sample</code></em>
 must be writable.</p>
<div class="refsect3">
<a name="gst-sample-set-caps.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>sample</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>caps</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstCaps.html" title="GstCaps"><span class="type">GstCaps</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-set-segment"></a><h3>gst_sample_set_segment ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_sample_set_segment (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>,
                        <em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>);</pre>
<p>Set the segment associated with <em class="parameter"><code>sample</code></em>
. <em class="parameter"><code>sample</code></em>
 must be writable.</p>
<div class="refsect3">
<a name="gst-sample-set-segment.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>sample</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>segment</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-set-info"></a><h3>gst_sample_set_info ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_sample_set_info (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>,
                     <em class="parameter"><code><a class="link" href="GstStructure.html" title="GstStructure"><span class="type">GstStructure</span></a> *info</code></em>);</pre>
<p>Set the info structure associated with <em class="parameter"><code>sample</code></em>
. <em class="parameter"><code>sample</code></em>
 must be writable,
and <em class="parameter"><code>info</code></em>
 must not have a parent set already.</p>
<div class="refsect3">
<a name="gst-sample-set-info.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>sample</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</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="GstStructure.html" title="GstStructure"><span class="type">GstStructure</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>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-new"></a><h3>gst_sample_new ()</h3>
<pre class="programlisting"><a class="link" href="GstSample.html" title="GstSample"><span class="returnvalue">GstSample</span></a> *
gst_sample_new (<em class="parameter"><code><a class="link" href="GstBuffer.html" title="GstBuffer"><span class="type">GstBuffer</span></a> *buffer</code></em>,
                <em class="parameter"><code><a class="link" href="GstCaps.html" title="GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>,
                <em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
                <em class="parameter"><code><a class="link" href="GstStructure.html" title="GstStructure"><span class="type">GstStructure</span></a> *info</code></em>);</pre>
<p>Create a new <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> with the provided details.</p>
<p>Free-function: gst_sample_unref</p>
<div class="refsect3">
<a name="gst-sample-new.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>buffer</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstBuffer.html" title="GstBuffer"><span class="type">GstBuffer</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>caps</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstCaps.html" title="GstCaps"><span class="type">GstCaps</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstStructure.html" title="GstStructure"><span class="type">GstStructure</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></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>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-new.returns"></a><h4>Returns</h4>
<p>the new <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a>. <a class="link" href="GstSample.html#gst-sample-unref" title="gst_sample_unref ()"><code class="function">gst_sample_unref()</code></a>
after usage. </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-sample-ref"></a><h3>gst_sample_ref ()</h3>
<pre class="programlisting"><a class="link" href="GstSample.html" title="GstSample"><span class="returnvalue">GstSample</span></a> *
gst_sample_ref (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>);</pre>
<p>Increases the refcount of the given sample by one.</p>
<div class="refsect3">
<a name="gst-sample-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>sample</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-ref.returns"></a><h4>Returns</h4>
<p><em class="parameter"><code>sample</code></em>
. </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-sample-unref"></a><h3>gst_sample_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_sample_unref (<em class="parameter"><code><a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *sample</code></em>);</pre>
<p>Decreases the refcount of the sample. If the refcount reaches 0, the
sample will be freed.</p>
<div class="refsect3">
<a name="gst-sample-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>sample</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</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></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-copy"></a><h3>gst_sample_copy ()</h3>
<pre class="programlisting"><a class="link" href="GstSample.html" title="GstSample"><span class="returnvalue">GstSample</span></a> *
gst_sample_copy (<em class="parameter"><code>const <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a> *buf</code></em>);</pre>
<p>Create a copy of the given sample. This will also make a newly allocated
copy of the data the source sample contains.</p>
<div class="refsect3">
<a name="gst-sample-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>buf</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-copy.returns"></a><h4>Returns</h4>
<p>a new copy of <em class="parameter"><code>buf</code></em>
. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix10.html#api-index-1.2">1.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-is-writable"></a><h3>gst_sample_is_writable()</h3>
<pre class="programlisting">#define         gst_sample_is_writable(sample)     gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (sample))
</pre>
<p>Tests if you can safely set the buffer and / or buffer list of <em class="parameter"><code>sample</code></em>
.</p>
<div class="refsect3">
<a name="gst-sample-is-writable.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>sample</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 1.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-sample-make-writable"></a><h3>gst_sample_make_writable()</h3>
<pre class="programlisting">#define         gst_sample_make_writable(sample)   GST_SAMPLE_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (sample)))
</pre>
<p>Returns a writable copy of <em class="parameter"><code>sample</code></em>
. If the source sample is
already writable, this will simply return the same sample.</p>
<p>Use this function to ensure that a sample can be safely modified before
making changes to it, for example before calling <a class="link" href="GstSample.html#gst-sample-set-buffer" title="gst_sample_set_buffer ()"><code class="function">gst_sample_set_buffer()</code></a></p>
<p>If the reference count of the source sample <em class="parameter"><code>sample</code></em>
 is exactly one, the caller
is the sole owner and this function will return the sample object unchanged.</p>
<p>If there is more than one reference on the object, a copy will be made using
<a class="link" href="GstSample.html#gst-sample-copy" title="gst_sample_copy ()"><code class="function">gst_sample_copy()</code></a>. The passed-in <em class="parameter"><code>sample</code></em>
 will be unreffed in that case, and the
caller will now own a reference to the new returned sample object.</p>
<p>In short, this function unrefs the sample in the argument and refs the sample
that it returns. Don't access the argument after calling this function unless
you have an additional reference to it.</p>
<div class="refsect3">
<a name="gst-sample-make-writable.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>sample</p></td>
<td class="parameter_description"><p>A <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</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></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-sample-make-writable.returns"></a><h4>Returns</h4>
<p>a writable sample which may or may not be the
same as <em class="parameter"><code>sample</code></em>
. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 1.16</p>
</div>
</div>
<div class="refsect1">
<a name="GstSample.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GstSample-struct"></a><h3>GstSample</h3>
<pre class="programlisting">typedef struct _GstSample GstSample;</pre>
<p>The opaque structure of a <a class="link" href="GstSample.html" title="GstSample"><span class="type">GstSample</span></a>. A sample contains a typed memory
block and the associated timing information. It is mainly used to
exchange buffers with an application.</p>
</div>
</div>
<div class="refsect1">
<a name="GstSample.see-also"></a><h2>See Also</h2>
<p><a class="link" href="GstBuffer.html" title="GstBuffer"><span class="type">GstBuffer</span></a>, <a class="link" href="GstCaps.html" title="GstCaps"><span class="type">GstCaps</span></a>, <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.28</div>
</body>
</html>