1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GstBufferStraw</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GStreamer 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-check.html" title="GStreamer Check Unit Testing">
9 <link rel="prev" href="gstreamer-libs-GstCheck.html" title="GstCheck">
10 <link rel="next" href="gstreamer-libs-GstStreamConsistency.html" title="GstStreamConsistency">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="gstreamer-libs-GstCheck.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-check.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gstreamer-libs-GstStreamConsistency.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gstreamer-libs-GstBufferStraw.synopsis" class="shortcut">Top</a>
26 <a href="#gstreamer-libs-GstBufferStraw.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="gstreamer-libs-GstBufferStraw"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="gstreamer-libs-GstBufferStraw.top_of_page"></a>GstBufferStraw</span></h2>
34 <p>GstBufferStraw — Buffer interception code for GStreamer unit tests</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="gstreamer-libs-GstBufferStraw.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include <gst/check/gstbufferstraw.h>
43 <span class="returnvalue">void</span> <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-start-pipeline" title="gst_buffer_straw_start_pipeline ()">gst_buffer_straw_start_pipeline</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a> *bin</code></em>,
44 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> *pad</code></em>);
45 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> * <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-get-buffer" title="gst_buffer_straw_get_buffer ()">gst_buffer_straw_get_buffer</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a> *bin</code></em>,
46 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> *pad</code></em>);
47 <span class="returnvalue">void</span> <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-stop-pipeline" title="gst_buffer_straw_stop_pipeline ()">gst_buffer_straw_stop_pipeline</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a> *bin</code></em>,
48 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> *pad</code></em>);
51 <div class="refsect1">
52 <a name="gstreamer-libs-GstBufferStraw.description"></a><h2>Description</h2>
54 These macros and functions are for internal use of the unit tests found
55 inside the 'check' directories of various GStreamer packages.
58 <div class="refsect1">
59 <a name="gstreamer-libs-GstBufferStraw.details"></a><h2>Details</h2>
60 <div class="refsect2">
61 <a name="gst-buffer-straw-start-pipeline"></a><h3>gst_buffer_straw_start_pipeline ()</h3>
62 <pre class="programlisting"><span class="returnvalue">void</span> gst_buffer_straw_start_pipeline (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a> *bin</code></em>,
63 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> *pad</code></em>);</pre>
65 Sets up a pipeline for buffer sucking. This will allow you to call
66 <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-get-buffer" title="gst_buffer_straw_get_buffer ()"><code class="function">gst_buffer_straw_get_buffer()</code></a> to access buffers as they pass over <em class="parameter"><code>pad</code></em>.
69 This function is normally used in unit tests that want to verify that a
70 particular element is outputting correct buffers. For example, you would make
71 a pipeline via <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstParse.html#gst-parse-launch"><code class="function">gst_parse_launch()</code></a>, pull out the pad you want to monitor, then
72 call <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-get-buffer" title="gst_buffer_straw_get_buffer ()"><code class="function">gst_buffer_straw_get_buffer()</code></a> to get the buffers that pass through <em class="parameter"><code>pad</code></em>.
73 The pipeline will block until you have sucked off the buffers.
76 This function will set the state of <em class="parameter"><code>bin</code></em> to PLAYING; to clean up, be sure to
77 call <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-stop-pipeline" title="gst_buffer_straw_stop_pipeline ()"><code class="function">gst_buffer_straw_stop_pipeline()</code></a>.
80 Note that you may not start two buffer straws at the same time. This function
81 is intended for unit tests, not general API use. In fact it calls fail_if
82 from libcheck, so you cannot use it outside unit tests.
84 <div class="variablelist"><table border="0">
85 <col align="left" valign="top">
88 <td><p><span class="term"><em class="parameter"><code>bin</code></em> :</span></p></td>
89 <td>the pipeline to run</td>
92 <td><p><span class="term"><em class="parameter"><code>pad</code></em> :</span></p></td>
93 <td>a pad on an element in <em class="parameter"><code>bin</code></em>
100 <div class="refsect2">
101 <a name="gst-buffer-straw-get-buffer"></a><h3>gst_buffer_straw_get_buffer ()</h3>
102 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> * gst_buffer_straw_get_buffer (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a> *bin</code></em>,
103 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> *pad</code></em>);</pre>
105 Get one buffer from <em class="parameter"><code>pad</code></em>. Implemented via buffer probes. This function will
106 block until the pipeline passes a buffer over <em class="parameter"><code>pad</code></em>, so for robust behavior
107 in unit tests, you need to use check's timeout to fail out in the case that a
108 buffer never arrives.
111 You must have previously called <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-start-pipeline" title="gst_buffer_straw_start_pipeline ()"><code class="function">gst_buffer_straw_start_pipeline()</code></a> on
112 <em class="parameter"><code>pipeline</code></em> and <em class="parameter"><code>pad</code></em>.
114 <div class="variablelist"><table border="0">
115 <col align="left" valign="top">
118 <td><p><span class="term"><em class="parameter"><code>bin</code></em> :</span></p></td>
119 <td>the pipeline previously started via <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-start-pipeline" title="gst_buffer_straw_start_pipeline ()"><code class="function">gst_buffer_straw_start_pipeline()</code></a>
123 <td><p><span class="term"><em class="parameter"><code>pad</code></em> :</span></p></td>
124 <td>the pad previously passed to <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-start-pipeline" title="gst_buffer_straw_start_pipeline ()"><code class="function">gst_buffer_straw_start_pipeline()</code></a>
128 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
129 <td>the captured <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a>.</td>
135 <div class="refsect2">
136 <a name="gst-buffer-straw-stop-pipeline"></a><h3>gst_buffer_straw_stop_pipeline ()</h3>
137 <pre class="programlisting"><span class="returnvalue">void</span> gst_buffer_straw_stop_pipeline (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a> *bin</code></em>,
138 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> *pad</code></em>);</pre>
140 Set <em class="parameter"><code>bin</code></em> to <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#GST-STATE-NULL:CAPS"><span class="type">GST_STATE_NULL</span></a> and release resource allocated in
141 <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-start-pipeline" title="gst_buffer_straw_start_pipeline ()"><code class="function">gst_buffer_straw_start_pipeline()</code></a>.
144 You must have previously called <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-start-pipeline" title="gst_buffer_straw_start_pipeline ()"><code class="function">gst_buffer_straw_start_pipeline()</code></a> on
145 <em class="parameter"><code>pipeline</code></em> and <em class="parameter"><code>pad</code></em>.
147 <div class="variablelist"><table border="0">
148 <col align="left" valign="top">
151 <td><p><span class="term"><em class="parameter"><code>bin</code></em> :</span></p></td>
152 <td>the pipeline previously started via <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-start-pipeline" title="gst_buffer_straw_start_pipeline ()"><code class="function">gst_buffer_straw_start_pipeline()</code></a>
156 <td><p><span class="term"><em class="parameter"><code>pad</code></em> :</span></p></td>
157 <td>the pad previously passed to <a class="link" href="gstreamer-libs-GstBufferStraw.html#gst-buffer-straw-start-pipeline" title="gst_buffer_straw_start_pipeline ()"><code class="function">gst_buffer_straw_start_pipeline()</code></a>
167 Generated by GTK-Doc V1.18</div>