This file is indexed.

/usr/share/doc/gstreamer1.0-doc/gstreamer-1.0/GstTask.html is in gstreamer1.0-doc 1.10.4-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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GstTask: 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="GstTagSetter.html" title="GstTagSetter">
<link rel="next" href="GstTaskPool.html" title="GstTaskPool">
<meta name="generator" content="GTK-Doc V1.25 (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="#GstTask.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GstTask.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="GstTagSetter.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GstTaskPool.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GstTask"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GstTask.top_of_page"></a>GstTask</span></h2>
<p>GstTask — Abstraction of GStreamer streaming threads.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GstTask.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()">*GstTaskFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstTask.html#GST-TASK-BROADCAST:CAPS" title="GST_TASK_BROADCAST()">GST_TASK_BROADCAST</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstTask.html#GST-TASK-GET-COND:CAPS" title="GST_TASK_GET_COND()">GST_TASK_GET_COND</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstTask.html#GST-TASK-GET-LOCK:CAPS" title="GST_TASK_GET_LOCK()">GST_TASK_GET_LOCK</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstTask.html#GST-TASK-SIGNAL:CAPS" title="GST_TASK_SIGNAL()">GST_TASK_SIGNAL</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstTask.html#GST-TASK-STATE:CAPS" title="GST_TASK_STATE()">GST_TASK_STATE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="GstTask.html#GST-TASK-WAIT:CAPS" title="GST_TASK_WAIT()">GST_TASK_WAIT</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstTask.html" title="GstTask"><span class="returnvalue">GstTask</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstTask.html#gst-task-new" title="gst_task_new ()">gst_task_new</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="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()">gst_task_set_lock</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="GstTask.html#gst-task-set-pool" title="gst_task_set_pool ()">gst_task_set_pool</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="returnvalue">GstTaskPool</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstTask.html#gst-task-get-pool" title="gst_task_get_pool ()">gst_task_get_pool</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()">*GstTaskThreadFunc</a><span class="c_punctuation">)</span> <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="GstTask.html#gst-task-set-enter-callback" title="gst_task_set_enter_callback ()">gst_task_set_enter_callback</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="GstTask.html#gst-task-set-leave-callback" title="gst_task_set_leave_callback ()">gst_task_set_leave_callback</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="returnvalue">GstTaskState</span></a>
</td>
<td class="function_name">
<a class="link" href="GstTask.html#gst-task-get-state" title="gst_task_get_state ()">gst_task_get_state</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="GstTask.html#gst-task-set-state" title="gst_task_set_state ()">gst_task_set_state</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="GstTask.html#gst-task-pause" title="gst_task_pause ()">gst_task_pause</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="GstTask.html#gst-task-start" title="gst_task_start ()">gst_task_start</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="GstTask.html#gst-task-stop" title="gst_task_stop ()">gst_task_stop</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="GstTask.html#gst-task-join" title="gst_task_join ()">gst_task_join</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="GstTask.html#gst-task-cleanup-all" title="gst_task_cleanup_all ()">gst_task_cleanup_all</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstTask.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="GstTask.html#GstTask-struct" title="struct GstTask">GstTask</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState">GstTaskState</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstTask.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
    <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
        <span class="lineart">╰──</span> <a class="link" href="GstObject.html" title="GstObject">GstObject</a>
            <span class="lineart">╰──</span> GstTask
