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 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887
|
<!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</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GStreamer 0.10 Library Reference Manual">
<link rel="up" href="gstreamer-base.html" title="GStreamer Base and Utillity Classes">
<link rel="prev" href="gstreamer-base.html" title="GStreamer Base and Utillity Classes">
<link rel="next" href="GstBaseSink.html" title="GstBaseSink">
<meta name="generator" content="GTK-Doc V1.15 (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="2">
<tr valign="middle">
<td><a accesskey="p" href="gstreamer-base.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gstreamer-base.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GStreamer 0.10 Library Reference Manual</th>
<td><a accesskey="n" href="GstBaseSink.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GstBaseSrc.synopsis" class="shortcut">Top</a>
|
<a href="#GstBaseSrc.description" class="shortcut">Description</a>
|
<a href="#GstBaseSrc.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#GstBaseSrc.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="GstBaseSrc">
<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 valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="GstBaseSrc.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <gst/base/gstbasesrc.h>
<a class="link" href="GstBaseSrc.html#GstBaseSrc-struct" title="GstBaseSrc">GstBaseSrc</a>;
<a class="link" href="GstBaseSrc.html#GstBaseSrcClass" title="GstBaseSrcClass">GstBaseSrcClass</a>;
enum <a class="link" href="GstBaseSrc.html#GstBaseSrcFlags" title="enum GstBaseSrcFlags">GstBaseSrcFlags</a>;
<a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a> <a class="link" href="GstBaseSrc.html#gst-base-src-wait-playing" title="gst_base_src_wait_playing ()">gst_base_src_wait_playing</a> (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GstBaseSrc.html#gst-base-src-is-live" title="gst_base_src_is_live ()">gst_base_src_is_live</a> (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);
<span class="returnvalue">void</span> <a class="link" href="GstBaseSrc.html#gst-base-src-set-live" title="gst_base_src_set_live ()">gst_base_src_set_live</a> (<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="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> live</code></em>);
<span class="returnvalue">void</span> <a class="link" href="GstBaseSrc.html#gst-base-src-set-format" title="gst_base_src_set_format ()">gst_base_src_set_format</a> (<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="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a> format</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GstBaseSrc.html#gst-base-src-query-latency" title="gst_base_src_query_latency ()">gst_base_src_query_latency</a> (<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="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *live</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> *min_latency</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> *max_latency</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"><span class="returnvalue">gulong</span></a> <a class="link" href="GstBaseSrc.html#gst-base-src-get-blocksize" title="gst_base_src_get_blocksize ()">gst_base_src_get_blocksize</a> (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);
<span class="returnvalue">void</span> <a class="link" href="GstBaseSrc.html#gst-base-src-set-blocksize" title="gst_base_src_set_blocksize ()">gst_base_src_set_blocksize</a> (<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="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a> blocksize</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <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> (<em class="parameter"><code><a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> *src</code></em>);
<span class="returnvalue">void</span> <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> (<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="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> timestamp</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <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> (<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="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> start</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> stop</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> position</code></em>);
#define <a class="link" href="GstBaseSrc.html#GST-BASE-SRC-PAD:CAPS" title="GST_BASE_SRC_PAD()">GST_BASE_SRC_PAD</a> (obj)
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="GstBaseSrc.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----<a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstObject.html">GstObject</a>
+----<a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html">GstElement</a>
+----GstBaseSrc
+----<a class="link" href="GstPushSrc.html" title="GstPushSrc">GstPushSrc</a>
</pre>
</div>
<div class="refsect1" title="Properties">
<a name="GstBaseSrc.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GstBaseSrc.html#GstBaseSrc--blocksize" title='The "blocksize" property'>blocksize</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a> : Read / Write
"<a class="link" href="GstBaseSrc.html#GstBaseSrc--do-timestamp" title='The "do-timestamp" property'>do-timestamp</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
"<a class="link" href="GstBaseSrc.html#GstBaseSrc--num-buffers" title='The "num-buffers" property'>num-buffers</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> : Read / Write
"<a class="link" href="GstBaseSrc.html#GstBaseSrc--typefind" title='The "typefind" property'>typefind</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
</pre>
</div>
<div class="refsect1" title="Description">
<a name="GstBaseSrc.description"></a><h2>Description</h2>
<p>
This is a generice base class for source elements. The following
types of sources are supported:
</p>
<div class="itemizedlist"><ul class="itemizedlist" 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>
</p>
<p>
The source can be configured to operate in any <a href="/usr/share/gtk-doc/html/gstreamer-0.10/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="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstSegment.html#GstSegment"><span class="type">GstSegment</span></a> and any <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GST-EVENT-NEWSEGMENT:CAPS"><span class="type">GST_EVENT_NEWSEGMENT</span></a>
events. The default format for <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> is <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstFormat.html#GST-FORMAT-BYTES:CAPS"><span class="type">GST_FORMAT_BYTES</span></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" type="disc">
<li class="listitem"><p>The format is set to <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstFormat.html#GST-FORMAT-BYTES:CAPS"><span class="type">GST_FORMAT_BYTES</span></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="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p></li>
</ul></div>
<p>
</p>
<p>
Since 0.10.9, any <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> can enable pull based scheduling at any time
by overriding <a class="link" href="GstBaseSrc.html#GstBaseSrcClass.check-get-range"><code class="function">GstBaseSrcClass.check_get_range()</code></a> so that it returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.
</p>
<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="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstFormat.html#GST-FORMAT-BYTES:CAPS"><span class="type">GST_FORMAT_BYTES</span></a>:
</p>
<div class="itemizedlist"><ul class="itemizedlist" 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="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.
</p></li>
<li class="listitem"><p>
<code class="function">GstBaseSrc:Class.query()</code> 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="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.
</p></li>
</ul></div>
<p>
</p>
<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="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#GST-STATE-CHANGE-NO-PREROLL:CAPS"><span class="type">GST_STATE_CHANGE_NO_PREROLL</span></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 since 0.10.12 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</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="symbol">(</span>GstMyElementClass <span class="symbol">*</span>klass<span class="symbol">)</span>
<span class="symbol">{</span>
GstElementClass <span class="symbol">*</span>gstelement_class <span class="symbol">=</span> <span class="function">GST_ELEMENT_CLASS</span> <span class="symbol">(</span>klass<span class="symbol">);</span>
<span class="gtkdoc slc">// srctemplate should be a <a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstPadTemplate.html#GstStaticPadTemplate">GstStaticPadTemplate</a> with direction</span>
<span class="gtkdoc slc">// <a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstPad.html#GST-PAD-SRC:CAPS">GST_PAD_SRC</a> and name "src"</span>
<span class="function"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-class-add-pad-template">gst_element_class_add_pad_template</a></span> <span class="symbol">(</span>gstelement_class<span class="symbol">,</span>
<span class="function"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstPadTemplate.html#gst-static-pad-template-get">gst_static_pad_template_get</a></span> <span class="symbol">(&</span>srctemplate<span class="symbol">));</span>
<span class="gtkdoc slc">// see <a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElementFactory.html#GstElementDetails">GstElementDetails</a></span>
<span class="function"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-class-set-details">gst_element_class_set_details</a></span> <span class="symbol">(</span>gstelement_class<span class="symbol">, &</span>details<span class="symbol">);</span>
<span class="symbol">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p>
</p>
<div class="refsect2" title="Controlled shutdown of live sources in applications">
<a name="id337902"></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.
</p>
<p>
Since GStreamer 0.10.16 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="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstMessage.html#GST-MESSAGE-SEGMENT-DONE:CAPS"><span class="type">GST_MESSAGE_SEGMENT_DONE</span></a> on the bus). This can typically be done
with the <a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#gst-element-send-event"><code class="function">gst_element_send_event()</code></a> function on the element or its parent bin.
</p>
<p>
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>
<p>
The old behaviour for controlled shutdown introduced since GStreamer 0.10.3
is still available but deprecated as it is dangerous and less flexible.
</p>
<p>
Last reviewed on 2007-12-19 (0.10.16)
</p>
</div>
</div>
<div class="refsect1" title="Details">
<a name="GstBaseSrc.details"></a><h2>Details</h2>
<div class="refsect2" title="GstBaseSrc">
<a name="GstBaseSrc-struct"></a><h3>GstBaseSrc</h3>
<pre class="programlisting">typedef struct _GstBaseSrc GstBaseSrc;</pre>
<p>
The opaque <a class="link" href="GstBaseSrc.html" title="GstBaseSrc"><span class="type">GstBaseSrc</span></a> data structure.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GstBaseSrcClass">
<a name="GstBaseSrcClass"></a><h3>GstBaseSrcClass</h3>
<pre class="programlisting">typedef struct {
GstElementClass parent_class;
/* virtual methods for subclasses */
/* get caps from subclass */
GstCaps* (*get_caps) (GstBaseSrc *src);
/* notify the subclass of new caps */
gboolean (*set_caps) (GstBaseSrc *src, GstCaps *caps);
/* decide on caps */
gboolean (*negotiate) (GstBaseSrc *src);
/* generate and send a newsegment (UNUSED) */
gboolean (*newsegment) (GstBaseSrc *src);
/* 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 bytes */
gboolean (*get_size) (GstBaseSrc *src, guint64 *size);
/* check if the resource is seekable */
gboolean (*is_seekable) (GstBaseSrc *src);
/* unlock any pending access to the resource. subclasses should unlock
* any function ASAP. */
gboolean (*unlock) (GstBaseSrc *src);
/* notify subclasses of an event */
gboolean (*event) (GstBaseSrc *src, GstEvent *event);
/* ask the subclass to create a buffer with offset and size */
GstFlowReturn (*create) (GstBaseSrc *src, guint64 offset, guint size,
GstBuffer **buf);
/* additions that change padding... */
/* notify subclasses of a seek */
gboolean (*do_seek) (GstBaseSrc *src, GstSegment *segment);
/* notify subclasses of a query */
gboolean (*query) (GstBaseSrc *src, GstQuery *query);
/* check whether the source would support pull-based operation if
* it were to be opened now. This vfunc is optional, but should be
* implemented if possible to avoid unnecessary start/stop cycles.
* The default implementation will open and close the resource to
* find out whether get_range is supported and that is usually
* undesirable. */
gboolean (*check_get_range) (GstBaseSrc *src);
/* called if, in negotiation, caps need fixating */
void (*fixate) (GstBaseSrc *src, GstCaps *caps);
/* Clear any pending unlock request, as we succeeded in unlocking */
gboolean (*unlock_stop) (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);
} GstBaseSrcClass;
</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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#GstElementClass"><span class="type">GstElementClass</span></a> <em class="structfield"><code><a name="GstBaseSrcClass.parent-class"></a>parent_class</code></em>;</span></p></td>
<td>Element parent class
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.get-caps"></a>get_caps</code></em> ()</span></p></td>
<td>Called to get the caps to report
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.set-caps"></a>set_caps</code></em> ()</span></p></td>
<td>Notify subclass of changed output caps
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.negotiate"></a>negotiate</code></em> ()</span></p></td>
<td>Negotiated the caps with the peer.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.newsegment"></a>newsegment</code></em> ()</span></p></td>
<td>Generate and send a new_segment event (UNUSED)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.start"></a>start</code></em> ()</span></p></td>
<td>Start processing. Subclasses should open resources and prepare
to produce data.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.stop"></a>stop</code></em> ()</span></p></td>
<td>Stop processing. Subclasses should use this to close resources.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.get-times"></a>get_times</code></em> ()</span></p></td>
<td>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.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.get-size"></a>get_size</code></em> ()</span></p></td>
<td>Return the total size of the resource, in the configured format.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.is-seekable"></a>is_seekable</code></em> ()</span></p></td>
<td>Check if the source can seek
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.unlock"></a>unlock</code></em> ()</span></p></td>
<td>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_WRONG_STATE. Any
future <code class="function">create()</code> function call should also return GST_FLOW_WRONG_STATE
until the <code class="function">unlock_stop()</code> function has been called.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.event"></a>event</code></em> ()</span></p></td>
<td>Override this to implement custom event handling.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.create"></a>create</code></em> ()</span></p></td>
<td>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_UNEXPECTED signifies that the
end of stream is reached.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.do-seek"></a>do_seek</code></em> ()</span></p></td>
<td>Perform seeking on the resource to the indicated segment.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.query"></a>query</code></em> ()</span></p></td>
<td>Handle a requested query.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.check-get-range"></a>check_get_range</code></em> ()</span></p></td>
<td>Check whether the source would support pull-based
operation if it were to be opened now. This vfunc is optional, but
should be implemented if possible to avoid unnecessary start/stop
cycles. The default implementation will open and close the resource
to find out whether get_range is supported, and that is usually
undesirable.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.fixate"></a>fixate</code></em> ()</span></p></td>
<td>Called during negotiation if caps need fixating. Implement instead of
setting a fixate function on the source pad.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.unlock-stop"></a>unlock_stop</code></em> ()</span></p></td>
<td>Clear the previous unlock request. Subclasses should clear
any state they set during <code class="function">unlock()</code>, such as clearing command queues.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="GstBaseSrcClass.prepare-seek-segment"></a>prepare_seek_segment</code></em> ()</span></p></td>
<td>Prepare the GstSegment that will be passed to the
do_seek 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.
Since: 0.10.13
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum GstBaseSrcFlags">
<a name="GstBaseSrcFlags"></a><h3>enum GstBaseSrcFlags</h3>
<pre class="programlisting">typedef enum {
GST_BASE_SRC_STARTED = (GST_ELEMENT_FLAG_LAST << 0),
/* padding */
GST_BASE_SRC_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2)
} GstBaseSrcFlags;
</pre>
<p>
The <a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html"><span class="type">GstElement</span></a> flags that a basesrc element may have.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GST-BASE-SRC-STARTED:CAPS"></a><span class="term"><code class="literal">GST_BASE_SRC_STARTED</code></span></p></td>
<td>has source been started
</td>
</tr>
<tr>
<td><p><a name="GST-BASE-SRC-FLAG-LAST:CAPS"></a><span class="term"><code class="literal">GST_BASE_SRC_FLAG_LAST</code></span></p></td>
<td>offset to define more flags
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_base_src_wait_playing ()">
<a name="gst-base-src-wait-playing"></a><h3>gst_base_src_wait_playing ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/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="/usr/share/gtk-doc/html/gstreamer-0.10/GstPad.html#GST-FLOW-OK:CAPS"><span class="type">GST_FLOW_OK</span></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="/usr/share/gtk-doc/html/gstreamer-0.10/GstPad.html#GST-FLOW-WRONG-STATE:CAPS"><span class="type">GST_FLOW_WRONG_STATE</span></a>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>the src
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstPad.html#GST-FLOW-OK:CAPS"><span class="type">GST_FLOW_OK</span></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.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.10.12</p>
</div>
<hr>
<div class="refsect2" title="gst_base_src_is_live ()">
<a name="gst-base-src-is-live"></a><h3>gst_base_src_is_live ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>base source instance
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if element is in live mode.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_base_src_set_live ()">
<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="/usr/share/gtk-doc/html/glib/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="/usr/share/gtk-doc/html/glib/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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>base source instance
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>live</code></em> :</span></p></td>
<td>new live-mode
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_base_src_set_format ()">
<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="/usr/share/gtk-doc/html/gstreamer-0.10/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 NEW_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 <code class="function">GstBaseSrc.is_seekable()</code> returns TRUE.
</p>
<p>
This function must only be called in states < <a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstElement.html#GST-STATE-PAUSED:CAPS"><code class="literal">GST_STATE_PAUSED</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>base source instance
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>the format to use
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.10.1</p>
</div>
<hr>
<div class="refsect2" title="gst_base_src_query_latency ()">
<a name="gst-base-src-query-latency"></a><h3>gst_base_src_query_latency ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/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="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *live</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-0.10/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> *min_latency</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-0.10/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 TRUE when <em class="parameter"><code>src</code></em> is
configured as a live source. <em class="parameter"><code>min_latency</code></em> will be set to the difference
between the running time and the timestamp of the first buffer.
<em class="parameter"><code>max_latency</code></em> is always the undefined value of -1.
</p>
<p>
This function is mostly used by subclasses.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>the source
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>live</code></em> :</span></p></td>
<td>if the source is live
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>min_latency</code></em> :</span></p></td>
<td>the min latency of the source
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_latency</code></em> :</span></p></td>
<td>the max latency of the source
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> TRUE if the query succeeded.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.10.13</p>
</div>
<hr>
<div class="refsect2" title="gst_base_src_get_blocksize ()">
<a name="gst-base-src-get-blocksize"></a><h3>gst_base_src_get_blocksize ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"><span class="returnvalue">gulong</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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>the source
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the number of bytes pushed with each buffer.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.10.22</p>
</div>
<hr>
<div class="refsect2" title="gst_base_src_set_blocksize ()">
<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="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>the source
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>blocksize</code></em> :</span></p></td>
<td>the new blocksize in bytes
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.10.22</p>
</div>
<hr>
<div class="refsect2" title="gst_base_src_get_do_timestamp ()">
<a name="gst-base-src-get-do-timestamp"></a><h3>gst_base_src_get_do_timestamp ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>the source
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the base class will automatically timestamp outgoing buffers.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.10.15</p>
</div>
<hr>
<div class="refsect2" title="gst_base_src_set_do_timestamp ()">
<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="/usr/share/gtk-doc/html/glib/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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>the source
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>timestamp</code></em> :</span></p></td>
<td>enable or disable timestamping
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.10.15</p>
</div>
<hr>
<div class="refsect2" title="gst_base_src_new_seamless_segment ()">
<a name="gst-base-src-new-seamless-segment"></a><h3>gst_base_src_new_seamless_segment ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/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><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> start</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> stop</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> position</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="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>The source
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>start</code></em> :</span></p></td>
<td>The new start value for the segment
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>stop</code></em> :</span></p></td>
<td>Stop value for the new segment
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
<td>The position value for the new segent
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if preparation of the seamless segment succeeded.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.10.26</p>
</div>
<hr>
<div class="refsect2" title="GST_BASE_SRC_PAD()">
<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="/usr/share/gtk-doc/html/gstreamer-0.10/GstPad.html"><span class="type">GstPad</span></a> object of the element.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>obj</code></em> :</span></p></td>
<td>base source instance
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="GstBaseSrc.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "blocksize" property'>
<a name="GstBaseSrc--blocksize"></a><h3>The <code class="literal">"blocksize"</code> property</h3>
<pre class="programlisting"> "blocksize" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gulong"><span class="type">gulong</span></a> : Read / Write</pre>
<p>Size in bytes to read per buffer (-1 = default).</p>
</div>
<hr>
<div class="refsect2" title='The "do-timestamp" property'>
<a name="GstBaseSrc--do-timestamp"></a><h3>The <code class="literal">"do-timestamp"</code> property</h3>
<pre class="programlisting"> "do-timestamp" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
<p>Apply current stream time to buffers.</p>
<p>Default value: FALSE</p>
</div>
<hr>
<div class="refsect2" title='The "num-buffers" property'>
<a name="GstBaseSrc--num-buffers"></a><h3>The <code class="literal">"num-buffers"</code> property</h3>
<pre class="programlisting"> "num-buffers" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> : Read / Write</pre>
<p>Number of buffers to output before sending EOS (-1 = unlimited).</p>
<p>Allowed values: >= G_MAXULONG</p>
<p>Default value: -1</p>
</div>
<hr>
<div class="refsect2" title='The "typefind" property'>
<a name="GstBaseSrc--typefind"></a><h3>The <code class="literal">"typefind"</code> property</h3>
<pre class="programlisting"> "typefind" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
<p>Run typefind before negotiating.</p>
<p>Default value: FALSE</p>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="GstBaseSrc.see-also"></a><h2>See Also</h2>
<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>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.15</div>
</body>
</html>
|