Initialize Tizen 2.3
[framework/multimedia/gstreamer0.10.git] / mobile / docs / libs / html / gstreamer-libs-GstBufferStraw.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
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">
13 </head>
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">
16 <tr valign="middle">
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>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gstreamer-libs-GstBufferStraw.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gstreamer-libs-GstBufferStraw.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="gstreamer-libs-GstBufferStraw"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
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>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="gstreamer-libs-GstBufferStraw.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">
41 #include &lt;gst/check/gstbufferstraw.h&gt;
42
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>);
49 </pre>
50 </div>
51 <div class="refsect1">
52 <a name="gstreamer-libs-GstBufferStraw.description"></a><h2>Description</h2>
53 <p>
54 These macros and functions are for internal use of the unit tests found
55 inside the 'check' directories of various GStreamer packages.
56 </p>
57 </div>
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>
64 <p>
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>.
67 </p>
68 <p>
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.
74 </p>
75 <p>
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>.
78 </p>
79 <p>
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.
83 </p>
84 <div class="variablelist"><table border="0">
85 <col align="left" valign="top">
86 <tbody>
87 <tr>
88 <td><p><span class="term"><em class="parameter"><code>bin</code></em> :</span></p></td>
89 <td>the pipeline to run</td>
90 </tr>
91 <tr>
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>
94 </td>
95 </tr>
96 </tbody>
97 </table></div>
98 </div>
99 <hr>
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>
104 <p>
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.
109 </p>
110 <p>
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>.
113 </p>
114 <div class="variablelist"><table border="0">
115 <col align="left" valign="top">
116 <tbody>
117 <tr>
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>
120 </td>
121 </tr>
122 <tr>
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>
125 </td>
126 </tr>
127 <tr>
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>
130 </tr>
131 </tbody>
132 </table></div>
133 </div>
134 <hr>
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>
139 <p>
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>.
142 </p>
143 <p>
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>.
146 </p>
147 <div class="variablelist"><table border="0">
148 <col align="left" valign="top">
149 <tbody>
150 <tr>
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>
153 </td>
154 </tr>
155 <tr>
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>
158 </td>
159 </tr>
160 </tbody>
161 </table></div>
162 </div>
163 </div>
164 </div>
165 <div class="footer">
166 <hr>
167           Generated by GTK-Doc V1.18</div>
168 </body>
169 </html>