</pre>
</div>
<div class="refsect1">
<a name="GstTask.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gst/gst.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GstTask.description"></a><h2>Description</h2>
<p><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> is used by <a class="link" href="GstElement.html" title="GstElement"><span class="type">GstElement</span></a> and <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a> to provide the data passing
threads in a <a class="link" href="GstPipeline.html" title="GstPipeline"><span class="type">GstPipeline</span></a>.</p>
<p>A <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a> will typically start a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to push or pull data to/from the
peer pads. Most source elements start a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to push data. In some cases
a demuxer element can start a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to pull data from a peer element. This
is typically done when the demuxer can perform random access on the upstream
peer element for improved performance.</p>
<p>Although convenience functions exist on <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a> to start/pause/stop tasks, it
might sometimes be needed to create a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> manually if it is not related to
a <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a>.</p>
<p>Before the <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> can be run, it needs a <a href="/usr/share/gtk-doc/html/glib/glib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> that can be set with
<a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a>.</p>
<p>The task can be started, paused and stopped with <a class="link" href="GstTask.html#gst-task-start" title="gst_task_start ()"><code class="function">gst_task_start()</code></a>, <a class="link" href="GstTask.html#gst-task-pause" title="gst_task_pause ()"><code class="function">gst_task_pause()</code></a>
and <a class="link" href="GstTask.html#gst-task-stop" title="gst_task_stop ()"><code class="function">gst_task_stop()</code></a> respectively or with the <a class="link" href="GstTask.html#gst-task-set-state" title="gst_task_set_state ()"><code class="function">gst_task_set_state()</code></a> function.</p>
<p>A <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> will repeatedly call the <a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a> with the user data
that was provided when creating the task with <a class="link" href="GstTask.html#gst-task-new" title="gst_task_new ()"><code class="function">gst_task_new()</code></a>. While calling
the function it will acquire the provided lock. The provided lock is released
when the task pauses or stops.</p>
<p>Stopping a task with <a class="link" href="GstTask.html#gst-task-stop" title="gst_task_stop ()"><code class="function">gst_task_stop()</code></a> will not immediately make sure the task is
not running anymore. Use <a class="link" href="GstTask.html#gst-task-join" title="gst_task_join ()"><code class="function">gst_task_join()</code></a> to make sure the task is completely
stopped and the thread is stopped.</p>
<p>After creating a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a>, use <a class="link" href="GstObject.html#gst-object-unref" title="gst_object_unref ()"><code class="function">gst_object_unref()</code></a> to free its resources. This can
only be done when the task is not running anymore.</p>
<p>Task functions can send a <a class="link" href="GstMessage.html" title="GstMessage"><span class="type">GstMessage</span></a> to send out-of-band data to the
application. The application can receive messages from the <a class="link" href="GstBus.html" title="GstBus"><span class="type">GstBus</span></a> in its
mainloop.</p>
<p>For debugging purposes, the task will configure its object name as the thread
name on Linux. Please note that the object name should be configured before the
task is started; changing the object name after the task has been started, has
no effect on the thread name.</p>
</div>
<div class="refsect1">
<a name="GstTask.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="GstTaskFunction"></a><h3>GstTaskFunction ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GstTaskFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>A function that will repeatedly be called in the thread created by
a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a>.</p>
<div class="refsect3">
<a name="GstTaskFunction.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data passed to the function</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-TASK-BROADCAST:CAPS"></a><h3>GST_TASK_BROADCAST()</h3>
<pre class="programlisting">#define GST_TASK_BROADCAST(task)        g_cond_broadcast(GST_TASK_GET_COND (task))
</pre>
<p>Send a broadcast signal to all waiting task conds</p>
<div class="refsect3">
<a name="GST-TASK-BROADCAST.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>Task to broadcast</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-TASK-GET-COND:CAPS"></a><h3>GST_TASK_GET_COND()</h3>
<pre class="programlisting">#define GST_TASK_GET_COND(task)         (&amp;GST_TASK_CAST(task)-&gt;cond)
</pre>
<p>Get access to the cond of the task.</p>
<div class="refsect3">
<a name="GST-TASK-GET-COND.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>Task to get the cond of</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-TASK-GET-LOCK:CAPS"></a><h3>GST_TASK_GET_LOCK()</h3>
<pre class="programlisting">#define GST_TASK_GET_LOCK(task)         (GST_TASK_CAST(task)-&gt;lock)
</pre>
<p>Get access to the task lock.</p>
<div class="refsect3">
<a name="GST-TASK-GET-LOCK.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>Task to get the lock of</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-TASK-SIGNAL:CAPS"></a><h3>GST_TASK_SIGNAL()</h3>
<pre class="programlisting">#define GST_TASK_SIGNAL(task)           g_cond_signal(GST_TASK_GET_COND (task))
</pre>
<p>Signal the task cond</p>
<div class="refsect3">
<a name="GST-TASK-SIGNAL.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>Task to signal</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-TASK-STATE:CAPS"></a><h3>GST_TASK_STATE()</h3>
<pre class="programlisting">#define GST_TASK_STATE(task)            (GST_TASK_CAST(task)-&gt;state)
</pre>
<p>Get access to the state of the task.</p>
<div class="refsect3">
<a name="GST-TASK-STATE.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>Task to get the state of</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-TASK-WAIT:CAPS"></a><h3>GST_TASK_WAIT()</h3>
<pre class="programlisting">#define GST_TASK_WAIT(task)             g_cond_wait(GST_TASK_GET_COND (task), GST_OBJECT_GET_LOCK (task))
</pre>
<p>Wait for the task cond to be signalled</p>
<div class="refsect3">
<a name="GST-TASK-WAIT.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>Task to wait for</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-new"></a><h3>gst_task_new ()</h3>
<pre class="programlisting"><a class="link" href="GstTask.html" title="GstTask"><span class="returnvalue">GstTask</span></a> *
gst_task_new (<em class="parameter"><code><a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a> func</code></em>,
              <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
              <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre>
<p>Create a new Task that will repeatedly call the provided <em class="parameter"><code>func</code></em>

with <em class="parameter"><code>user_data</code></em>
 as a parameter. Typically the task will run in
a new thread.</p>
<p>The function cannot be changed after the task has been created. You
must create a new <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to change the function.</p>
<p>This function will not yet create and start a thread. Use <a class="link" href="GstTask.html#gst-task-start" title="gst_task_start ()"><code class="function">gst_task_start()</code></a> or
<a class="link" href="GstTask.html#gst-task-pause" title="gst_task_pause ()"><code class="function">gst_task_pause()</code></a> to create and start the GThread.</p>
<p>Before the task can be used, a <a href="/usr/share/gtk-doc/html/glib/glib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> must be configured using the
<a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a> function. This lock will always be acquired while
<em class="parameter"><code>func</code></em>
 is called.</p>
<div class="refsect3">
<a name="gst-task-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>User data to pass to <em class="parameter"><code>func</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>notify</p></td>
<td class="parameter_description"><p>the function to call when <em class="parameter"><code>user_data</code></em>
is no longer needed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-task-new.returns"></a><h4>Returns</h4>
<p> A new <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a>.</p>
<p>MT safe. </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-task-set-lock"></a><h3>gst_task_set_lock ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_task_set_lock (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>,
                   <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> *mutex</code></em>);</pre>
