| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>GstBaseSrc: GStreamer 1.0 Library Reference Manual</title> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> |
| <link rel="home" href="index.html" title="GStreamer 1.0 Library Reference Manual"> |
| <link rel="up" href="gstreamer-base.html" title="GStreamer Base and Utillity Classes"> |
| <link rel="prev" href="GstBaseParse.html" title="GstBaseParse"> |
| <link rel="next" href="GstBaseSink.html" title="GstBaseSink"> |
| <meta name="generator" content="GTK-Doc V1.24 (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="#GstBaseSrc.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> |
| <a href="#GstBaseSrc.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties"> <span class="dim">|</span> |
| <a href="#GstBaseSrc.properties" class="shortcut">Properties</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="gstreamer-base.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> |
| <td><a accesskey="p" href="GstBaseParse.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> |
| <td><a accesskey="n" href="GstBaseSink.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> |
| </tr></table> |
| <div class="refentry"> |
| <a name="GstBaseSrc"></a><div class="titlepage"></div> |
| <div class="refnamediv"><table width="100%"><tr> |
| <td valign="top"> |
| <h2><span class="refentrytitle"><a name="GstBaseSrc.top_of_page"></a>GstBaseSrc</span></h2> |
| <p>GstBaseSrc — Base class for getrange based source elements</p> |
| </td> |
| <td class="gallery_image" valign="top" align="right"></td> |
| </tr></table></div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.functions"></a><h2>Functions</h2> |
| <div class="informaltable"><table width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="functions_return"> |
| <col class="functions_name"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="function_type"> |
| <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-wait-playing" title="gst_base_src_wait_playing ()">gst_base_src_wait_playing</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-start-wait" title="gst_base_src_start_wait ()">gst_base_src_start_wait</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="GstBaseSrc.html#gst-base-src-start-complete" title="gst_base_src_start_complete ()">gst_base_src_start_complete</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-is-live" title="gst_base_src_is_live ()">gst_base_src_is_live</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="GstBaseSrc.html#gst-base-src-set-live" title="gst_base_src_set_live ()">gst_base_src_set_live</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="GstBaseSrc.html#gst-base-src-set-format" title="gst_base_src_set_format ()">gst_base_src_set_format</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-query-latency" title="gst_base_src_query_latency ()">gst_base_src_query_latency</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-get-blocksize" title="gst_base_src_get_blocksize ()">gst_base_src_get_blocksize</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="GstBaseSrc.html#gst-base-src-set-blocksize" title="gst_base_src_set_blocksize ()">gst_base_src_set_blocksize</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-get-do-timestamp" title="gst_base_src_get_do_timestamp ()">gst_base_src_get_do_timestamp</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="GstBaseSrc.html#gst-base-src-set-do-timestamp" title="gst_base_src_set_do_timestamp ()">gst_base_src_set_do_timestamp</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="GstBaseSrc.html#gst-base-src-set-dynamic-size" title="gst_base_src_set_dynamic_size ()">gst_base_src_set_dynamic_size</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="GstBaseSrc.html#gst-base-src-set-automatic-eos" title="gst_base_src_set_automatic_eos ()">gst_base_src_set_automatic_eos</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-new-seamless-segment" title="gst_base_src_new_seamless_segment ()">gst_base_src_new_seamless_segment</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-set-caps" title="gst_base_src_set_caps ()">gst_base_src_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="GstBaseSrc.html#gst-base-src-get-allocator" title="gst_base_src_get_allocator ()">gst_base_src_get_allocator</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBufferPool.html"><span class="returnvalue">GstBufferPool</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-get-buffer-pool" title="gst_base_src_get_buffer_pool ()">gst_base_src_get_buffer_pool</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#gst-base-src-is-async" title="gst_base_src_is_async ()">gst_base_src_is_async</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="GstBaseSrc.html#gst-base-src-set-async" title="gst_base_src_set_async ()">gst_base_src_set_async</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#GST-BASE-SRC-PAD:CAPS" title="GST_BASE_SRC_PAD()">GST_BASE_SRC_PAD</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#GST-BASE-SRC-IS-STARTED:CAPS" title="GST_BASE_SRC_IS_STARTED()">GST_BASE_SRC_IS_STARTED</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstBaseSrc.html#GST-BASE-SRC-IS-STARTING:CAPS" title="GST_BASE_SRC_IS_STARTING()">GST_BASE_SRC_IS_STARTING</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.properties"></a><h2>Properties</h2> |
| <div class="informaltable"><table border="0"> |
| <colgroup> |
| <col width="150px" class="properties_type"> |
| <col width="300px" class="properties_name"> |
| <col width="200px" class="properties_flags"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="property_type"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td> |
| <td class="property_name"><a class="link" href="GstBaseSrc.html#GstBaseSrc--blocksize" title="The “blocksize” property">blocksize</a></td> |
| <td class="property_flags">Read / Write</td> |
| </tr> |
| <tr> |
| <td class="property_type"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> |
| <td class="property_name"><a class="link" href="GstBaseSrc.html#GstBaseSrc--do-timestamp" title="The “do-timestamp” property">do-timestamp</a></td> |
| <td class="property_flags">Read / Write</td> |
| </tr> |
| <tr> |
| <td class="property_type"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td> |
| <td class="property_name"><a class="link" href="GstBaseSrc.html#GstBaseSrc--num-buffers" title="The “num-buffers” property">num-buffers</a></td> |
| <td class="property_flags">Read / Write</td> |
| </tr> |
| <tr> |
| <td class="property_type"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> |
| <td class="property_name"><a class="link" href="GstBaseSrc.html#GstBaseSrc--typefind" title="The “typefind” property">typefind</a></td> |
| <td class="property_flags">Read / Write</td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.other"></a><h2>Types and Values</h2> |
| <div class="informaltable"><table width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="name"> |
| <col class="description"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="GstBaseSrc.html#GstBaseSrc-struct" title="struct GstBaseSrc">GstBaseSrc</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="GstBaseSrc.html#GstBaseSrcClass" title="struct GstBaseSrcClass">GstBaseSrcClass</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">enum</td> |
| <td class="function_name"><a class="link" href="GstBaseSrc.html#GstBaseSrcFlags" title="enum GstBaseSrcFlags">GstBaseSrcFlags</a></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.object-hierarchy"></a><h2>Object Hierarchy</h2> |
| <pre class="screen"> <a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a> |
| <span class="lineart">╰──</span> <a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a> |
| <span class="lineart">╰──</span> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstObject.html">GstObject</a> |
| <span class="lineart">╰──</span> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html">GstElement</a> |
| <span class="lineart">╰──</span> GstBaseSrc |
| <span class="lineart">╰──</span> <a class="link" href="GstPushSrc.html" title="GstPushSrc">GstPushSrc</a> |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.includes"></a><h2>Includes</h2> |
| <pre class="synopsis">#include <gst/base/gstbasesrc.h> |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.description"></a><h2>Description</h2> |
| <p>This is a generic base class for source elements. The following |
| types of sources are supported:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"><p>random access sources like files</p></li> |
| <li class="listitem"><p>seekable sources</p></li> |
| <li class="listitem"><p>live sources</p></li> |
| </ul></div> |
| <p>The source can be configured to operate in any <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a> with the |
| <a class="link" href="GstBaseSrc.html#gst-base-src-set-format" title="gst_base_src_set_format ()"><code class="function">gst_base_src_set_format()</code></a> method. The currently set format determines |
| the format of the internal <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstSegment.html"><span class="type">GstSegment</span></a> and any <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstEvent.html#GST-EVENT-SEGMENT:CAPS"><code class="literal">GST_EVENT_SEGMENT</code></a> |
| events. The default format for <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> is <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GST-FORMAT-BYTES:CAPS"><code class="literal">GST_FORMAT_BYTES</code></a>.</p> |
| <p><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> always supports push mode scheduling. If the following |
| conditions are met, it also supports pull mode scheduling:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"><p>The format is set to <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GST-FORMAT-BYTES:CAPS"><code class="literal">GST_FORMAT_BYTES</code></a> (default).</p></li> |
| <li class="listitem"><p><a class="link" href="GstBaseSrc.html#GstBaseSrcClass.is-seekable"><code class="function">GstBaseSrcClass.is_seekable()</code></a> returns <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p></li> |
| </ul></div> |
| <p>If all the conditions are met for operating in pull mode, <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> is |
| automatically seekable in push mode as well. The following conditions must |
| be met to make the element seekable in push mode when the format is not |
| <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GST-FORMAT-BYTES:CAPS"><code class="literal">GST_FORMAT_BYTES</code></a>:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"><p> |
| <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.is-seekable"><code class="function">GstBaseSrcClass.is_seekable()</code></a> returns <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. |
| </p></li> |
| <li class="listitem"><p> |
| <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.query"><code class="function">GstBaseSrcClass.query()</code></a> can convert all supported seek formats to the |
| internal format as set with <a class="link" href="GstBaseSrc.html#gst-base-src-set-format" title="gst_base_src_set_format ()"><code class="function">gst_base_src_set_format()</code></a>. |
| </p></li> |
| <li class="listitem"><p> |
| <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.do-seek"><code class="function">GstBaseSrcClass.do_seek()</code></a> is implemented, performs the seek and returns |
| <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. |
| </p></li> |
| </ul></div> |
| <p>When the element does not meet the requirements to operate in pull mode, the |
| offset and length in the <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.create"><code class="function">GstBaseSrcClass.create()</code></a> method should be ignored. |
| It is recommended to subclass <a class="link" href="GstPushSrc.html" title="GstPushSrc"><span class="type">GstPushSrc</span></a> instead, in this situation. If the |
| element can operate in pull mode but only with specific offsets and |
| lengths, it is allowed to generate an error when the wrong values are passed |
| to the <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.create"><code class="function">GstBaseSrcClass.create()</code></a> function.</p> |
| <p><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> has support for live sources. Live sources are sources that when |
| paused discard data, such as audio or video capture devices. A typical live |
| source also produces data at a fixed rate and thus provides a clock to publish |
| this rate. |
| Use <a class="link" href="GstBaseSrc.html#gst-base-src-set-live" title="gst_base_src_set_live ()"><code class="function">gst_base_src_set_live()</code></a> to activate the live source mode.</p> |
| <p>A live source does not produce data in the PAUSED state. This means that the |
| <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.create"><code class="function">GstBaseSrcClass.create()</code></a> method will not be called in PAUSED but only in |
| PLAYING. To signal the pipeline that the element will not produce data, the |
| return value from the READY to PAUSED state will be |
| <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#GST-STATE-CHANGE-NO-PREROLL:CAPS"><code class="literal">GST_STATE_CHANGE_NO_PREROLL</code></a>.</p> |
| <p>A typical live source will timestamp the buffers it creates with the |
| current running time of the pipeline. This is one reason why a live source |
| can only produce data in the PLAYING state, when the clock is actually |
| distributed and running.</p> |
| <p>Live sources that synchronize and block on the clock (an audio source, for |
| example) can use <a class="link" href="GstBaseSrc.html#gst-base-src-wait-playing" title="gst_base_src_wait_playing ()"><code class="function">gst_base_src_wait_playing()</code></a> when the |
| <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.create"><code class="function">GstBaseSrcClass.create()</code></a> function was interrupted by a state change to |
| PAUSED.</p> |
| <p>The <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.get-times"><code class="function">GstBaseSrcClass.get_times()</code></a> method can be used to implement pseudo-live |
| sources. It only makes sense to implement the <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.get-times"><code class="function">GstBaseSrcClass.get_times()</code></a> |
| function if the source is a live source. The <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.get-times"><code class="function">GstBaseSrcClass.get_times()</code></a> |
| function should return timestamps starting from 0, as if it were a non-live |
| source. The base class will make sure that the timestamps are transformed |
| into the current running_time. The base source will then wait for the |
| calculated running_time before pushing out the buffer.</p> |
| <p>For live sources, the base class will by default report a latency of 0. |
| For pseudo live sources, the base class will by default measure the difference |
| between the first buffer timestamp and the start time of get_times and will |
| report this value as the latency. |
| Subclasses should override the query function when this behaviour is not |
| acceptable.</p> |
| <p>There is only support in <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> for exactly one source pad, which |
| should be named "src". A source implementation (subclass of <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a>) |
| should install a pad template in its class_init function, like so:</p> |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15</pre></td> |
| <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">static void</span> |
| <span class="function">my_element_class_init</span> <span class="gtkdoc opt">(</span>GstMyElementClass <span class="gtkdoc opt">*</span>klass<span class="gtkdoc opt">)</span> |
| <span class="gtkdoc opt">{</span> |
| GstElementClass <span class="gtkdoc opt">*</span>gstelement_class <span class="gtkdoc opt">=</span> <span class="function">GST_ELEMENT_CLASS</span> <span class="gtkdoc opt">(</span>klass<span class="gtkdoc opt">);</span> |
| <span class="gtkdoc slc">// srctemplate should be a #GstStaticPadTemplate with direction</span> |
| <span class="gtkdoc slc">// %GST_PAD_SRC and name "src"</span> |
| <span class="function"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-class-add-pad-template">gst_element_class_add_pad_template</a></span> <span class="gtkdoc opt">(</span>gstelement_class<span class="gtkdoc opt">,</span> |
| <span class="function"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPadTemplate.html#gst-static-pad-template-get">gst_static_pad_template_get</a></span> <span class="gtkdoc opt">(&</span>srctemplate<span class="gtkdoc opt">));</span> |
| |
| <span class="function"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-class-set-static-metadata">gst_element_class_set_static_metadata</a></span> <span class="gtkdoc opt">(</span>gstelement_class<span class="gtkdoc opt">,</span> |
| <span class="string">"Source name"</span><span class="gtkdoc opt">,</span> |
| <span class="string">"Source"</span><span class="gtkdoc opt">,</span> |
| <span class="string">"My Source element"</span><span class="gtkdoc opt">,</span> |
| <span class="string">"The author <my.sink@my.email>"</span><span class="gtkdoc opt">);</span> |
| <span class="gtkdoc opt">}</span></pre></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <p></p> |
| <div class="refsect2"> |
| <a name="id-1.2.4.4.8.19"></a><h3>Controlled shutdown of live sources in applications</h3> |
| <p> |
| Applications that record from a live source may want to stop recording |
| in a controlled way, so that the recording is stopped, but the data |
| already in the pipeline is processed to the end (remember that many live |
| sources would go on recording forever otherwise). For that to happen the |
| application needs to make the source stop recording and send an EOS |
| event down the pipeline. The application would then wait for an |
| EOS message posted on the pipeline's bus to know when all data has |
| been processed and the pipeline can safely be stopped. |
| |
| An application may send an EOS event to a source element to make it |
| perform the EOS logic (send EOS event downstream or post a |
| <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstMessage.html#GST-MESSAGE-SEGMENT-DONE:CAPS"><code class="literal">GST_MESSAGE_SEGMENT_DONE</code></a> on the bus). This can typically be done |
| with the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-send-event"><code class="function">gst_element_send_event()</code></a> function on the element or its parent bin. |
| |
| After the EOS has been sent to the element, the application should wait for |
| an EOS message to be posted on the pipeline's bus. Once this EOS message is |
| received, it may safely shut down the entire pipeline. |
| </p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.functions_details"></a><h2>Functions</h2> |
| <div class="refsect2"> |
| <a name="gst-base-src-wait-playing"></a><h3>gst_base_src_wait_playing ()</h3> |
| <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a> |
| gst_base_src_wait_playing (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);</pre> |
| <p>If the <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.create"><code class="function">GstBaseSrcClass.create()</code></a> method performs its own synchronisation |
| against the clock it must unblock when going from PLAYING to the PAUSED state |
| and call this method before continuing to produce the remaining data.</p> |
| <p>This function will block until a state change to PLAYING happens (in which |
| case this function returns <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-OK:CAPS"><code class="literal">GST_FLOW_OK</code></a>) or the processing must be stopped due |
| to a state change to READY or a FLUSH event (in which case this function |
| returns <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-FLUSHING:CAPS"><code class="literal">GST_FLOW_FLUSHING</code></a>).</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.2.6"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>the src</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.2.7"></a><h4>Returns</h4> |
| <p> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-OK:CAPS"><code class="literal">GST_FLOW_OK</code></a> if <em class="parameter"><code>src</code></em> |
| is PLAYING and processing can |
| continue. Any other return value should be returned from the create vmethod.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-start-wait"></a><h3>gst_base_src_start_wait ()</h3> |
| <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a> |
| gst_base_src_start_wait (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *basesrc</code></em>);</pre> |
| <p>Wait until the start operation completes.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.3.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>basesrc</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.3.6"></a><h4>Returns</h4> |
| <p> a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a>.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-start-complete"></a><h3>gst_base_src_start_complete ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_start_complete (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *basesrc</code></em>, |
| <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> ret</code></em>);</pre> |
| <p>Complete an asynchronous start operation. When the subclass overrides the |
| start method, it should call <a class="link" href="GstBaseSrc.html#gst-base-src-start-complete" title="gst_base_src_start_complete ()"><code class="function">gst_base_src_start_complete()</code></a> when the start |
| operation completes either from the same thread or from an asynchronous |
| helper thread.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.4.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>basesrc</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>ret</p></td> |
| <td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-is-live"></a><h3>gst_base_src_is_live ()</h3> |
| <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_base_src_is_live (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);</pre> |
| <p>Check if an element is in live mode.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.5.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.5.6"></a><h4>Returns</h4> |
| <p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if element is in live mode.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-set-live"></a><h3>gst_base_src_set_live ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_set_live (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> live</code></em>);</pre> |
| <p>If the element listens to a live source, <em class="parameter"><code>live</code></em> |
| should |
| be set to <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p> |
| <p>A live source will not produce data in the PAUSED state and |
| will therefore not be able to participate in the PREROLL phase |
| of a pipeline. To signal this fact to the application and the |
| pipeline, the state change return value of the live source will |
| be GST_STATE_CHANGE_NO_PREROLL.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.6.6"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>live</p></td> |
| <td class="parameter_description"><p>new live-mode</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-set-format"></a><h3>gst_base_src_set_format ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_set_format (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a> format</code></em>);</pre> |
| <p>Sets the default format of the source. This will be the format used |
| for sending SEGMENT events and for performing seeks.</p> |
| <p>If a format of GST_FORMAT_BYTES is set, the element will be able to |
| operate in pull mode if the <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.is-seekable"><code class="function">GstBaseSrcClass.is_seekable()</code></a> returns <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p> |
| <p>This function must only be called in states < <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#GST-STATE-PAUSED:CAPS"><code class="literal">GST_STATE_PAUSED</code></a>.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.7.7"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>format</p></td> |
| <td class="parameter_description"><p>the format to use</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-query-latency"></a><h3>gst_base_src_query_latency ()</h3> |
| <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_base_src_query_latency (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *live</code></em>, |
| <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> *min_latency</code></em>, |
| <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> *max_latency</code></em>);</pre> |
| <p>Query the source for the latency parameters. <em class="parameter"><code>live</code></em> |
| will be <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> when <em class="parameter"><code>src</code></em> |
| is |
| configured as a live source. <em class="parameter"><code>min_latency</code></em> |
| and <em class="parameter"><code>max_latency</code></em> |
| will be set |
| to the difference between the running time and the timestamp of the first |
| buffer.</p> |
| <p>This function is mostly used by subclasses.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.8.6"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>the source</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>live</p></td> |
| <td class="parameter_description"><p> if the source is live. </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>][<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>min_latency</p></td> |
| <td class="parameter_description"><p> the min latency of the source. </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>][<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>max_latency</p></td> |
| <td class="parameter_description"><p> the max latency of the source. </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>][<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="id-1.2.4.4.9.8.7"></a><h4>Returns</h4> |
| <p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the query succeeded.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-get-blocksize"></a><h3>gst_base_src_get_blocksize ()</h3> |
| <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> |
| gst_base_src_get_blocksize (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);</pre> |
| <p>Get the number of bytes that <em class="parameter"><code>src</code></em> |
| will push out with each buffer.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.9.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>the source</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.9.6"></a><h4>Returns</h4> |
| <p> the number of bytes pushed with each buffer.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-set-blocksize"></a><h3>gst_base_src_set_blocksize ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_set_blocksize (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> blocksize</code></em>);</pre> |
| <p>Set the number of bytes that <em class="parameter"><code>src</code></em> |
| will push out with each buffer. When |
| <em class="parameter"><code>blocksize</code></em> |
| is set to -1, a default length will be used.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.10.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>the source</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>blocksize</p></td> |
| <td class="parameter_description"><p>the new blocksize in bytes</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-get-do-timestamp"></a><h3>gst_base_src_get_do_timestamp ()</h3> |
| <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_base_src_get_do_timestamp (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);</pre> |
| <p>Query if <em class="parameter"><code>src</code></em> |
| timestamps outgoing buffers based on the current running_time.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.11.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>the source</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.11.6"></a><h4>Returns</h4> |
| <p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the base class will automatically timestamp outgoing buffers.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-set-do-timestamp"></a><h3>gst_base_src_set_do_timestamp ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_set_do_timestamp (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> timestamp</code></em>);</pre> |
| <p>Configure <em class="parameter"><code>src</code></em> |
| to automatically timestamp outgoing buffers based on the |
| current running_time of the pipeline. This property is mostly useful for live |
| sources.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.12.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>the source</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>timestamp</p></td> |
| <td class="parameter_description"><p>enable or disable timestamping</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-set-dynamic-size"></a><h3>gst_base_src_set_dynamic_size ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_set_dynamic_size (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> dynamic</code></em>);</pre> |
| <p>If not <em class="parameter"><code>dynamic</code></em> |
| , size is only updated when needed, such as when trying to |
| read past current tracked size. Otherwise, size is checked for upon each |
| read.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.13.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>dynamic</p></td> |
| <td class="parameter_description"><p>new dynamic size mode</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-set-automatic-eos"></a><h3>gst_base_src_set_automatic_eos ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_set_automatic_eos (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> automatic_eos</code></em>);</pre> |
| <p>If <em class="parameter"><code>automatic_eos</code></em> |
| is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, <em class="parameter"><code>src</code></em> |
| will automatically go EOS if a buffer |
| after the total size is returned. By default this is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> but sources |
| that can't return an authoritative size and only know that they're EOS |
| when trying to read more should set this to <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.14.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>automatic_eos</p></td> |
| <td class="parameter_description"><p>automatic eos</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="ix04.html#api-index-1.4">1.4</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-new-seamless-segment"></a><h3>gst_base_src_new_seamless_segment ()</h3> |
| <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_base_src_new_seamless_segment (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><span class="type">gint64</span> start</code></em>, |
| <em class="parameter"><code><span class="type">gint64</span> stop</code></em>, |
| <em class="parameter"><code><span class="type">gint64</span> time</code></em>);</pre> |
| <p>Prepare a new seamless segment for emission downstream. This function must |
| only be called by derived sub-classes, and only from the <code class="function">create()</code> function, |
| as the stream-lock needs to be held.</p> |
| <p>The format for the new segment will be the current format of the source, as |
| configured with <a class="link" href="GstBaseSrc.html#gst-base-src-set-format" title="gst_base_src_set_format ()"><code class="function">gst_base_src_set_format()</code></a></p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.15.6"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>The source</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>start</p></td> |
| <td class="parameter_description"><p>The new start value for the segment</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>stop</p></td> |
| <td class="parameter_description"><p>Stop value for the new segment</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>time</p></td> |
| <td class="parameter_description"><p>The new time value for the start of the new segment</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.15.7"></a><h4>Returns</h4> |
| <p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if preparation of the seamless segment succeeded.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-set-caps"></a><h3>gst_base_src_set_caps ()</h3> |
| <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_base_src_set_caps (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstCaps.html"><span class="type">GstCaps</span></a> *caps</code></em>);</pre> |
| <p>Set new caps on the basesrc source pad.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.16.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</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 href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstCaps.html"><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> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.16.6"></a><h4>Returns</h4> |
| <p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the caps could be set</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-get-allocator"></a><h3>gst_base_src_get_allocator ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_get_allocator (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstAllocator.html"><span class="type">GstAllocator</span></a> **allocator</code></em>, |
| <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstAllocator.html#GstAllocationParams"><span class="type">GstAllocationParams</span></a> *params</code></em>);</pre> |
| <p>Lets <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> sub-classes to know the memory <em class="parameter"><code>allocator</code></em> |
| |
| used by the base class and its <em class="parameter"><code>params</code></em> |
| .</p> |
| <p>Unref the <em class="parameter"><code>allocator</code></em> |
| after usage.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.17.6"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</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 href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstAllocator.html"><span class="type">GstAllocator</span></a> |
| used. </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>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<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>params</p></td> |
| <td class="parameter_description"><p> the |
| <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstAllocator.html#GstAllocationParams"><span class="type">GstAllocationParams</span></a> of <em class="parameter"><code>allocator</code></em> |
| . </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>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<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-base-src-get-buffer-pool"></a><h3>gst_base_src_get_buffer_pool ()</h3> |
| <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBufferPool.html"><span class="returnvalue">GstBufferPool</span></a> * |
| gst_base_src_get_buffer_pool (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);</pre> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.18.4"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.18.5"></a><h4>Returns</h4> |
| <p> the instance of the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBufferPool.html"><span class="type">GstBufferPool</span></a> used |
| by the src; unref it 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-base-src-is-async"></a><h3>gst_base_src_is_async ()</h3> |
| <pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_base_src_is_async (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);</pre> |
| <p>Get the current async behaviour of <em class="parameter"><code>src</code></em> |
| . See also <a class="link" href="GstBaseSrc.html#gst-base-src-set-async" title="gst_base_src_set_async ()"><code class="function">gst_base_src_set_async()</code></a>.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.19.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.19.6"></a><h4>Returns</h4> |
| <p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>src</code></em> |
| is operating in async mode.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-base-src-set-async"></a><h3>gst_base_src_set_async ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_base_src_set_async (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>, |
| <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> async</code></em>);</pre> |
| <p>Configure async behaviour in <em class="parameter"><code>src</code></em> |
| , no state change will block. The open, |
| close, start, stop, play and pause virtual methods will be executed in a |
| different thread and are thus allowed to perform blocking operations. Any |
| blocking operation should be unblocked with the unlock vmethod.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.20.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>src</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>async</p></td> |
| <td class="parameter_description"><p>new async mode</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-BASE-SRC-PAD:CAPS"></a><h3>GST_BASE_SRC_PAD()</h3> |
| <pre class="programlisting">#define GST_BASE_SRC_PAD(obj) (GST_BASE_SRC_CAST (obj)->srcpad) |
| </pre> |
| <p>Gives the pointer to the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> object of the element.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.9.21.5"></a><h4>Parameters</h4> |
| <div class="informaltable"><table 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>obj</p></td> |
| <td class="parameter_description"><p>base source instance</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-BASE-SRC-IS-STARTED:CAPS"></a><h3>GST_BASE_SRC_IS_STARTED()</h3> |
| <pre class="programlisting">#define GST_BASE_SRC_IS_STARTED(obj) GST_OBJECT_FLAG_IS_SET ((obj), GST_BASE_SRC_FLAG_STARTED) |
| </pre> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-BASE-SRC-IS-STARTING:CAPS"></a><h3>GST_BASE_SRC_IS_STARTING()</h3> |
| <pre class="programlisting">#define GST_BASE_SRC_IS_STARTING(obj) GST_OBJECT_FLAG_IS_SET ((obj), GST_BASE_SRC_FLAG_STARTING) |
| </pre> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.other_details"></a><h2>Types and Values</h2> |
| <div class="refsect2"> |
| <a name="GstBaseSrc-struct"></a><h3>struct GstBaseSrc</h3> |
| <pre class="programlisting">struct GstBaseSrc;</pre> |
| <p>The opaque <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> data structure.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GstBaseSrcClass"></a><h3>struct GstBaseSrcClass</h3> |
| <pre class="programlisting">struct GstBaseSrcClass { |
| GstElementClass parent_class; |
| |
| /* virtual methods for subclasses */ |
| |
| /* get caps from subclass */ |
| GstCaps* (*get_caps) (GstBaseSrc *src, GstCaps *filter); |
| /* decide on caps */ |
| gboolean (*negotiate) (GstBaseSrc *src); |
| /* called if, in negotiation, caps need fixating */ |
| GstCaps * (*fixate) (GstBaseSrc *src, GstCaps *caps); |
| /* notify the subclass of new caps */ |
| gboolean (*set_caps) (GstBaseSrc *src, GstCaps *caps); |
| |
| /* setup allocation query */ |
| gboolean (*decide_allocation) (GstBaseSrc *src, GstQuery *query); |
| |
| /* start and stop processing, ideal for opening/closing the resource */ |
| gboolean (*start) (GstBaseSrc *src); |
| gboolean (*stop) (GstBaseSrc *src); |
| |
| /* given a buffer, return start and stop time when it should be pushed |
| * out. The base class will sync on the clock using these times. */ |
| void (*get_times) (GstBaseSrc *src, GstBuffer *buffer, |
| GstClockTime *start, GstClockTime *end); |
| |
| /* get the total size of the resource in the format set by |
| * gst_base_src_set_format() */ |
| gboolean (*get_size) (GstBaseSrc *src, guint64 *size); |
| |
| /* check if the resource is seekable */ |
| gboolean (*is_seekable) (GstBaseSrc *src); |
| |
| /* Prepare the segment on which to perform do_seek(), converting to the |
| * current basesrc format. */ |
| gboolean (*prepare_seek_segment) (GstBaseSrc *src, GstEvent *seek, |
| GstSegment *segment); |
| /* notify subclasses of a seek */ |
| gboolean (*do_seek) (GstBaseSrc *src, GstSegment *segment); |
| |
| /* unlock any pending access to the resource. subclasses should unlock |
| * any function ASAP. */ |
| gboolean (*unlock) (GstBaseSrc *src); |
| /* Clear any pending unlock request, as we succeeded in unlocking */ |
| gboolean (*unlock_stop) (GstBaseSrc *src); |
| |
| /* notify subclasses of a query */ |
| gboolean (*query) (GstBaseSrc *src, GstQuery *query); |
| |
| /* notify subclasses of an event */ |
| gboolean (*event) (GstBaseSrc *src, GstEvent *event); |
| |
| /* ask the subclass to create a buffer with offset and size, the default |
| * implementation will call alloc and fill. */ |
| GstFlowReturn (*create) (GstBaseSrc *src, guint64 offset, guint size, |
| GstBuffer **buf); |
| /* ask the subclass to allocate an output buffer. The default implementation |
| * will use the negotiated allocator. */ |
| GstFlowReturn (*alloc) (GstBaseSrc *src, guint64 offset, guint size, |
| GstBuffer **buf); |
| /* ask the subclass to fill the buffer with data from offset and size */ |
| GstFlowReturn (*fill) (GstBaseSrc *src, guint64 offset, guint size, |
| GstBuffer *buf); |
| }; |
| </pre> |
| <p>Subclasses can override any of the available virtual methods or not, as |
| needed. At the minimum, the <em class="parameter"><code>create</code></em> |
| method should be overridden to produce |
| buffers.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.10.3.5"></a><h4>Members</h4> |
| <div class="informaltable"><table 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 href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#GstElementClass"><span class="type">GstElementClass</span></a> <em class="structfield"><code><a name="GstBaseSrcClass.parent-class"></a>parent_class</code></em>;</p></td> |
| <td class="struct_member_description"><p>Element parent class</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.get-caps"></a>get_caps</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Called to get the caps to report</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.negotiate"></a>negotiate</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Negotiated the caps with the peer.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.fixate"></a>fixate</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Called during negotiation if caps need fixating. Implement instead of |
| setting a fixate function on the source pad.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.set-caps"></a>set_caps</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Notify subclass of changed output caps</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.decide-allocation"></a>decide_allocation</code></em> ()</p></td> |
| <td class="struct_member_description"><p>configure the allocation query</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.start"></a>start</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Start processing. Subclasses should open resources and prepare |
| to produce data. Implementation should call <a class="link" href="GstBaseSrc.html#gst-base-src-start-complete" title="gst_base_src_start_complete ()"><code class="function">gst_base_src_start_complete()</code></a> |
| when the operation completes, either from the current thread or any other |
| thread that finishes the start operation asynchronously.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.stop"></a>stop</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Stop processing. Subclasses should use this to close resources.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.get-times"></a>get_times</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Given a buffer, return the start and stop time when it |
| should be pushed out. The base class will sync on the clock using |
| these times.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.get-size"></a>get_size</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Return the total size of the resource, in the format set by |
| <a class="link" href="GstBaseSrc.html#gst-base-src-set-format" title="gst_base_src_set_format ()"><code class="function">gst_base_src_set_format()</code></a>.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.is-seekable"></a>is_seekable</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Check if the source can seek</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.prepare-seek-segment"></a>prepare_seek_segment</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Prepare the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstSegment.html"><span class="type">GstSegment</span></a> that will be passed to the |
| <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.do-seek"><code class="function">GstBaseSrcClass.do_seek()</code></a> vmethod for executing a seek |
| request. Sub-classes should override this if they support seeking in |
| formats other than the configured native format. By default, it tries to |
| convert the seek arguments to the configured native format and prepare a |
| segment in that format.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.do-seek"></a>do_seek</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Perform seeking on the resource to the indicated segment.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.unlock"></a>unlock</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Unlock any pending access to the resource. Subclasses should unblock |
| any blocked function ASAP. In particular, any <code class="function">create()</code> function in |
| progress should be unblocked and should return GST_FLOW_FLUSHING. Any |
| future <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.create"><code class="function">GstBaseSrcClass.create()</code></a> function call should also return |
| GST_FLOW_FLUSHING until the <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.unlock-stop"><code class="function">GstBaseSrcClass.unlock_stop()</code></a> function has |
| been called.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.unlock-stop"></a>unlock_stop</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Clear the previous unlock request. Subclasses should clear any |
| state they set during <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.unlock"><code class="function">GstBaseSrcClass.unlock()</code></a>, such as clearing command |
| queues.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.query"></a>query</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Handle a requested query.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.event"></a>event</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Override this to implement custom event handling.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.create"></a>create</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Ask the subclass to create a buffer with offset and size. When the |
| subclass returns GST_FLOW_OK, it MUST return a buffer of the requested size |
| unless fewer bytes are available because an EOS condition is near. No |
| buffer should be returned when the return value is different from |
| GST_FLOW_OK. A return value of GST_FLOW_EOS signifies that the end of |
| stream is reached. The default implementation will call |
| <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.alloc"><code class="function">GstBaseSrcClass.alloc()</code></a> and then call <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.fill"><code class="function">GstBaseSrcClass.fill()</code></a>.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.alloc"></a>alloc</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Ask the subclass to allocate a buffer with for offset and size. The |
| default implementation will create a new buffer from the negotiated allocator.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><em class="structfield"><code><a name="GstBaseSrcClass.fill"></a>fill</code></em> ()</p></td> |
| <td class="struct_member_description"><p>Ask the subclass to fill the buffer with data for offset and size. The |
| passed buffer is guaranteed to hold the requested amount of bytes.</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GstBaseSrcFlags"></a><h3>enum GstBaseSrcFlags</h3> |
| <p>The <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a> flags that a basesrc element may have.</p> |
| <div class="refsect3"> |
| <a name="id-1.2.4.4.10.4.4"></a><h4>Members</h4> |
| <div class="informaltable"><table 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-BASE-SRC-FLAG-STARTING:CAPS"></a>GST_BASE_SRC_FLAG_STARTING</p></td> |
| <td class="enum_member_description"> |
| <p>has source is starting</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="GST-BASE-SRC-FLAG-STARTED:CAPS"></a>GST_BASE_SRC_FLAG_STARTED</p></td> |
| <td class="enum_member_description"> |
| <p>has source been started</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="GST-BASE-SRC-FLAG-LAST:CAPS"></a>GST_BASE_SRC_FLAG_LAST</p></td> |
| <td class="enum_member_description"> |
| <p>offset to define more flags</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.property-details"></a><h2>Property Details</h2> |
| <div class="refsect2"> |
| <a name="GstBaseSrc--blocksize"></a><h3>The <code class="literal">“blocksize”</code> property</h3> |
| <pre class="programlisting"> “blocksize” <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a></pre> |
| <p>Size in bytes to read per buffer (-1 = default).</p> |
| <p>Flags: Read / Write</p> |
| <p>Default value: 4096</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GstBaseSrc--do-timestamp"></a><h3>The <code class="literal">“do-timestamp”</code> property</h3> |
| <pre class="programlisting"> “do-timestamp” <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> |
| <p>Apply current stream time to buffers.</p> |
| <p>Flags: Read / Write</p> |
| <p>Default value: FALSE</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GstBaseSrc--num-buffers"></a><h3>The <code class="literal">“num-buffers”</code> property</h3> |
| <pre class="programlisting"> “num-buffers” <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></pre> |
| <p>Number of buffers to output before sending EOS (-1 = unlimited).</p> |
| <p>Flags: Read / Write</p> |
| <p>Allowed values: >= -1</p> |
| <p>Default value: -1</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GstBaseSrc--typefind"></a><h3>The <code class="literal">“typefind”</code> property</h3> |
| <pre class="programlisting"> “typefind” <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> |
| <p>Run typefind before negotiating.</p> |
| <p>Flags: Read / Write</p> |
| <p>Default value: FALSE</p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstBaseSrc.see-also"></a><h2>See Also</h2> |
| <p><a class="link" href="GstPushSrc.html" title="GstPushSrc"><span class="type">GstPushSrc</span></a>, <a class="link" href="GstBaseTransform.html" title="GstBaseTransform"><span class="type">GstBaseTransform</span></a>, <a class="link" href="GstBaseSink.html" title="GstBaseSink"><span class="type">GstBaseSink</span></a></p> |
| </div> |
| </div> |
| <div class="footer"> |
| <hr>Generated by GTK-Doc V1.24</div> |
| </body> |
| </html> |