/usr/share/doc/gstreamer1.0-doc/gstreamer-1.0/GstSegment.html is in gstreamer1.0-doc 1.8.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 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 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GstSegment: 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="GstRegistry.html" title="GstRegistry">
<link rel="next" href="GstStructure.html" title="GstStructure">
<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#GstSegment.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#GstSegment.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="GstRegistry.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GstStructure.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GstSegment"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GstSegment.top_of_page"></a>GstSegment</span></h2>
<p>GstSegment — Structure describing the configured region of interest
in a media file.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GstSegment.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">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-clip" title="gst_segment_clip ()">gst_segment_clip</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="GstSegment.html#gst-segment-init" title="gst_segment_init ()">gst_segment_init</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstSegment.html" title="GstSegment"><span class="returnvalue">GstSegment</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-new" title="gst_segment_new ()">gst_segment_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstSegment.html" title="GstSegment"><span class="returnvalue">GstSegment</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-copy" title="gst_segment_copy ()">gst_segment_copy</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="GstSegment.html#gst-segment-free" title="gst_segment_free ()">gst_segment_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-do-seek" title="gst_segment_do_seek ()">gst_segment_do_seek</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-position-from-stream-time" title="gst_segment_position_from_stream_time ()">gst_segment_position_from_stream_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-position-from-stream-time-full" title="gst_segment_position_from_stream_time_full ()">gst_segment_position_from_stream_time_full</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-to-running-time" title="gst_segment_to_running_time ()">gst_segment_to_running_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-to-running-time-full" title="gst_segment_to_running_time_full ()">gst_segment_to_running_time_full</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-to-stream-time" title="gst_segment_to_stream_time ()">gst_segment_to_stream_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-to-stream-time-full" title="gst_segment_to_stream_time_full ()">gst_segment_to_stream_time_full</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-position-from-running-time" title="gst_segment_position_from_running_time ()">gst_segment_position_from_running_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-position-from-running-time-full" title="gst_segment_position_from_running_time_full ()">gst_segment_position_from_running_time_full</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-to-position" title="gst_segment_to_position ()">gst_segment_to_position</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-set-running-time" title="gst_segment_set_running_time ()">gst_segment_set_running_time</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="GstSegment.html#gst-segment-copy-into" title="gst_segment_copy_into ()">gst_segment_copy_into</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-offset-running-time" title="gst_segment_offset_running_time ()">gst_segment_offset_running_time</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GstSegment.html#gst-segment-is-equal" title="gst_segment_is_equal ()">gst_segment_is_equal</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstSegment.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">struct</td>
<td class="function_name"><a class="link" href="GstSegment.html#GstSegment-struct" title="struct GstSegment">GstSegment</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GstSegment.html#GstSegmentFlags" title="enum GstSegmentFlags">GstSegmentFlags</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstSegment.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> GstSegment
</pre>
</div>
<div class="refsect1">
<a name="GstSegment.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <gst/gst.h>
</pre>
</div>
<div class="refsect1">
<a name="GstSegment.description"></a><h2>Description</h2>
<p>This helper structure holds the relevant values for tracking the region of
interest in a media file, called a segment.</p>
<p>The structure can be used for two purposes:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>performing seeks (handling seek events)</p></li>
<li class="listitem"><p>tracking playback regions (handling newsegment events)</p></li>
</ul></div>
<p>The segment is usually configured by the application with a seek event which
is propagated upstream and eventually handled by an element that performs the seek.</p>
<p>The configured segment is then propagated back downstream with a newsegment event.
This information is then used to clip media to the segment boundaries.</p>
<p>A segment structure is initialized with <a class="link" href="GstSegment.html#gst-segment-init" title="gst_segment_init ()"><code class="function">gst_segment_init()</code></a>, which takes a <a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a>
that will be used as the format of the segment values. The segment will be configured
with a start value of 0 and a stop/duration of -1, which is undefined. The default
rate and applied_rate is 1.0.</p>
<p>The public duration field contains the duration of the segment. When using
the segment for seeking, the start and time members should normally be left
to their default 0 value. The stop position is left to -1 unless explicitly
configured to a different value after a seek event.</p>
<p>The current position in the segment should be set by changing the position
member in the structure.</p>
<p>For elements that perform seeks, the current segment should be updated with the
<a class="link" href="GstSegment.html#gst-segment-do-seek" title="gst_segment_do_seek ()"><code class="function">gst_segment_do_seek()</code></a> and the values from the seek event. This method will update
all the segment fields. The position field will contain the new playback position.
If the start_type was different from GST_SEEK_TYPE_NONE, playback continues from
the position position, possibly with updated flags or rate.</p>
<p>For elements that want to use <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> to track the playback region,
update the segment fields with the information from the newsegment event.
The <a class="link" href="GstSegment.html#gst-segment-clip" title="gst_segment_clip ()"><code class="function">gst_segment_clip()</code></a> method can be used to check and clip
the media data to the segment boundaries.</p>
<p>For elements that want to synchronize to the pipeline clock, <a class="link" href="GstSegment.html#gst-segment-to-running-time" title="gst_segment_to_running_time ()"><code class="function">gst_segment_to_running_time()</code></a>
can be used to convert a timestamp to a value that can be used to synchronize
to the clock. This function takes into account the base as well as
any rate or applied_rate conversions.</p>
<p>For elements that need to perform operations on media data in stream_time,
<a class="link" href="GstSegment.html#gst-segment-to-stream-time" title="gst_segment_to_stream_time ()"><code class="function">gst_segment_to_stream_time()</code></a> can be used to convert a timestamp and the segment
info to stream time (which is always between 0 and the duration of the stream).</p>
</div>
<div class="refsect1">
<a name="GstSegment.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gst-segment-clip"></a><h3>gst_segment_clip ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_segment_clip (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> start</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> stop</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *clip_start</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *clip_stop</code></em>);</pre>
<p>Clip the given <em class="parameter"><code>start</code></em>
and <em class="parameter"><code>stop</code></em>
values to the segment boundaries given
in <em class="parameter"><code>segment</code></em>
. <em class="parameter"><code>start</code></em>
and <em class="parameter"><code>stop</code></em>
are compared and clipped to <em class="parameter"><code>segment</code></em>
start and stop values.</p>
<p>If the function returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, <em class="parameter"><code>start</code></em>
and <em class="parameter"><code>stop</code></em>
are known to fall
outside of <em class="parameter"><code>segment</code></em>
and <em class="parameter"><code>clip_start</code></em>
and <em class="parameter"><code>clip_stop</code></em>
are not updated.</p>
<p>When the function returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, <em class="parameter"><code>clip_start</code></em>
and <em class="parameter"><code>clip_stop</code></em>
will be
updated. If <em class="parameter"><code>clip_start</code></em>
or <em class="parameter"><code>clip_stop</code></em>
are different from <em class="parameter"><code>start</code></em>
or <em class="parameter"><code>stop</code></em>
respectively, the region fell partially in the segment.</p>
<p>Note that when <em class="parameter"><code>stop</code></em>
is -1, <em class="parameter"><code>clip_stop</code></em>
will be set to the end of the
segment. Depending on the use case, this may or may not be what you want.</p>
<div class="refsect3">
<a name="id-1.3.45.8.2.8"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start</p></td>
<td class="parameter_description"><p>the start position in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stop</p></td>
<td class="parameter_description"><p>the stop position in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>clip_start</p></td>
<td class="parameter_description"><p> the clipped start position in the segment. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>clip_stop</p></td>
<td class="parameter_description"><p> the clipped stop position in the segment. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.2.9"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the given <em class="parameter"><code>start</code></em>
and <em class="parameter"><code>stop</code></em>
times fall partially or
completely in <em class="parameter"><code>segment</code></em>
, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the values are completely outside
of the segment.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-init"></a><h3>gst_segment_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_segment_init (<em class="parameter"><code><a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>);</pre>
<p>The start/position fields are set to 0 and the stop/duration
fields are set to -1 (unknown). The default rate of 1.0 and no
flags are set.</p>
<p>Initialize <em class="parameter"><code>segment</code></em>
to its default values.</p>
<div class="refsect3">
<a name="id-1.3.45.8.3.6"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-new"></a><h3>gst_segment_new ()</h3>
<pre class="programlisting"><a class="link" href="GstSegment.html" title="GstSegment"><span class="returnvalue">GstSegment</span></a> *
gst_segment_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Allocate a new <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure and initialize it using
<a class="link" href="GstSegment.html#gst-segment-init" title="gst_segment_init ()"><code class="function">gst_segment_init()</code></a>.</p>
<p>Free-function: gst_segment_free</p>
<div class="refsect3">
<a name="id-1.3.45.8.4.6"></a><h4>Returns</h4>
<p> a new <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a>, free with <a class="link" href="GstSegment.html#gst-segment-free" title="gst_segment_free ()"><code class="function">gst_segment_free()</code></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-copy"></a><h3>gst_segment_copy ()</h3>
<pre class="programlisting"><a class="link" href="GstSegment.html" title="GstSegment"><span class="returnvalue">GstSegment</span></a> *
gst_segment_copy (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>);</pre>
<p>Create a copy of given <em class="parameter"><code>segment</code></em>
.</p>
<p>Free-function: gst_segment_free</p>
<div class="refsect3">
<a name="id-1.3.45.8.5.6"></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>segment</p></td>
<td class="parameter_description"><p> a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.5.7"></a><h4>Returns</h4>
<p> a new <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a>, free with <a class="link" href="GstSegment.html#gst-segment-free" title="gst_segment_free ()"><code class="function">gst_segment_free()</code></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-free"></a><h3>gst_segment_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_segment_free (<em class="parameter"><code><a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>);</pre>
<p>Free the allocated segment <em class="parameter"><code>segment</code></em>
.</p>
<div class="refsect3">
<a name="id-1.3.45.8.6.5"></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>segment</p></td>
<td class="parameter_description"><p> a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-do-seek"></a><h3>gst_segment_do_seek ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_segment_do_seek (<em class="parameter"><code><a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> rate</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a class="link" href="GstEvent.html#GstSeekFlags" title="enum GstSeekFlags"><span class="type">GstSeekFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="GstEvent.html#GstSeekType" title="enum GstSeekType"><span class="type">GstSeekType</span></a> start_type</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> start</code></em>,
<em class="parameter"><code><a class="link" href="GstEvent.html#GstSeekType" title="enum GstSeekType"><span class="type">GstSeekType</span></a> stop_type</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> stop</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> *update</code></em>);</pre>
<p>Update the segment structure with the field values of a seek event (see
<a class="link" href="GstEvent.html#gst-event-new-seek" title="gst_event_new_seek ()"><code class="function">gst_event_new_seek()</code></a>).</p>
<p>After calling this method, the segment field position and time will
contain the requested new position in the segment. The new requested
position in the segment depends on <em class="parameter"><code>rate</code></em>
and <em class="parameter"><code>start_type</code></em>
and <em class="parameter"><code>stop_type</code></em>
.</p>
<p>For positive <em class="parameter"><code>rate</code></em>
, the new position in the segment is the new <em class="parameter"><code>segment</code></em>
start field when it was updated with a <em class="parameter"><code>start_type</code></em>
different from
<a class="link" href="GstEvent.html#GST-SEEK-TYPE-NONE:CAPS"><span class="type">GST_SEEK_TYPE_NONE</span></a>. If no update was performed on <em class="parameter"><code>segment</code></em>
start position
(<a class="link" href="GstEvent.html#GST-SEEK-TYPE-NONE:CAPS"><span class="type">GST_SEEK_TYPE_NONE</span></a>), <em class="parameter"><code>start</code></em>
is ignored and <em class="parameter"><code>segment</code></em>
position is
unmodified.</p>
<p>For negative <em class="parameter"><code>rate</code></em>
, the new position in the segment is the new <em class="parameter"><code>segment</code></em>
stop field when it was updated with a <em class="parameter"><code>stop_type</code></em>
different from
<a class="link" href="GstEvent.html#GST-SEEK-TYPE-NONE:CAPS"><span class="type">GST_SEEK_TYPE_NONE</span></a>. If no stop was previously configured in the segment, the
duration of the segment will be used to update the stop position.
If no update was performed on <em class="parameter"><code>segment</code></em>
stop position (<a class="link" href="GstEvent.html#GST-SEEK-TYPE-NONE:CAPS"><span class="type">GST_SEEK_TYPE_NONE</span></a>),
<em class="parameter"><code>stop</code></em>
is ignored and <em class="parameter"><code>segment</code></em>
position is unmodified.</p>
<p>The applied rate of the segment will be set to 1.0 by default.
If the caller can apply a rate change, it should update <em class="parameter"><code>segment</code></em>
rate and applied_rate after calling this function.</p>
<p><em class="parameter"><code>update</code></em>
will be set to <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if a seek should be performed to the segment
position field. This field can be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if, for example, only the <em class="parameter"><code>rate</code></em>
has been changed but not the playback position.</p>
<div class="refsect3">
<a name="id-1.3.45.8.7.10"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rate</p></td>
<td class="parameter_description"><p>the rate of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>the segment flags for the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start_type</p></td>
<td class="parameter_description"><p>the seek method</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start</p></td>
<td class="parameter_description"><p>the seek start value</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stop_type</p></td>
<td class="parameter_description"><p>the seek method</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stop</p></td>
<td class="parameter_description"><p>the seek stop value</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>update</p></td>
<td class="parameter_description"><p>boolean holding whether position was updated.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.7.11"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the seek could be performed.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-position-from-stream-time"></a><h3>gst_segment_position_from_stream_time ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
gst_segment_position_from_stream_time (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> stream_time</code></em>);</pre>
<p>Convert <em class="parameter"><code>stream_time</code></em>
into a position in the segment so that
<a class="link" href="GstSegment.html#gst-segment-to-stream-time" title="gst_segment_to_stream_time ()"><code class="function">gst_segment_to_stream_time()</code></a> with that position returns <em class="parameter"><code>stream_time</code></em>
.</p>
<div class="refsect3">
<a name="id-1.3.45.8.8.5"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stream_time</p></td>
<td class="parameter_description"><p>the stream_time in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.8.6"></a><h4>Returns</h4>
<p> the position in the segment for <em class="parameter"><code>stream_time</code></em>
. This function returns
-1 when <em class="parameter"><code>stream_time</code></em>
is -1 or when it is not inside <em class="parameter"><code>segment</code></em>
.</p>
</div>
<p class="since">Since: 1.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-position-from-stream-time-full"></a><h3>gst_segment_position_from_stream_time_full ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gst_segment_position_from_stream_time_full
(<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> stream_time</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *position</code></em>);</pre>
<p>Translate <em class="parameter"><code>stream_time</code></em>
to the segment position using the currently configured
segment. Compared to <a class="link" href="GstSegment.html#gst-segment-position-from-stream-time" title="gst_segment_position_from_stream_time ()"><code class="function">gst_segment_position_from_stream_time()</code></a> this function can
return negative segment position.</p>
<p>This function is typically used by elements that need to synchronize buffers
against the clock or each other.</p>
<p><em class="parameter"><code>stream_time</code></em>
can be any value and the result of this function for values outside
of the segment is extrapolated.</p>
<p>When 1 is returned, <em class="parameter"><code>stream_time</code></em>
resulted in a positive position returned
in <em class="parameter"><code>position</code></em>
.</p>
<p>When this function returns -1, the returned <em class="parameter"><code>position</code></em>
should be negated
to get the real negative segment position.</p>
<div class="refsect3">
<a name="id-1.3.45.8.9.9"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stream_time</p></td>
<td class="parameter_description"><p>the stream-time</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>the resulting position in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.9.10"></a><h4>Returns</h4>
<p> a 1 or -1 on success, 0 on failure.</p>
</div>
<p class="since">Since: 1.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-to-running-time"></a><h3>gst_segment_to_running_time ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
gst_segment_to_running_time (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> position</code></em>);</pre>
<p>Translate <em class="parameter"><code>position</code></em>
to the total running time using the currently configured
segment. Position is a value between <em class="parameter"><code>segment</code></em>
start and stop time.</p>
<p>This function is typically used by elements that need to synchronize to the
global clock in a pipeline. The running time is a constantly increasing value
starting from 0. When <a class="link" href="GstSegment.html#gst-segment-init" title="gst_segment_init ()"><code class="function">gst_segment_init()</code></a> is called, this value will reset to
0.</p>
<p>This function returns -1 if the position is outside of <em class="parameter"><code>segment</code></em>
start and stop.</p>
<div class="refsect3">
<a name="id-1.3.45.8.10.7"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>the position in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.10.8"></a><h4>Returns</h4>
<p> the position as the total running time or -1 when an invalid position
was given.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-to-running-time-full"></a><h3>gst_segment_to_running_time_full ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gst_segment_to_running_time_full (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> position</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *running_time</code></em>);</pre>
<p>Translate <em class="parameter"><code>position</code></em>
to the total running time using the currently configured
segment. Compared to <a class="link" href="GstSegment.html#gst-segment-to-running-time" title="gst_segment_to_running_time ()"><code class="function">gst_segment_to_running_time()</code></a> this function can return
negative running-time.</p>
<p>This function is typically used by elements that need to synchronize buffers
against the clock or eachother.</p>
<p><em class="parameter"><code>position</code></em>
can be any value and the result of this function for values outside
of the segment is extrapolated.</p>
<p>When 1 is returned, <em class="parameter"><code>position</code></em>
resulted in a positive running-time returned
in <em class="parameter"><code>running_time</code></em>
.</p>
<p>When this function returns -1, the returned <em class="parameter"><code>running_time</code></em>
should be negated
to get the real negative running time.</p>
<div class="refsect3">
<a name="id-1.3.45.8.11.9"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>the position in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>running_time</p></td>
<td class="parameter_description"><p>result running-time</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.11.10"></a><h4>Returns</h4>
<p> a 1 or -1 on success, 0 on failure.</p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.6">1.6</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-to-stream-time"></a><h3>gst_segment_to_stream_time ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
gst_segment_to_stream_time (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> position</code></em>);</pre>
<p>Translate <em class="parameter"><code>position</code></em>
to stream time using the currently configured
segment. The <em class="parameter"><code>position</code></em>
value must be between <em class="parameter"><code>segment</code></em>
start and
stop value.</p>
<p>This function is typically used by elements that need to operate on
the stream time of the buffers it receives, such as effect plugins.
In those use cases, <em class="parameter"><code>position</code></em>
is typically the buffer timestamp or
clock time that one wants to convert to the stream time.
The stream time is always between 0 and the total duration of the
media stream.</p>
<div class="refsect3">
<a name="id-1.3.45.8.12.6"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>the position in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.12.7"></a><h4>Returns</h4>
<p> the position in stream_time or -1 when an invalid position
was given.</p>
</div>
<p class="since">Since: 1.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-to-stream-time-full"></a><h3>gst_segment_to_stream_time_full ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gst_segment_to_stream_time_full (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> position</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *stream_time</code></em>);</pre>
<p>Translate <em class="parameter"><code>position</code></em>
to the total stream time using the currently configured
segment. Compared to <a class="link" href="GstSegment.html#gst-segment-to-stream-time" title="gst_segment_to_stream_time ()"><code class="function">gst_segment_to_stream_time()</code></a> this function can return
negative stream-time.</p>
<p>This function is typically used by elements that need to synchronize buffers
against the clock or eachother.</p>
<p><em class="parameter"><code>position</code></em>
can be any value and the result of this function for values outside
of the segment is extrapolated.</p>
<p>When 1 is returned, <em class="parameter"><code>position</code></em>
resulted in a positive stream-time returned
in <em class="parameter"><code>stream_time</code></em>
.</p>
<p>When this function returns -1, the returned <em class="parameter"><code>stream_time</code></em>
should be negated
to get the real negative stream time.</p>
<div class="refsect3">
<a name="id-1.3.45.8.13.9"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>the position in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stream_time</p></td>
<td class="parameter_description"><p>result stream-time</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.13.10"></a><h4>Returns</h4>
<p> a 1 or -1 on success, 0 on failure.</p>
</div>
<p class="since">Since: 1.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-position-from-running-time"></a><h3>gst_segment_position_from_running_time ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
gst_segment_position_from_running_time
(<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> running_time</code></em>);</pre>
<p>Convert <em class="parameter"><code>running_time</code></em>
into a position in the segment so that
<a class="link" href="GstSegment.html#gst-segment-to-running-time" title="gst_segment_to_running_time ()"><code class="function">gst_segment_to_running_time()</code></a> with that position returns <em class="parameter"><code>running_time</code></em>
.</p>
<div class="refsect3">
<a name="id-1.3.45.8.14.5"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>running_time</p></td>
<td class="parameter_description"><p>the running_time in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.14.6"></a><h4>Returns</h4>
<p> the position in the segment for <em class="parameter"><code>running_time</code></em>
. This function returns
-1 when <em class="parameter"><code>running_time</code></em>
is -1 or when it is not inside <em class="parameter"><code>segment</code></em>
.</p>
</div>
<p class="since">Since: 1.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-position-from-running-time-full"></a><h3>gst_segment_position_from_running_time_full ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gst_segment_position_from_running_time_full
(<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> running_time</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *position</code></em>);</pre>
<p>Translate <em class="parameter"><code>running_time</code></em>
to the segment position using the currently configured
segment. Compared to <a class="link" href="GstSegment.html#gst-segment-position-from-running-time" title="gst_segment_position_from_running_time ()"><code class="function">gst_segment_position_from_running_time()</code></a> this function can
return negative segment position.</p>
<p>This function is typically used by elements that need to synchronize buffers
against the clock or each other.</p>
<p><em class="parameter"><code>running_time</code></em>
can be any value and the result of this function for values
outside of the segment is extrapolated.</p>
<p>When 1 is returned, <em class="parameter"><code>running_time</code></em>
resulted in a positive position returned
in <em class="parameter"><code>position</code></em>
.</p>
<p>When this function returns -1, the returned <em class="parameter"><code>position</code></em>
should be negated
to get the real negative segment position.</p>
<div class="refsect3">
<a name="id-1.3.45.8.15.9"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>running_time</p></td>
<td class="parameter_description"><p>the running-time</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>position</p></td>
<td class="parameter_description"><p>the resulting position in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.15.10"></a><h4>Returns</h4>
<p> a 1 or -1 on success, 0 on failure.</p>
</div>
<p class="since">Since: 1.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-to-position"></a><h3>gst_segment_to_position ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
gst_segment_to_position (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> running_time</code></em>);</pre>
<div class="warning"><p><code class="literal">gst_segment_to_position</code> is deprecated and should not be used in newly-written code.</p></div>
<p>Convert <em class="parameter"><code>running_time</code></em>
into a position in the segment so that
<a class="link" href="GstSegment.html#gst-segment-to-running-time" title="gst_segment_to_running_time ()"><code class="function">gst_segment_to_running_time()</code></a> with that position returns <em class="parameter"><code>running_time</code></em>
.</p>
<div class="refsect3">
<a name="id-1.3.45.8.16.6"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>running_time</p></td>
<td class="parameter_description"><p>the running_time in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.16.7"></a><h4>Returns</h4>
<p> the position in the segment for <em class="parameter"><code>running_time</code></em>
. This function returns
-1 when <em class="parameter"><code>running_time</code></em>
is -1 or when it is not inside <em class="parameter"><code>segment</code></em>
.</p>
<p>Deprecated. Use <a class="link" href="GstSegment.html#gst-segment-position-from-running-time" title="gst_segment_position_from_running_time ()"><code class="function">gst_segment_position_from_running_time()</code></a> instead.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-set-running-time"></a><h3>gst_segment_set_running_time ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_segment_set_running_time (<em class="parameter"><code><a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> running_time</code></em>);</pre>
<p>Adjust the start/stop and base values of <em class="parameter"><code>segment</code></em>
such that the next valid
buffer will be one with <em class="parameter"><code>running_time</code></em>
.</p>
<div class="refsect3">
<a name="id-1.3.45.8.17.5"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>running_time</p></td>
<td class="parameter_description"><p>the running_time in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.17.6"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the segment could be updated successfully. If <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is
returned, <em class="parameter"><code>running_time</code></em>
is -1 or not in <em class="parameter"><code>segment</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-copy-into"></a><h3>gst_segment_copy_into ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_segment_copy_into (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *src</code></em>,
<em class="parameter"><code><a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *dest</code></em>);</pre>
<p>Copy the contents of <em class="parameter"><code>src</code></em>
into <em class="parameter"><code>dest</code></em>
.</p>
<div class="refsect3">
<a name="id-1.3.45.8.18.5"></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>src</p></td>
<td class="parameter_description"><p> a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>dest</p></td>
<td class="parameter_description"><p> a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-offset-running-time"></a><h3>gst_segment_offset_running_time ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_segment_offset_running_time (<em class="parameter"><code><a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *segment</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> format</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> offset</code></em>);</pre>
<p>Adjust the values in <em class="parameter"><code>segment</code></em>
so that <em class="parameter"><code>offset</code></em>
is applied to all
future running-time calculations.</p>
<div class="refsect3">
<a name="id-1.3.45.8.19.5"></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>segment</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format of the segment.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>the offset to apply in the segment</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.19.6"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the segment could be updated successfully. If <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is
returned, <em class="parameter"><code>offset</code></em>
is not in <em class="parameter"><code>segment</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="ix05.html#api-index-1.2.3">1.2.3</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gst-segment-is-equal"></a><h3>gst_segment_is_equal ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_segment_is_equal (<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *s0</code></em>,
<em class="parameter"><code>const <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> *s1</code></em>);</pre>
<p>Checks for two segments being equal. Equality here is defined
as perfect equality, including floating point values.</p>
<div class="refsect3">
<a name="id-1.3.45.8.20.5"></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>s0</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>s1</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstSegment.html" title="GstSegment"><span class="type">GstSegment</span></a> structure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.45.8.20.6"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the segments are equal, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.6">1.6</a></p>
</div>
</div>
<div class="refsect1">
<a name="GstSegment.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GstSegment-struct"></a><h3>struct GstSegment</h3>
<pre class="programlisting">struct GstSegment {
GstSegmentFlags flags;
gdouble rate;
gdouble applied_rate;
GstFormat format;
guint64 base;
guint64 offset;
guint64 start;
guint64 stop;
guint64 time;
guint64 position;
guint64 duration;
};
</pre>
<p>A helper structure that holds the configured region of
interest in a media file.</p>
<div class="refsect3">
<a name="id-1.3.45.9.2.5"></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="GstSegment.html#GstSegmentFlags" title="enum GstSegmentFlags"><span class="type">GstSegmentFlags</span></a> <em class="structfield"><code><a name="GstSegment-struct.flags"></a>flags</code></em>;</p></td>
<td class="struct_member_description"><p>flags for this segment</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> <em class="structfield"><code><a name="GstSegment-struct.rate"></a>rate</code></em>;</p></td>
<td class="struct_member_description"><p>the playback rate of the segment</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> <em class="structfield"><code><a name="GstSegment-struct.applied-rate"></a>applied_rate</code></em>;</p></td>
<td class="struct_member_description"><p>the already applied rate to the segment</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="gstreamer-GstFormat.html#GstFormat" title="enum GstFormat"><span class="type">GstFormat</span></a> <em class="structfield"><code><a name="GstSegment-struct.format"></a>format</code></em>;</p></td>
<td class="struct_member_description"><p>the format of the segment values</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstSegment-struct.base"></a>base</code></em>;</p></td>
<td class="struct_member_description"><p>the running time (plus elapsed time, see offset) of the segment start</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstSegment-struct.offset"></a>offset</code></em>;</p></td>
<td class="struct_member_description"><p>the amount (in buffer timestamps) that has already been elapsed in
the segment</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstSegment-struct.start"></a>start</code></em>;</p></td>
<td class="struct_member_description"><p>the start of the segment in buffer timestamp time (PTS)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstSegment-struct.stop"></a>stop</code></em>;</p></td>
<td class="struct_member_description"><p>the stop of the segment in buffer timestamp time (PTS)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstSegment-struct.time"></a>time</code></em>;</p></td>
<td class="struct_member_description"><p>the stream time of the segment start</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstSegment-struct.position"></a>position</code></em>;</p></td>
<td class="struct_member_description"><p>the buffer timestamp position in the segment (used internally by
elements such as sources, demuxers or parsers to track progress)</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstSegment-struct.duration"></a>duration</code></em>;</p></td>
<td class="struct_member_description"><p>the duration of the segment</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstSegmentFlags"></a><h3>enum GstSegmentFlags</h3>
<p>Flags for the GstSegment structure. Currently mapped to the corresponding
values of the seek flags.</p>
<div class="refsect3">
<a name="id-1.3.45.9.3.4"></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-SEGMENT-FLAG-NONE:CAPS"></a>GST_SEGMENT_FLAG_NONE</p></td>
<td class="enum_member_description">
<p>no flags</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-SEGMENT-FLAG-RESET:CAPS"></a>GST_SEGMENT_FLAG_RESET</p></td>
<td class="enum_member_description">
<p>reset the pipeline running_time to the segment
running_time</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-SEGMENT-FLAG-TRICKMODE:CAPS"></a>GST_SEGMENT_FLAG_TRICKMODE</p></td>
<td class="enum_member_description">
<p>perform skip playback (Since 1.6)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-SEGMENT-FLAG-SKIP:CAPS"></a>GST_SEGMENT_FLAG_SKIP</p></td>
<td class="enum_member_description">
<p>Deprecated backward compatibility flag, replaced
by <em class="parameter"><code>GST_SEGMENT_FLAG_TRICKMODE</code></em>
</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-SEGMENT-FLAG-SEGMENT:CAPS"></a>GST_SEGMENT_FLAG_SEGMENT</p></td>
<td class="enum_member_description">
<p>send SEGMENT_DONE instead of EOS</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-SEGMENT-FLAG-TRICKMODE-KEY-UNITS:CAPS"></a>GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS</p></td>
<td class="enum_member_description">
<p>Decode only keyframes, where
possible (Since 1.6)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-SEGMENT-FLAG-TRICKMODE-NO-AUDIO:CAPS"></a>GST_SEGMENT_FLAG_TRICKMODE_NO_AUDIO</p></td>
<td class="enum_member_description">
<p>Do not decode any audio, where
possible (Since 1.6)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GstSegment.see-also"></a><h2>See Also</h2>
<p><a class="link" href="GstEvent.html" title="GstEvent"><span class="type">GstEvent</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.24</div>
</body>
</html>
|