-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGstCheck-1.0.gir
2896 lines (2748 loc) · 139 KB
/
GstCheck-1.0.gir
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
<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations. -->
<repository xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0" version="1.2">
<include name="GLib" version="2.0"/>
<include name="GModule" version="2.0"/>
<include name="GObject" version="2.0"/>
<include name="Gst" version="1.0"/>
<package name="gstreamer-check-1.0"/>
<c:include name="gst/check/check.h"/>
<namespace name="GstCheck" version="1.0" shared-library="libgstcheck-1.0.so.0" c:identifier-prefixes="Gst" c:symbol-prefixes="gst">
<function-macro name="CHECK_DEPRECATED_FOR" c:identifier="GST_CHECK_DEPRECATED_FOR" introspectable="0">
<parameters>
<parameter name="f">
</parameter>
</parameters>
</function-macro>
<record name="Harness" c:type="GstHarness" version="1.6">
<doc xml:space="preserve">#GstHarness is meant to make writing unit test for GStreamer much easier.
It can be thought of as a way of treating a #GstElement as a black box,
deterministically feeding it data, and controlling what data it outputs.
The basic structure of #GstHarness is two "floating" #GstPads that connect
to the harnessed #GstElement src and sink #GstPads like so:
|[
__________________________
_____ | _____ _____ | _____
| | | | | | | | | |
| src |--+-| sink| Element | src |-+--| sink|
|_____| | |_____| |_____| | |_____|
|__________________________|
]|
With this, you can now simulate any environment the #GstElement might find
itself in. By specifying the #GstCaps of the harness #GstPads, using
functions like gst_harness_set_src_caps() or gst_harness_set_sink_caps_str(),
you can test how the #GstElement interacts with different caps sets.
Your harnessed #GstElement can of course also be a bin, and using
gst_harness_new_parse() supporting standard gst-launch syntax, you can
easily test a whole pipeline instead of just one element.
You can then go on to push #GstBuffers and #GstEvents on to the srcpad,
using functions like gst_harness_push() and gst_harness_push_event(), and
then pull them out to examine them with gst_harness_pull() and
gst_harness_pull_event().
## A simple buffer-in buffer-out example
|[<!-- language="C" -->
#include <gst/gst.h>
#include <gst/check/gstharness.h>
GstHarness *h;
GstBuffer *in_buf;
GstBuffer *out_buf;
// attach the harness to the src and sink pad of GstQueue
h = gst_harness_new ("queue");
// we must specify a caps before pushing buffers
gst_harness_set_src_caps_str (h, "mycaps");
// create a buffer of size 42
in_buf = gst_harness_create_buffer (h, 42);
// push the buffer into the queue
gst_harness_push (h, in_buf);
// pull the buffer from the queue
out_buf = gst_harness_pull (h);
// validate the buffer in is the same as buffer out
fail_unless (in_buf == out_buf);
// cleanup
gst_buffer_unref (out_buf);
gst_harness_teardown (h);
]|
Another main feature of the #GstHarness is its integration with the
#GstTestClock. Operating the #GstTestClock can be very challenging, but
#GstHarness simplifies some of the most desired actions a lot, like wanting
to manually advance the clock while at the same time releasing a #GstClockID
that is waiting, with functions like gst_harness_crank_single_clock_wait().
#GstHarness also supports sub-harnesses, as a way of generating and
validating data. A sub-harness is another #GstHarness that is managed by
the "parent" harness, and can either be created by using the standard
gst_harness_new type functions directly on the (GstHarness *)->src_harness,
or using the much more convenient gst_harness_add_src() or
gst_harness_add_sink_parse(). If you have a decoder-element you want to test,
(like vp8dec) it can be very useful to add a src-harness with both a
src-element (videotestsrc) and an encoder (vp8enc) to feed the decoder data
with different configurations, by simply doing:
|[<!-- language="C" -->
GstHarness * h = gst_harness_new ("vp8dec");
gst_harness_add_src_parse (h, "videotestsrc is-live=1 ! vp8enc", TRUE);
]|
and then feeding it data with:
|[<!-- language="C" -->
gst_harness_push_from_src (h);
]|</doc>
<field name="element" writable="1">
<doc xml:space="preserve">the element inside the harness</doc>
<type name="Gst.Element" c:type="GstElement*"/>
</field>
<field name="srcpad" writable="1">
<doc xml:space="preserve">the internal harness source pad</doc>
<type name="Gst.Pad" c:type="GstPad*"/>
</field>
<field name="sinkpad" writable="1">
<doc xml:space="preserve">the internal harness sink pad</doc>
<type name="Gst.Pad" c:type="GstPad*"/>
</field>
<field name="src_harness" writable="1">
<doc xml:space="preserve">the source (input) harness (if any)</doc>
<type name="Harness" c:type="GstHarness*"/>
</field>
<field name="sink_harness" writable="1">
<doc xml:space="preserve">the sink (output) harness (if any)</doc>
<type name="Harness" c:type="GstHarness*"/>
</field>
<field name="priv" readable="0" private="1">
<type name="HarnessPrivate" c:type="GstHarnessPrivate*"/>
</field>
<method name="add_element_full" c:identifier="gst_harness_add_element_full" version="1.6" introspectable="0">
<doc xml:space="preserve">Adds a #GstElement to an empty #GstHarness
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="element" transfer-ownership="none">
<doc xml:space="preserve">a #GstElement to add to the harness (transfer none)</doc>
<type name="Gst.Element" c:type="GstElement*"/>
</parameter>
<parameter name="hsrc" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a #GstStaticPadTemplate describing the harness srcpad.
%NULL will not create a harness srcpad.</doc>
<type name="Gst.StaticPadTemplate" c:type="GstStaticPadTemplate*"/>
</parameter>
<parameter name="element_sinkpad_name" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a #gchar with the name of the element
sinkpad that is then linked to the harness srcpad. Can be a static or request
or a sometimes pad that has been added. %NULL will not get/request a sinkpad
from the element. (Like if the element is a src.)</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="hsink" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a #GstStaticPadTemplate describing the harness sinkpad.
%NULL will not create a harness sinkpad.</doc>
<type name="Gst.StaticPadTemplate" c:type="GstStaticPadTemplate*"/>
</parameter>
<parameter name="element_srcpad_name" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a #gchar with the name of the element
srcpad that is then linked to the harness sinkpad, similar to the
@element_sinkpad_name.</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="add_element_sink_pad" c:identifier="gst_harness_add_element_sink_pad" version="1.6">
<doc xml:space="preserve">Links the specified #GstPad the @GstHarness srcpad.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="sinkpad" transfer-ownership="none">
<doc xml:space="preserve">a #GstPad to link to the harness srcpad</doc>
<type name="Gst.Pad" c:type="GstPad*"/>
</parameter>
</parameters>
</method>
<method name="add_element_src_pad" c:identifier="gst_harness_add_element_src_pad" version="1.6">
<doc xml:space="preserve">Links the specified #GstPad the @GstHarness sinkpad. This can be useful if
perhaps the srcpad did not exist at the time of creating the harness,
like a demuxer that provides a sometimes-pad after receiving data.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="srcpad" transfer-ownership="none">
<doc xml:space="preserve">a #GstPad to link to the harness sinkpad</doc>
<type name="Gst.Pad" c:type="GstPad*"/>
</parameter>
</parameters>
</method>
<method name="add_parse" c:identifier="gst_harness_add_parse" version="1.6" introspectable="0">
<doc xml:space="preserve">Parses the @launchline and puts that in a #GstBin,
and then attches the supplied #GstHarness to the bin.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="launchline" transfer-ownership="none">
<doc xml:space="preserve">a #gchar describing a gst-launch type line</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="add_probe" c:identifier="gst_harness_add_probe" version="1.6">
<doc xml:space="preserve">A convenience function to allows you to call gst_pad_add_probe on a
#GstPad of a #GstElement that are residing inside the #GstHarness,
by using normal gst_pad_add_probe syntax
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="element_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with a #GstElementFactory name</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="pad_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with the name of the pad to attach the probe to</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="mask" transfer-ownership="none">
<doc xml:space="preserve">a #GstPadProbeType (see gst_pad_add_probe)</doc>
<type name="Gst.PadProbeType" c:type="GstPadProbeType"/>
</parameter>
<parameter name="callback" transfer-ownership="none" scope="notified" closure="4" destroy="5">
<doc xml:space="preserve">a #GstPadProbeCallback (see gst_pad_add_probe)</doc>
<type name="Gst.PadProbeCallback" c:type="GstPadProbeCallback"/>
</parameter>
<parameter name="user_data" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a #gpointer (see gst_pad_add_probe)</doc>
<type name="gpointer" c:type="gpointer"/>
</parameter>
<parameter name="destroy_data" transfer-ownership="none" scope="async">
<doc xml:space="preserve">a #GDestroyNotify (see gst_pad_add_probe)</doc>
<type name="GLib.DestroyNotify" c:type="GDestroyNotify"/>
</parameter>
</parameters>
</method>
<method name="add_propose_allocation_meta" c:identifier="gst_harness_add_propose_allocation_meta" version="1.16">
<doc xml:space="preserve">Add api with params as one of the supported metadata API to propose when
receiving an allocation query.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="api" transfer-ownership="none">
<doc xml:space="preserve">a metadata API</doc>
<type name="GType" c:type="GType"/>
</parameter>
<parameter name="params" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">API specific parameters</doc>
<type name="Gst.Structure" c:type="const GstStructure*"/>
</parameter>
</parameters>
</method>
<method name="add_sink" c:identifier="gst_harness_add_sink" version="1.6">
<doc xml:space="preserve">Similar to gst_harness_add_sink_harness, this is a convenience to
directly create a sink-harness using the @sink_element_name name specified.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="sink_element_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with the name of a #GstElement</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="add_sink_harness" c:identifier="gst_harness_add_sink_harness" version="1.6">
<doc xml:space="preserve">Similar to gst_harness_add_src, this allows you to send the data coming out
of your harnessed #GstElement to a sink-element, allowing to test different
responses the element output might create in sink elements. An example might
be an existing sink providing some analytical data on the input it receives that
can be useful to your testing. If the goal is to test a sink-element itself,
this is better achieved using gst_harness_new directly on the sink.
If a sink-harness already exists it will be replaced.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="sink_harness" transfer-ownership="full">
<doc xml:space="preserve">a #GstHarness to be added as a sink-harness.</doc>
<type name="Harness" c:type="GstHarness*"/>
</parameter>
</parameters>
</method>
<method name="add_sink_parse" c:identifier="gst_harness_add_sink_parse" version="1.6">
<doc xml:space="preserve">Similar to gst_harness_add_sink, this allows you to specify a launch-line
instead of just an element name. See gst_harness_add_src_parse for details.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="launchline" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with the name of a #GstElement</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="add_src" c:identifier="gst_harness_add_src" version="1.6">
<doc xml:space="preserve">Similar to gst_harness_add_src_harness, this is a convenience to
directly create a src-harness using the @src_element_name name specified.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="src_element_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with the name of a #GstElement</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="has_clock_wait" transfer-ownership="none">
<doc xml:space="preserve">a #gboolean specifying if the #GstElement uses
gst_clock_wait_id internally.</doc>
<type name="gboolean" c:type="gboolean"/>
</parameter>
</parameters>
</method>
<method name="add_src_harness" c:identifier="gst_harness_add_src_harness" version="1.6">
<doc xml:space="preserve">A src-harness is a great way of providing the #GstHarness with data.
By adding a src-type #GstElement, it is then easy to use functions like
gst_harness_push_from_src or gst_harness_src_crank_and_push_many
to provide your harnessed element with input. The @has_clock_wait variable
is a great way to control you src-element with, in that you can have it
produce a buffer for you by simply cranking the clock, and not have it
spin out of control producing buffers as fast as possible.
If a src-harness already exists it will be replaced.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="src_harness" transfer-ownership="full">
<doc xml:space="preserve">a #GstHarness to be added as a src-harness.</doc>
<type name="Harness" c:type="GstHarness*"/>
</parameter>
<parameter name="has_clock_wait" transfer-ownership="none">
<doc xml:space="preserve">a #gboolean specifying if the #GstElement uses
gst_clock_wait_id internally.</doc>
<type name="gboolean" c:type="gboolean"/>
</parameter>
</parameters>
</method>
<method name="add_src_parse" c:identifier="gst_harness_add_src_parse" version="1.6">
<doc xml:space="preserve">Similar to gst_harness_add_src, this allows you to specify a launch-line,
which can be useful for both having more then one #GstElement acting as your
src (Like a src producing raw buffers, and then an encoder, providing encoded
data), but also by allowing you to set properties like "is-live" directly on
the elements.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="launchline" transfer-ownership="none">
<doc xml:space="preserve">a #gchar describing a gst-launch type line</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="has_clock_wait" transfer-ownership="none">
<doc xml:space="preserve">a #gboolean specifying if the #GstElement uses
gst_clock_wait_id internally.</doc>
<type name="gboolean" c:type="gboolean"/>
</parameter>
</parameters>
</method>
<method name="buffers_in_queue" c:identifier="gst_harness_buffers_in_queue" version="1.6">
<doc xml:space="preserve">The number of #GstBuffers currently in the #GstHarness sinkpad #GAsyncQueue
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #guint number of buffers in the queue</doc>
<type name="guint" c:type="guint"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="buffers_received" c:identifier="gst_harness_buffers_received" version="1.6">
<doc xml:space="preserve">The total number of #GstBuffers that has arrived on the #GstHarness sinkpad.
This number includes buffers that have been dropped as well as buffers
that have already been pulled out.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #guint number of buffers received</doc>
<type name="guint" c:type="guint"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="crank_multiple_clock_waits" c:identifier="gst_harness_crank_multiple_clock_waits" version="1.6">
<doc xml:space="preserve">Similar to gst_harness_crank_single_clock_wait(), this is the function to use
if your harnessed element(s) are using more then one gst_clock_id_wait.
Failing to do so can (and will) make it racy which #GstClockID you actually
are releasing, where as this function will process all the waits at the
same time, ensuring that one thread can't register another wait before
both are released.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a @gboolean %TRUE if the "crank" was successful, %FALSE if not.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="waits" transfer-ownership="none">
<doc xml:space="preserve">a #guint describing the number of #GstClockIDs to crank</doc>
<type name="guint" c:type="guint"/>
</parameter>
</parameters>
</method>
<method name="crank_single_clock_wait" c:identifier="gst_harness_crank_single_clock_wait" version="1.6">
<doc xml:space="preserve">A "crank" consists of three steps:
1: Wait for a #GstClockID to be registered with the #GstTestClock.
2: Advance the #GstTestClock to the time the #GstClockID is waiting for.
3: Release the #GstClockID wait.
Together, this provides an easy way to not have to think about the details
around clocks and time, but still being able to write deterministic tests
that are dependent on this. A "crank" can be though of as the notion of
manually driving the clock forward to its next logical step.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a @gboolean %TRUE if the "crank" was successful, %FALSE if not.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="create_buffer" c:identifier="gst_harness_create_buffer" version="1.6">
<doc xml:space="preserve">Allocates a buffer using a #GstBufferPool if present, or else using the
configured #GstAllocator and #GstAllocationParams
MT safe.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a #GstBuffer of size @size</doc>
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="size" transfer-ownership="none">
<doc xml:space="preserve">a #gsize specifying the size of the buffer</doc>
<type name="gsize" c:type="gsize"/>
</parameter>
</parameters>
</method>
<method name="dump_to_file" c:identifier="gst_harness_dump_to_file" version="1.6">
<doc xml:space="preserve">Allows you to dump the #GstBuffers the #GstHarness sinkpad #GAsyncQueue
to a file.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="filename" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with a the name of a file</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="events_in_queue" c:identifier="gst_harness_events_in_queue" version="1.6">
<doc xml:space="preserve">The number of #GstEvents currently in the #GstHarness sinkpad #GAsyncQueue
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #guint number of events in the queue</doc>
<type name="guint" c:type="guint"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="events_received" c:identifier="gst_harness_events_received" version="1.6">
<doc xml:space="preserve">The total number of #GstEvents that has arrived on the #GstHarness sinkpad
This number includes events handled by the harness as well as events
that have already been pulled out.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #guint number of events received</doc>
<type name="guint" c:type="guint"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="find_element" c:identifier="gst_harness_find_element" version="1.6">
<doc xml:space="preserve">Most useful in conjunction with gst_harness_new_parse, this will scan the
#GstElements inside the #GstHarness, and check if any of them matches
@element_name. Typical usecase being that you need to access one of the
harnessed elements for properties and/or signals.
MT safe.</doc>
<return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GstElement or %NULL if not found</doc>
<type name="Gst.Element" c:type="GstElement*"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="element_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with a #GstElementFactory name</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</method>
<method name="get" c:identifier="gst_harness_get" version="1.6" introspectable="0">
<doc xml:space="preserve">A convenience function to allows you to call g_object_get on a #GstElement
that are residing inside the #GstHarness, by using normal g_object_get
syntax.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="element_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with a #GstElementFactory name</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="first_property_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with the first property name</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="..." transfer-ownership="none">
<doc xml:space="preserve">return location for the first property, followed optionally by more
name/return location pairs, followed by %NULL</doc>
<varargs/>
</parameter>
</parameters>
</method>
<method name="get_allocator" c:identifier="gst_harness_get_allocator" version="1.6">
<doc xml:space="preserve">Gets the @allocator and its @params that has been decided to use after an
allocation query.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="allocator" direction="out" caller-allocates="0" transfer-ownership="none" nullable="1" optional="1" allow-none="1">
<doc xml:space="preserve">the #GstAllocator used</doc>
<type name="Gst.Allocator" c:type="GstAllocator**"/>
</parameter>
<parameter name="params" direction="out" caller-allocates="1" transfer-ownership="none" optional="1" allow-none="1">
<doc xml:space="preserve">the #GstAllocationParams of
@allocator</doc>
<type name="Gst.AllocationParams" c:type="GstAllocationParams*"/>
</parameter>
</parameters>
</method>
<method name="get_last_pushed_timestamp" c:identifier="gst_harness_get_last_pushed_timestamp" version="1.6">
<doc xml:space="preserve">Get the timestamp of the last #GstBuffer pushed on the #GstHarness srcpad,
typically with gst_harness_push or gst_harness_push_from_src.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #GstClockTime with the timestamp or %GST_CLOCK_TIME_NONE if no
#GstBuffer has been pushed on the #GstHarness srcpad</doc>
<type name="Gst.ClockTime" c:type="GstClockTime"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="get_testclock" c:identifier="gst_harness_get_testclock" version="1.6">
<doc xml:space="preserve">Get the #GstTestClock. Useful if specific operations on the testclock is
needed.
MT safe.</doc>
<return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GstTestClock, or %NULL if the testclock is not
present.</doc>
<type name="TestClock" c:type="GstTestClock*"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="play" c:identifier="gst_harness_play" version="1.6">
<doc xml:space="preserve">This will set the harnessed #GstElement to %GST_STATE_PLAYING.
#GstElements without a sink-#GstPad and with the %GST_ELEMENT_FLAG_SOURCE
flag set is considered a src #GstElement
Non-src #GstElements (like sinks and filters) are automatically set to
playing by the #GstHarness, but src #GstElements are not to avoid them
starting to produce buffers.
Hence, for src #GstElement you must call gst_harness_play() explicitly.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="pull" c:identifier="gst_harness_pull" version="1.6">
<doc xml:space="preserve">Pulls a #GstBuffer from the #GAsyncQueue on the #GstHarness sinkpad. The pull
will timeout in 60 seconds. This is the standard way of getting a buffer
from a harnessed #GstElement.
MT safe.</doc>
<return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GstBuffer or %NULL if timed out.</doc>
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="pull_event" c:identifier="gst_harness_pull_event" version="1.6">
<doc xml:space="preserve">Pulls an #GstEvent from the #GAsyncQueue on the #GstHarness sinkpad.
Timeouts after 60 seconds similar to gst_harness_pull.
MT safe.</doc>
<return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GstEvent or %NULL if timed out.</doc>
<type name="Gst.Event" c:type="GstEvent*"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="pull_until_eos" c:identifier="gst_harness_pull_until_eos" version="1.18">
<doc xml:space="preserve">Pulls a #GstBuffer from the #GAsyncQueue on the #GstHarness sinkpad. The pull
will block until an EOS event is received, or timeout in 60 seconds.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on timeout.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="buf" direction="out" caller-allocates="0" transfer-ownership="full" nullable="1">
<doc xml:space="preserve">A #GstBuffer, or %NULL if EOS or timeout occures
first.</doc>
<type name="Gst.Buffer" c:type="GstBuffer**"/>
</parameter>
</parameters>
</method>
<method name="pull_upstream_event" c:identifier="gst_harness_pull_upstream_event" version="1.6">
<doc xml:space="preserve">Pulls an #GstEvent from the #GAsyncQueue on the #GstHarness srcpad.
Timeouts after 60 seconds similar to gst_harness_pull.
MT safe.</doc>
<return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GstEvent or %NULL if timed out.</doc>
<type name="Gst.Event" c:type="GstEvent*"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="push" c:identifier="gst_harness_push" version="1.6">
<doc xml:space="preserve">Pushes a #GstBuffer on the #GstHarness srcpad. The standard way of
interacting with an harnessed element.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #GstFlowReturn with the result from the push</doc>
<type name="Gst.FlowReturn" c:type="GstFlowReturn"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="buffer" transfer-ownership="full">
<doc xml:space="preserve">a #GstBuffer to push</doc>
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</parameter>
</parameters>
</method>
<method name="push_and_pull" c:identifier="gst_harness_push_and_pull" version="1.6">
<doc xml:space="preserve">Basically a gst_harness_push and a gst_harness_pull in one line. Reflects
the fact that you often want to do exactly this in your test: Push one buffer
in, and inspect the outcome.
MT safe.</doc>
<return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GstBuffer or %NULL if timed out.</doc>
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="buffer" transfer-ownership="full">
<doc xml:space="preserve">a #GstBuffer to push</doc>
<type name="Gst.Buffer" c:type="GstBuffer*"/>
</parameter>
</parameters>
</method>
<method name="push_event" c:identifier="gst_harness_push_event" version="1.6">
<doc xml:space="preserve">Pushes an #GstEvent on the #GstHarness srcpad.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #gboolean with the result from the push</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="event" transfer-ownership="full">
<doc xml:space="preserve">a #GstEvent to push</doc>
<type name="Gst.Event" c:type="GstEvent*"/>
</parameter>
</parameters>
</method>
<method name="push_from_src" c:identifier="gst_harness_push_from_src" version="1.6">
<doc xml:space="preserve">Transfer data from the src-#GstHarness to the main-#GstHarness. It consists
of 4 steps:
1: Make sure the src is started. (see: gst_harness_play)
2: Crank the clock (see: gst_harness_crank_single_clock_wait)
3: Pull a #GstBuffer from the src-#GstHarness (see: gst_harness_pull)
4: Push the same #GstBuffer into the main-#GstHarness (see: gst_harness_push)
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #GstFlowReturn with the result of the push</doc>
<type name="Gst.FlowReturn" c:type="GstFlowReturn"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="push_to_sink" c:identifier="gst_harness_push_to_sink" version="1.6">
<doc xml:space="preserve">Transfer one #GstBuffer from the main-#GstHarness to the sink-#GstHarness.
See gst_harness_push_from_src for details.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #GstFlowReturn with the result of the push</doc>
<type name="Gst.FlowReturn" c:type="GstFlowReturn"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="push_upstream_event" c:identifier="gst_harness_push_upstream_event" version="1.6">
<doc xml:space="preserve">Pushes an #GstEvent on the #GstHarness sinkpad.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #gboolean with the result from the push</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="event" transfer-ownership="full">
<doc xml:space="preserve">a #GstEvent to push</doc>
<type name="Gst.Event" c:type="GstEvent*"/>
</parameter>
</parameters>
</method>
<method name="query_latency" c:identifier="gst_harness_query_latency" version="1.6">
<doc xml:space="preserve">Get the min latency reported by any harnessed #GstElement.
MT safe.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a #GstClockTime with min latency</doc>
<type name="Gst.ClockTime" c:type="GstClockTime"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="set" c:identifier="gst_harness_set" version="1.6" introspectable="0">
<doc xml:space="preserve">A convenience function to allows you to call g_object_set on a #GstElement
that are residing inside the #GstHarness, by using normal g_object_set
syntax.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="element_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with a #GstElementFactory name</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="first_property_name" transfer-ownership="none">
<doc xml:space="preserve">a #gchar with the first property name</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="..." transfer-ownership="none">
<doc xml:space="preserve">value for the first property, followed optionally by more
name/value pairs, followed by %NULL</doc>
<varargs/>
</parameter>
</parameters>
</method>
<method name="set_blocking_push_mode" c:identifier="gst_harness_set_blocking_push_mode" version="1.6">
<doc xml:space="preserve">Setting this will make the harness block in the chain-function, and
then release when gst_harness_pull() or gst_harness_try_pull() is called.
Can be useful when wanting to control a src-element that is not implementing
gst_clock_id_wait() so it can't be controlled by the #GstTestClock, since
it otherwise would produce buffers as fast as possible.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
</parameters>
</method>
<method name="set_caps" c:identifier="gst_harness_set_caps" version="1.6">
<doc xml:space="preserve">Sets the @GstHarness srcpad and sinkpad caps.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="in" transfer-ownership="full">
<doc xml:space="preserve">a #GstCaps to set on the harness srcpad</doc>
<type name="Gst.Caps" c:type="GstCaps*"/>
</parameter>
<parameter name="out" transfer-ownership="full">
<doc xml:space="preserve">a #GstCaps to set on the harness sinkpad</doc>
<type name="Gst.Caps" c:type="GstCaps*"/>
</parameter>
</parameters>
</method>
<method name="set_caps_str" c:identifier="gst_harness_set_caps_str" version="1.6">
<doc xml:space="preserve">Sets the @GstHarness srcpad and sinkpad caps using strings.
MT safe.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="h" transfer-ownership="none">
<doc xml:space="preserve">a #GstHarness</doc>
<type name="Harness" c:type="GstHarness*"/>
</instance-parameter>
<parameter name="in" transfer-ownership="none">
<doc xml:space="preserve">a @gchar describing a #GstCaps to set on the harness srcpad</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>