/usr/share/doc/gstreamer1.0-doc/gstreamer-1.0/GstPromise.html is in gstreamer1.0-doc 1.14.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GstPromise: GStreamer 1.0 Core Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GStreamer 1.0 Core Reference Manual">
<link rel="up" href="libgstreamer.html" title="GStreamer Core Library">
<link rel="prev" href="GstPreset.html" title="GstPreset">
<link rel="next" href="gstreamer-GstProtectionMeta.html" title="GstProtection">
<meta name="generator" content="GTK-Doc V1.27 (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="#GstPromise.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#GstPromise.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libgstreamer.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GstPreset.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gstreamer-GstProtectionMeta.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GstPromise"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GstPromise.top_of_page"></a>GstPromise</span></h2>
<p>GstPromise — a miniobject for future/promise-like functionality</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GstPromise.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstPromise.html#GstPromiseChangeFunc" title="GstPromiseChangeFunc ()">*GstPromiseChangeFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstPromise.html" title="GstPromise"><span class="returnvalue">GstPromise</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstPromise.html#gst-promise-new" title="gst_promise_new ()">gst_promise_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstPromise.html" title="GstPromise"><span class="returnvalue">GstPromise</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstPromise.html#gst-promise-new-with-change-func" title="gst_promise_new_with_change_func ()">gst_promise_new_with_change_func</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstPromise.html" title="GstPromise"><span class="returnvalue">GstPromise</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstPromise.html#gst-promise-ref" title="gst_promise_ref ()">gst_promise_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GstPromise.html#gst-promise-unref" title="gst_promise_unref ()">gst_promise_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstPromise.html#GstPromiseResult" title="enum GstPromiseResult"><span class="returnvalue">GstPromiseResult</span></a>
</td>
<td class="function_name">
<a class="link" href="GstPromise.html#gst-promise-wait" title="gst_promise_wait ()">gst_promise_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="GstPromise.html#gst-promise-reply" title="gst_promise_reply ()">gst_promise_reply</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="GstPromise.html#gst-promise-interrupt" title="gst_promise_interrupt ()">gst_promise_interrupt</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="GstPromise.html#gst-promise-expire" title="gst_promise_expire ()">gst_promise_expire</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a class="link" href="GstStructure.html" title="GstStructure"><span class="returnvalue">GstStructure</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstPromise.html#gst-promise-get-reply" title="gst_promise_get_reply ()">gst_promise_get_reply</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstPromise.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GstPromise.html#GstPromiseResult" title="enum GstPromiseResult">GstPromiseResult</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GstPromise.html#GstPromise-struct" title="struct GstPromise">GstPromise</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstPromise.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="/usr/share/gtk-doc/html/gobject/gobject-Boxed-Types.html">GBoxed</a>
<span class="lineart">╰──</span> GstPromise
</pre>
</div>
<div class="refsect1">
<a name="GstPromise.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <gst/gstprotection.h>
</pre>
</div>
<div class="refsect1">
<a name="GstPromise.description"></a><h2>Description</h2>
<p>The <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> object implements the container for values that may
be available later. i.e. a Future or a Promise in</p>
<a class="ulink" href="https://en.wikipedia.org/wiki/Futures_and_promises" target="_top">https://en.wikipedia.org/wiki/Futures_and_promises</a><p>As with all Future/Promise-like functionality, there is the concept of the
producer of the value and the consumer of the value.</p>
<p>A <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> is created with <a class="link" href="GstPromise.html#gst-promise-new" title="gst_promise_new ()"><code class="function">gst_promise_new()</code></a> by the consumer and passed
to the producer to avoid thread safety issues with the change callback.
A <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> can be replied to with a value (or an error) by the producer
with <a class="link" href="GstPromise.html#gst-promise-reply" title="gst_promise_reply ()"><code class="function">gst_promise_reply()</code></a>. <a class="link" href="GstPromise.html#gst-promise-interrupt" title="gst_promise_interrupt ()"><code class="function">gst_promise_interrupt()</code></a> is for the consumer to
indicate to the producer that the value is not needed anymore and producing
that value can stop. The <em class="parameter"><code>GST_PROMISE_RESULT_EXPIRED</code></em>
state set by a call
to <a class="link" href="GstPromise.html#gst-promise-expire" title="gst_promise_expire ()"><code class="function">gst_promise_expire()</code></a> indicates to the consumer that a value will never
be produced and is intended to be called by a third party that implements
some notion of message handling such as <a class="link" href="GstBus.html" title="GstBus"><span class="type">GstBus</span></a>.
A callback can also be installed at <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> creation for
result changes with <a class="link" href="GstPromise.html#gst-promise-new-with-change-func" title="gst_promise_new_with_change_func ()"><code class="function">gst_promise_new_with_change_func()</code></a>.
The change callback can be used to chain <a href="GstPromise.html#GstPromise-struct"><span class="type">GstPromises</span></a>'s together as in the
following example.</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</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">const</span> GstStructure <span class="gtkdoc opt">*</span>reply<span class="gtkdoc opt">;</span>
GstPromise <span class="gtkdoc opt">*</span>p<span class="gtkdoc opt">;</span>
<span class="keyword">if</span> <span class="gtkdoc opt">(</span><span class="function"><a href="GstPromise.html#gst-promise-wait">gst_promise_wait</a></span> <span class="gtkdoc opt">(</span>promise<span class="gtkdoc opt">) !=</span> GST_PROMISE_RESULT_REPLIED<span class="gtkdoc opt">)</span>
<span class="keyword">return</span><span class="gtkdoc opt">;</span> <span class="gtkdoc slc">// interrupted or expired value</span>
reply <span class="gtkdoc opt">=</span> <span class="function"><a href="GstPromise.html#gst-promise-get-reply">gst_promise_get_reply</a></span> <span class="gtkdoc opt">(</span>promise<span class="gtkdoc opt">);</span>
<span class="keyword">if</span> <span class="gtkdoc opt">(</span>error in reply<span class="gtkdoc opt">)</span>
<span class="keyword">return</span><span class="gtkdoc opt">;</span> <span class="gtkdoc slc">// propagate error</span>
p <span class="gtkdoc opt">=</span> <span class="function"><a href="GstPromise.html#gst-promise-new-with-change-func">gst_promise_new_with_change_func</a></span> <span class="gtkdoc opt">(</span>another_promise_change_func<span class="gtkdoc opt">,</span> user_data<span class="gtkdoc opt">,</span> notify<span class="gtkdoc opt">);</span>
pass p to promise<span class="gtkdoc opt">-</span><span class="keyword">using</span> API</pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>Each <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> starts out with a <a class="link" href="GstPromise.html#GstPromiseResult" title="enum GstPromiseResult"><span class="type">GstPromiseResult</span></a> of
<a class="link" href="GstPromise.html#GST-PROMISE-RESULT-PENDING:CAPS"><code class="literal">GST_PROMISE_RESULT_PENDING</code></a> and only ever transitions once
into one of the other <a class="link" href="GstPromise.html#GstPromiseResult" title="enum GstPromiseResult"><span class="type">GstPromiseResult</span></a>'s.</p>
<p>In order to support multi-threaded code, <a class="link" href="GstPromise.html#gst-promise-reply" title="gst_promise_reply ()"><code class="function">gst_promise_reply()</code></a>,
<a class="link" href="GstPromise.html#gst-promise-interrupt" title="gst_promise_interrupt ()"><code class="function">gst_promise_interrupt()</code></a> and <a class="link" href="GstPromise.html#gst-promise-expire" title="gst_promise_expire ()"><code class="function">gst_promise_expire()</code></a> may all be from
different threads with some restrictions and the final result of the promise
is whichever call is made first. There are two restrictions on ordering:</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>That <a class="link" href="GstPromise.html#gst-promise-reply" title="gst_promise_reply ()"><code class="function">gst_promise_reply()</code></a> and <a class="link" href="GstPromise.html#gst-promise-interrupt" title="gst_promise_interrupt ()"><code class="function">gst_promise_interrupt()</code></a> cannot be called
after <a class="link" href="GstPromise.html#gst-promise-expire" title="gst_promise_expire ()"><code class="function">gst_promise_expire()</code></a></p></li>
<li class="listitem"><p>That <a class="link" href="GstPromise.html#gst-promise-reply" title="gst_promise_reply ()"><code class="function">gst_promise_reply()</code></a> and <a class="link" href="GstPromise.html#gst-promise-interrupt" title="gst_promise_interrupt ()"><code class="function">gst_promise_interrupt()</code></a>
cannot be called twice.</p></li>
</ol></div>
<p>The change function set with <a class="link" href="GstPromise.html#gst-promise-new-with-change-func" title="gst_promise_new_with_change_func ()"><code class="function">gst_promise_new_with_change_func()</code></a> is
called directly from either the <a class="link" href="GstPromise.html#gst-promise-reply" title="gst_promise_reply ()"><code class="function">gst_promise_reply()</code></a>,
<a class="link" href="GstPromise.html#gst-promise-interrupt" title="gst_promise_interrupt ()"><code class="function">gst_promise_interrupt()</code></a> or <a class="link" href="GstPromise.html#gst-promise-expire" title="gst_promise_expire ()"><code class="function">gst_promise_expire()</code></a> and can be called
from an arbitrary thread. <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> using APIs can restrict this to
a single thread or a subset of threads but that is entirely up to the API
that uses <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a>.</p>
</div>
<div class="refsect1">
<a name="GstPromise.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="GstPromiseChangeFunc"></a><h3>GstPromiseChangeFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GstPromiseChangeFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> *promise</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<div class="refsect3">
<a name="GstPromiseChangeFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>promise</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-new"></a><h3>gst_promise_new ()</h3>
<pre class="programlisting"><a class="link" href="GstPromise.html" title="GstPromise"><span class="returnvalue">GstPromise</span></a> *
gst_promise_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="refsect3">
<a name="gst-promise-new.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a></p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-new-with-change-func"></a><h3>gst_promise_new_with_change_func ()</h3>
<pre class="programlisting"><a class="link" href="GstPromise.html" title="GstPromise"><span class="returnvalue">GstPromise</span></a> *
gst_promise_new_with_change_func (<em class="parameter"><code><a class="link" href="GstPromise.html#GstPromiseChangeFunc" title="GstPromiseChangeFunc ()"><span class="type">GstPromiseChangeFunc</span></a> func</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
<em class="parameter"><code><a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre>
<p><em class="parameter"><code>func</code></em>
will be called exactly once when transitioning out of
<a class="link" href="GstPromise.html#GST-PROMISE-RESULT-PENDING:CAPS"><code class="literal">GST_PROMISE_RESULT_PENDING</code></a> into any of the other <a class="link" href="GstPromise.html#GstPromiseResult" title="enum GstPromiseResult"><span class="type">GstPromiseResult</span></a>
states.</p>
<div class="refsect3">
<a name="gst-promise-new-with-change-func.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html#GstPromiseChangeFunc" title="GstPromiseChangeFunc ()"><span class="type">GstPromiseChangeFunc</span></a> to call. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until the GDestroyNotify argument is called."><span class="acronym">scope notified</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>argument to call <em class="parameter"><code>func</code></em>
with. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>notify</p></td>
<td class="parameter_description"><p>notification function that <em class="parameter"><code>user_data</code></em>
is no longer needed</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-promise-new-with-change-func.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a></p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-ref"></a><h3>gst_promise_ref ()</h3>
<pre class="programlisting"><a class="link" href="GstPromise.html" title="GstPromise"><span class="returnvalue">GstPromise</span></a> *
gst_promise_ref (<em class="parameter"><code><a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> *promise</code></em>);</pre>
<p>Increases the refcount of the given <em class="parameter"><code>promise</code></em>
by one.</p>
<div class="refsect3">
<a name="gst-promise-ref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>promise</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-promise-ref.returns"></a><h4>Returns</h4>
<p><em class="parameter"><code>promise</code></em>
. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-unref"></a><h3>gst_promise_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_promise_unref (<em class="parameter"><code><a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> *promise</code></em>);</pre>
<p>Decreases the refcount of the promise. If the refcount reaches 0, the
promise will be freed.</p>
<div class="refsect3">
<a name="gst-promise-unref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>promise</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-wait"></a><h3>gst_promise_wait ()</h3>
<pre class="programlisting"><a class="link" href="GstPromise.html#GstPromiseResult" title="enum GstPromiseResult"><span class="returnvalue">GstPromiseResult</span></a>
gst_promise_wait (<em class="parameter"><code><a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> *promise</code></em>);</pre>
<p>Wait for <em class="parameter"><code>promise</code></em>
to move out of the <a class="link" href="GstPromise.html#GST-PROMISE-RESULT-PENDING:CAPS"><code class="literal">GST_PROMISE_RESULT_PENDING</code></a> state.
If <em class="parameter"><code>promise</code></em>
is not in <a class="link" href="GstPromise.html#GST-PROMISE-RESULT-PENDING:CAPS"><code class="literal">GST_PROMISE_RESULT_PENDING</code></a> then it will return
immediately with the current result.</p>
<div class="refsect3">
<a name="gst-promise-wait.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>promise</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-promise-wait.returns"></a><h4>Returns</h4>
<p> the result of the promise</p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-reply"></a><h3>gst_promise_reply ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_promise_reply (<em class="parameter"><code><a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> *promise</code></em>,
<em class="parameter"><code><a class="link" href="GstStructure.html" title="GstStructure"><span class="type">GstStructure</span></a> *s</code></em>);</pre>
<p>Set a reply on <em class="parameter"><code>promise</code></em>
. This will wake up any waiters with
<a class="link" href="GstPromise.html#GST-PROMISE-RESULT-REPLIED:CAPS"><code class="literal">GST_PROMISE_RESULT_REPLIED</code></a>. Called by the producer of the value to
indicate success (or failure).</p>
<p>If <em class="parameter"><code>promise</code></em>
has already been interrupted by the consumer, then this reply
is not visible to the consumer.</p>
<div class="refsect3">
<a name="gst-promise-reply.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>promise</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<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>s</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstStructure.html" title="GstStructure"><span class="type">GstStructure</span></a> with the the reply contents. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-interrupt"></a><h3>gst_promise_interrupt ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_promise_interrupt (<em class="parameter"><code><a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> *promise</code></em>);</pre>
<p>Interrupt waiting for a <em class="parameter"><code>promise</code></em>
. This will wake up any waiters with
<a class="link" href="GstPromise.html#GST-PROMISE-RESULT-INTERRUPTED:CAPS"><code class="literal">GST_PROMISE_RESULT_INTERRUPTED</code></a>. Called when the consumer does not want
the value produced anymore.</p>
<div class="refsect3">
<a name="gst-promise-interrupt.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>promise</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-expire"></a><h3>gst_promise_expire ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_promise_expire (<em class="parameter"><code><a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> *promise</code></em>);</pre>
<p>Expire a <em class="parameter"><code>promise</code></em>
. This will wake up any waiters with
<a class="link" href="GstPromise.html#GST-PROMISE-RESULT-EXPIRED:CAPS"><code class="literal">GST_PROMISE_RESULT_EXPIRED</code></a>. Called by a message loop when the parent
message is handled and/or destroyed (possibly unanswered).</p>
<div class="refsect3">
<a name="gst-promise-expire.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>promise</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-promise-get-reply"></a><h3>gst_promise_get_reply ()</h3>
<pre class="programlisting">const <a class="link" href="GstStructure.html" title="GstStructure"><span class="returnvalue">GstStructure</span></a> *
gst_promise_get_reply (<em class="parameter"><code><a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a> *promise</code></em>);</pre>
<p>Retrieve the reply set on <em class="parameter"><code>promise</code></em>
. <em class="parameter"><code>promise</code></em>
must be in
<a class="link" href="GstPromise.html#GST-PROMISE-RESULT-REPLIED:CAPS"><code class="literal">GST_PROMISE_RESULT_REPLIED</code></a> and the returned structure is owned by <em class="parameter"><code>promise</code></em>
</p>
<div class="refsect3">
<a name="gst-promise-get-reply.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>promise</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-promise-get-reply.returns"></a><h4>Returns</h4>
<p>The reply set on <em class="parameter"><code>promise</code></em>
. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
</div>
<div class="refsect1">
<a name="GstPromise.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GstPromiseResult"></a><h3>enum GstPromiseResult</h3>
<p>The result of a <a class="link" href="GstPromise.html" title="GstPromise"><span class="type">GstPromise</span></a></p>
<div class="refsect3">
<a name="GstPromiseResult.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GST-PROMISE-RESULT-PENDING:CAPS"></a>GST_PROMISE_RESULT_PENDING</p></td>
<td class="enum_member_description">
<p>Initial state. Waiting for transition to any
other state.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-PROMISE-RESULT-INTERRUPTED:CAPS"></a>GST_PROMISE_RESULT_INTERRUPTED</p></td>
<td class="enum_member_description">
<p>Interrupted by the consumer as it doesn't
want the value anymore.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-PROMISE-RESULT-REPLIED:CAPS"></a>GST_PROMISE_RESULT_REPLIED</p></td>
<td class="enum_member_description">
<p>A producer marked a reply</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-PROMISE-RESULT-EXPIRED:CAPS"></a>GST_PROMISE_RESULT_EXPIRED</p></td>
<td class="enum_member_description">
<p>The promise expired (the carrying object
lost all refs) and the promise will never be fulfilled.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GstPromise-struct"></a><h3>struct GstPromise</h3>
<pre class="programlisting">struct GstPromise {
GstMiniObject parent;
};
</pre>
<div class="refsect3">
<a name="GstPromise.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody><tr>
<td class="struct_member_name"><p><a class="link" href="gstreamer-GstMiniObject.html#GstMiniObject" title="struct GstMiniObject"><span class="type">GstMiniObject</span></a> <em class="structfield"><code><a name="GstPromise-struct.parent"></a>parent</code></em>;</p></td>
<td class="struct_member_description"><p>parent <a class="link" href="gstreamer-GstMiniObject.html#GstMiniObject" title="struct GstMiniObject"><span class="type">GstMiniObject</span></a></p></td>
<td class="struct_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.14">1.14</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.27</div>
</body>
</html>
|