<p>Set the mutex used by the task. The mutex will be acquired before
calling the <a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a>.</p>
<p>This function has to be called before calling <a class="link" href="GstTask.html#gst-task-pause" title="gst_task_pause ()"><code class="function">gst_task_pause()</code></a> or
<a class="link" href="GstTask.html#gst-task-start" title="gst_task_start ()"><code class="function">gst_task_start()</code></a>.</p>
<p>MT safe.</p>
<div class="refsect3">
<a name="gst-task-set-lock.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mutex</p></td>
<td class="parameter_description"><p>The <a href="/usr/share/gtk-doc/html/glib/glib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-set-pool"></a><h3>gst_task_set_pool ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_task_set_pool (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>,
                   <em class="parameter"><code><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> *pool</code></em>);</pre>
<p>Set <em class="parameter"><code>pool</code></em>
 as the new GstTaskPool for <em class="parameter"><code>task</code></em>
. Any new streaming threads that
will be created by <em class="parameter"><code>task</code></em>
 will now use <em class="parameter"><code>pool</code></em>
.</p>
<p>MT safe.</p>
<div class="refsect3">
<a name="gst-task-set-pool.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pool</p></td>
<td class="parameter_description"><p> a <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</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-task-get-pool"></a><h3>gst_task_get_pool ()</h3>
<pre class="programlisting"><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="returnvalue">GstTaskPool</span></a> *
gst_task_get_pool (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre>
<p>Get the <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> that this task will use for its streaming
threads.</p>
<p>MT safe.</p>
<div class="refsect3">
<a name="gst-task-get-pool.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-task-get-pool.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> used by <em class="parameter"><code>task</code></em>
. <a class="link" href="GstObject.html#gst-object-unref" title="gst_object_unref ()"><code class="function">gst_object_unref()</code></a>
after usage. </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="GstTaskThreadFunc"></a><h3>GstTaskThreadFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GstTaskThreadFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>,
                      <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Threads.html#GThread"><span class="type">GThread</span></a> *thread</code></em>,
                      <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>Custom GstTask thread callback functions that can be installed.</p>
<div class="refsect3">
<a name="GstTaskThreadFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>thread</p></td>
<td class="parameter_description"><p>The <a href="/usr/share/gtk-doc/html/glib/glib-Threads.html#GThread"><span class="type">GThread</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-set-enter-callback"></a><h3>gst_task_set_enter_callback ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_task_set_enter_callback (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>,
                             <em class="parameter"><code><a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()"><span class="type">GstTaskThreadFunc</span></a> enter_func</code></em>,
                             <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                             <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre>
<p>Call <em class="parameter"><code>enter_func</code></em>
 when the task function of <em class="parameter"><code>task</code></em>
 is entered. <em class="parameter"><code>user_data</code></em>
 will
be passed to <em class="parameter"><code>enter_func</code></em>
 and <em class="parameter"><code>notify</code></em>
 will be called when <em class="parameter"><code>user_data</code></em>
 is no
longer referenced.</p>
<div class="refsect3">
<a name="gst-task-set-enter-callback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>enter_func</p></td>
<td class="parameter_description"><p> a <a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()"><span class="type">GstTaskThreadFunc</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>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data passed to <em class="parameter"><code>enter_func</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>notify</p></td>
<td class="parameter_description"><p>called when <em class="parameter"><code>user_data</code></em>
is no longer referenced</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-set-leave-callback"></a><h3>gst_task_set_leave_callback ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_task_set_leave_callback (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>,
                             <em class="parameter"><code><a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()"><span class="type">GstTaskThreadFunc</span></a> leave_func</code></em>,
                             <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                             <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre>
<p>Call <em class="parameter"><code>leave_func</code></em>
 when the task function of <em class="parameter"><code>task</code></em>
 is left. <em class="parameter"><code>user_data</code></em>
 will
be passed to <em class="parameter"><code>leave_func</code></em>
 and <em class="parameter"><code>notify</code></em>
 will be called when <em class="parameter"><code>user_data</code></em>
 is no
longer referenced.</p>
<div class="refsect3">
<a name="gst-task-set-leave-callback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>leave_func</p></td>
<td class="parameter_description"><p> a <a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()"><span class="type">GstTaskThreadFunc</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>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data passed to <em class="parameter"><code>leave_func</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>notify</p></td>
<td class="parameter_description"><p>called when <em class="parameter"><code>user_data</code></em>
is no longer referenced</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-get-state"></a><h3>gst_task_get_state ()</h3>
<pre class="programlisting"><a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="returnvalue">GstTaskState</span></a>
gst_task_get_state (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre>
<p>Get the current state of the task.</p>
<div class="refsect3">
<a name="gst-task-get-state.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to query</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-task-get-state.returns"></a><h4>Returns</h4>
<p> The <a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="type">GstTaskState</span></a> of the task</p>
<p>MT safe.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-set-state"></a><h3>gst_task_set_state ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_task_set_state (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>,
                    <em class="parameter"><code><a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="type">GstTaskState</span></a> state</code></em>);</pre>
<p>Sets the state of <em class="parameter"><code>task</code></em>
 to <em class="parameter"><code>state</code></em>
.</p>
<p>The <em class="parameter"><code>task</code></em>
 must have a lock associated with it using
<a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a> when going to GST_TASK_STARTED or GST_TASK_PAUSED or
this function will return <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<p>MT safe.</p>
<div class="refsect3">
<a name="gst-task-set-state.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>the new task state</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-task-set-state.returns"></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 state could be changed.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-pause"></a><h3>gst_task_pause ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_task_pause (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre>
<p>Pauses <em class="parameter"><code>task</code></em>
. This method can also be called on a task in the
stopped state, in which case a thread will be started and will remain
in the paused state. This function does not wait for the task to complete
the paused state.</p>
<div class="refsect3">
<a name="gst-task-pause.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to pause</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-task-pause.returns"></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 task could be paused.</p>
<p>MT safe.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-start"></a><h3>gst_task_start ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_task_start (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre>
<p>Starts <em class="parameter"><code>task</code></em>
. The <em class="parameter"><code>task</code></em>
 must have a lock associated with it using
<a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a> or this function will return <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<div class="refsect3">
<a name="gst-task-start.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to start</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-task-start.returns"></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 task could be started.</p>
<p>MT safe.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-stop"></a><h3>gst_task_stop ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_task_stop (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre>
<p>Stops <em class="parameter"><code>task</code></em>
. This method merely schedules the task to stop and
will not wait for the task to have completely stopped. Use
<a class="link" href="GstTask.html#gst-task-join" title="gst_task_join ()"><code class="function">gst_task_join()</code></a> to stop and wait for completion.</p>
<div class="refsect3">
<a name="gst-task-stop.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to stop</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-task-stop.returns"></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 task could be stopped.</p>
<p>MT safe.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-join"></a><h3>gst_task_join ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_task_join (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre>
<p>Joins <em class="parameter"><code>task</code></em>
. After this call, it is safe to unref the task
and clean up the lock set with <a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a>.</p>
<p>The task will automatically be stopped with this call.</p>
<p>This function cannot be called from within a task function as this
would cause a deadlock. The function will detect this and print a
g_warning.</p>
<div class="refsect3">
<a name="gst-task-join.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>task</p></td>
<td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to join</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-task-join.returns"></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 task could be joined.</p>
<p>MT safe.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-task-cleanup-all"></a><h3>gst_task_cleanup_all ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_task_cleanup_all (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Wait for all tasks to be stopped. This is mainly used internally
to ensure proper cleanup of internal data structures in test suites.</p>
<p>MT safe.</p>
</div>
</div>
<div class="refsect1">
<a name="GstTask.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GstTask-struct"></a><h3>struct GstTask</h3>
<pre class="programlisting">struct GstTask {
  GstTaskState     state;
  GCond            cond;

  GRecMutex       *lock;

  GstTaskFunction  func;
  gpointer         user_data;
  GDestroyNotify   notify;

  gboolean         running;
};
</pre>
<p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> object.</p>
<div class="refsect3">
<a name="GstTask.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="type">GstTaskState</span></a> <em class="structfield"><code><a name="GstTask-struct.state"></a>state</code></em>;</p></td>
<td class="struct_member_description"><p>the state of the task</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-Threads.html#GCond"><span class="type">GCond</span></a> <em class="structfield"><code><a name="GstTask-struct.cond"></a>cond</code></em>;</p></td>
<td class="struct_member_description"><p>used to pause/resume the task</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-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> *<em class="structfield"><code><a name="GstTask-struct.lock"></a>lock</code></em>;</p></td>
<td class="struct_member_description"><p>The lock taken when iterating the task function</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a> <em class="structfield"><code><a name="GstTask-struct.func"></a>func</code></em>;</p></td>
<td class="struct_member_description"><p>the function executed by this task</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#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GstTask-struct.user-data"></a>user_data</code></em>;</p></td>
<td class="struct_member_description"><p>user_data passed to the task function</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-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> <em class="structfield"><code><a name="GstTask-struct.notify"></a>notify</code></em>;</p></td>
<td class="struct_member_description"><p>GDestroyNotify for <em class="parameter"><code>user_data</code></em>
</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#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="GstTask-struct.running"></a>running</code></em>;</p></td>
<td class="struct_member_description"><p>a flag indicating that the task is running</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GstTaskState"></a><h3>enum GstTaskState</h3>
<p>The different states a task can be in</p>
<div class="refsect3">
<a name="GstTaskState.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GST-TASK-STARTED:CAPS"></a>GST_TASK_STARTED</p></td>
<td class="enum_member_description">
<p>the task is started and running</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-TASK-STOPPED:CAPS"></a>GST_TASK_STOPPED</p></td>
<td class="enum_member_description">
<p>the task is stopped</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GST-TASK-PAUSED:CAPS"></a>GST_TASK_PAUSED</p></td>
<td class="enum_member_description">
<p>the task is paused</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GstTask.see-also"></a><h2>See Also</h2>
<p><a class="link" href="GstElement.html" title="GstElement"><span class="type">GstElement</span></a>, <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>