gstreamer-rs-lgpl-docs 0.16.0

LGPL-licensed docs for gstreamer-rs crates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
<!-- file * -->
<!-- struct Adapter -->
This class is for elements that receive buffers in an undesired size.
While for example raw video contains one image per buffer, the same is not
true for a lot of other formats, especially those that come directly from
a file. So if you have undefined buffer sizes and require a specific size,
this object is for you.

An adapter is created with `Adapter::new`. It can be freed again with
`gobject::ObjectExt::unref`.

The theory of operation is like this: All buffers received are put
into the adapter using `Adapter::push` and the data is then read back
in chunks of the desired size using `Adapter::map`/`Adapter::unmap`
and/or `Adapter::copy`. After the data has been processed, it is freed
using `Adapter::unmap`.

Other methods such as `Adapter::take` and `Adapter::take_buffer`
combine `Adapter::map` and `Adapter::unmap` in one method and are
potentially more convenient for some use cases.

For example, a sink pad's chain function that needs to pass data to a library
in 512-byte chunks could be implemented like this:

```C
static GstFlowReturn
sink_pad_chain (GstPad *pad, GstObject *parent, GstBuffer *buffer)
{
  MyElement *this;
  GstAdapter *adapter;
  GstFlowReturn ret = GST_FLOW_OK;

  this = MY_ELEMENT (parent);

  adapter = this->adapter;

  // put buffer into adapter
  gst_adapter_push (adapter, buffer);

  // while we can read out 512 bytes, process them
  while (gst_adapter_available (adapter) >= 512 && ret == GST_FLOW_OK) {
    const guint8 *data = gst_adapter_map (adapter, 512);
    // use flowreturn as an error value
    ret = my_library_foo (data);
    gst_adapter_unmap (adapter);
    gst_adapter_flush (adapter, 512);
  }
  return ret;
}
```

For another example, a simple element inside GStreamer that uses `Adapter`
is the libvisual element.

An element using `Adapter` in its sink pad chain function should ensure that
when the FLUSH_STOP event is received, that any queued data is cleared using
`Adapter::clear`. Data should also be cleared or processed on EOS and
when changing state from `gst::State::Paused` to `gst::State::Ready`.

Also check the GST_BUFFER_FLAG_DISCONT flag on the buffer. Some elements might
need to clear the adapter after a discontinuity.

The adapter will keep track of the timestamps of the buffers
that were pushed. The last seen timestamp before the current position
can be queried with `Adapter::prev_pts`. This function can
optionally return the number of bytes between the start of the buffer that
carried the timestamp and the current adapter position. The distance is
useful when dealing with, for example, raw audio samples because it allows
you to calculate the timestamp of the current adapter position by using the
last seen timestamp and the amount of bytes since. Additionally, the
`Adapter::prev_pts_at_offset` can be used to determine the last
seen timestamp at a particular offset in the adapter.

The adapter will also keep track of the offset of the buffers
(`GST_BUFFER_OFFSET`) that were pushed. The last seen offset before the
current position can be queried with `Adapter::prev_offset`. This function
can optionally return the number of bytes between the start of the buffer
that carried the offset and the current adapter position.

Additionally the adapter also keeps track of the PTS, DTS and buffer offset
at the last discontinuity, which can be retrieved with
`Adapter::pts_at_discont`, `Adapter::dts_at_discont` and
`Adapter::offset_at_discont`. The number of bytes that were consumed
since then can be queried with `Adapter::distance_from_discont`.

A last thing to note is that while `Adapter` is pretty optimized,
merging buffers still might be an operation that requires a `malloc()` and
`memcpy()` operation, and these operations are not the fastest. Because of
this, some functions like `Adapter::available_fast` are provided to help
speed up such cases should you want to. To avoid repeated memory allocations,
`Adapter::copy` can be used to copy data into a (statically allocated)
user provided buffer.

`Adapter` is not MT safe. All operations on an adapter must be serialized by
the caller. This is not normally a problem, however, as the normal use case
of `Adapter` is inside one pad's chain function, in which case access is
serialized via the pad's STREAM_LOCK.

Note that `Adapter::push` takes ownership of the buffer passed. Use
`gst::Buffer::ref` before pushing it into the adapter if you still want to
access the buffer later. The adapter will never modify the data in the
buffer pushed in it.

# Implements

[`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
<!-- impl Adapter::fn new -->
Creates a new `Adapter`. Free with `gobject::ObjectExt::unref`.

# Returns

a new `Adapter`
<!-- impl Adapter::fn available -->
Gets the maximum amount of bytes available, that is it returns the maximum
value that can be supplied to `Adapter::map` without that function
returning `None`.

# Returns

number of bytes available in `self`
<!-- impl Adapter::fn available_fast -->
Gets the maximum number of bytes that are immediately available without
requiring any expensive operations (like copying the data into a
temporary buffer).

# Returns

number of bytes that are available in `self` without expensive
operations
<!-- impl Adapter::fn clear -->
Removes all buffers from `self`.
<!-- impl Adapter::fn copy -->
Copies `size` bytes of data starting at `offset` out of the buffers
contained in `Adapter` into an array `dest` provided by the caller.

The array `dest` should be large enough to contain `size` bytes.
The user should check that the adapter has (`offset` + `size`) bytes
available before calling this function.
## `dest`

 the memory to copy into
## `offset`
the bytes offset in the adapter to start from
## `size`
the number of bytes to copy
<!-- impl Adapter::fn copy_bytes -->
Similar to gst_adapter_copy, but more suitable for language bindings. `size`
bytes of data starting at `offset` will be copied out of the buffers contained
in `self` and into a new `glib::Bytes` structure which is returned. Depending on
the value of the `size` argument an empty `glib::Bytes` structure may be returned.
## `offset`
the bytes offset in the adapter to start from
## `size`
the number of bytes to copy

# Returns

A new `glib::Bytes` structure containing the copied data.
<!-- impl Adapter::fn distance_from_discont -->
Get the distance in bytes since the last buffer with the
`gst::BufferFlags::Discont` flag.

The distance will be reset to 0 for all buffers with
`gst::BufferFlags::Discont` on them, and then calculated for all other
following buffers based on their size.

Feature: `v1_10`


# Returns

The offset. Can be `GST_BUFFER_OFFSET_NONE`.
<!-- impl Adapter::fn dts_at_discont -->
Get the DTS that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_CLOCK_TIME_NONE.

Feature: `v1_10`


# Returns

The DTS at the last discont or GST_CLOCK_TIME_NONE.
<!-- impl Adapter::fn flush -->
Flushes the first `flush` bytes in the `self`. The caller must ensure that
at least this many bytes are available.

See also: `Adapter::map`, `Adapter::unmap`
## `flush`
the number of bytes to flush
<!-- impl Adapter::fn get_buffer -->
Returns a `gst::Buffer` containing the first `nbytes` of the `self`, but
does not flush them from the adapter. See `Adapter::take_buffer`
for details.

Caller owns a reference to the returned buffer. `gst::Buffer::unref` after
usage.

Free-function: gst_buffer_unref
## `nbytes`
the number of bytes to get

# Returns

a `gst::Buffer` containing the first
 `nbytes` of the adapter, or `None` if `nbytes` bytes are not available.
 `gst::Buffer::unref` when no longer needed.
<!-- impl Adapter::fn get_buffer_fast -->
Returns a `gst::Buffer` containing the first `nbytes` of the `self`, but
does not flush them from the adapter. See `Adapter::take_buffer_fast`
for details.

Caller owns a reference to the returned buffer. `gst::Buffer::unref` after
usage.

Free-function: gst_buffer_unref
## `nbytes`
the number of bytes to get

# Returns

a `gst::Buffer` containing the first
 `nbytes` of the adapter, or `None` if `nbytes` bytes are not available.
 `gst::Buffer::unref` when no longer needed.
<!-- impl Adapter::fn get_buffer_list -->
Returns a `gst::BufferList` of buffers containing the first `nbytes` bytes of
the `self` but does not flush them from the adapter. See
`Adapter::take_buffer_list` for details.

Caller owns the returned list. Call `gst::BufferList::unref` to free
the list after usage.
## `nbytes`
the number of bytes to get

# Returns

a `gst::BufferList` of buffers containing
 the first `nbytes` of the adapter, or `None` if `nbytes` bytes are not
 available
<!-- impl Adapter::fn get_list -->
Returns a `glib::List` of buffers containing the first `nbytes` bytes of the
`self`, but does not flush them from the adapter. See
`Adapter::take_list` for details.

Caller owns returned list and contained buffers. `gst::Buffer::unref` each
buffer in the list before freeing the list after usage.
## `nbytes`
the number of bytes to get

# Returns

a `glib::List` of
 buffers containing the first `nbytes` of the adapter, or `None` if `nbytes`
 bytes are not available
<!-- impl Adapter::fn map -->
Gets the first `size` bytes stored in the `self`. The returned pointer is
valid until the next function is called on the adapter.

Note that setting the returned pointer as the data of a `gst::Buffer` is
incorrect for general-purpose plugins. The reason is that if a downstream
element stores the buffer so that it has access to it outside of the bounds
of its chain function, the buffer will have an invalid data pointer after
your element flushes the bytes. In that case you should use
`Adapter::take`, which returns a freshly-allocated buffer that you can set
as `gst::Buffer` memory or the potentially more performant
`Adapter::take_buffer`.

Returns `None` if `size` bytes are not available.
## `size`
the number of bytes to map/peek

# Returns


 a pointer to the first `size` bytes of data, or `None`
<!-- impl Adapter::fn masked_scan_uint32 -->
Scan for pattern `pattern` with applied mask `mask` in the adapter data,
starting from offset `offset`.

The bytes in `pattern` and `mask` are interpreted left-to-right, regardless
of endianness. All four bytes of the pattern must be present in the
adapter for it to match, even if the first or last bytes are masked out.

It is an error to call this function without making sure that there is
enough data (offset+size bytes) in the adapter.

This function calls `Adapter::masked_scan_uint32_peek` passing `None`
for value.
## `mask`
mask to apply to data before matching against `pattern`
## `pattern`
pattern to match (after mask is applied)
## `offset`
offset into the adapter data from which to start scanning, returns
 the last scanned position.
## `size`
number of bytes to scan from offset

# Returns

offset of the first match, or -1 if no match was found.

Example:

```text
// Assume the adapter contains 0x00 0x01 0x02 ... 0xfe 0xff

gst_adapter_masked_scan_uint32 (adapter, 0xffffffff, 0x00010203, 0, 256);
// -> returns 0
gst_adapter_masked_scan_uint32 (adapter, 0xffffffff, 0x00010203, 1, 255);
// -> returns -1
gst_adapter_masked_scan_uint32 (adapter, 0xffffffff, 0x01020304, 1, 255);
// -> returns 1
gst_adapter_masked_scan_uint32 (adapter, 0xffff, 0x0001, 0, 256);
// -> returns -1
gst_adapter_masked_scan_uint32 (adapter, 0xffff, 0x0203, 0, 256);
// -> returns 0
gst_adapter_masked_scan_uint32 (adapter, 0xffff0000, 0x02030000, 0, 256);
// -> returns 2
gst_adapter_masked_scan_uint32 (adapter, 0xffff0000, 0x02030000, 0, 4);
// -> returns -1
```
<!-- impl Adapter::fn masked_scan_uint32_peek -->
Scan for pattern `pattern` with applied mask `mask` in the adapter data,
starting from offset `offset`. If a match is found, the value that matched
is returned through `value`, otherwise `value` is left untouched.

The bytes in `pattern` and `mask` are interpreted left-to-right, regardless
of endianness. All four bytes of the pattern must be present in the
adapter for it to match, even if the first or last bytes are masked out.

It is an error to call this function without making sure that there is
enough data (offset+size bytes) in the adapter.
## `mask`
mask to apply to data before matching against `pattern`
## `pattern`
pattern to match (after mask is applied)
## `offset`
offset into the adapter data from which to start scanning, returns
 the last scanned position.
## `size`
number of bytes to scan from offset
## `value`
pointer to uint32 to return matching data

# Returns

offset of the first match, or -1 if no match was found.
<!-- impl Adapter::fn offset_at_discont -->
Get the offset that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_BUFFER_OFFSET_NONE.

Feature: `v1_10`


# Returns

The offset at the last discont or GST_BUFFER_OFFSET_NONE.
<!-- impl Adapter::fn prev_dts -->
Get the dts that was before the current byte in the adapter. When
`distance` is given, the amount of bytes between the dts and the current
position is returned.

The dts is reset to GST_CLOCK_TIME_NONE and the distance is set to 0 when
the adapter is first created or when it is cleared. This also means that before
the first byte with a dts is removed from the adapter, the dts
and distance returned are GST_CLOCK_TIME_NONE and 0 respectively.
## `distance`
pointer to location for distance, or `None`

# Returns

The previously seen dts.
<!-- impl Adapter::fn prev_dts_at_offset -->
Get the dts that was before the byte at offset `offset` in the adapter. When
`distance` is given, the amount of bytes between the dts and the current
position is returned.

The dts is reset to GST_CLOCK_TIME_NONE and the distance is set to 0 when
the adapter is first created or when it is cleared. This also means that before
the first byte with a dts is removed from the adapter, the dts
and distance returned are GST_CLOCK_TIME_NONE and 0 respectively.
## `offset`
the offset in the adapter at which to get timestamp
## `distance`
pointer to location for distance, or `None`

# Returns

The previously seen dts at given offset.
<!-- impl Adapter::fn prev_offset -->
Get the offset that was before the current byte in the adapter. When
`distance` is given, the amount of bytes between the offset and the current
position is returned.

The offset is reset to GST_BUFFER_OFFSET_NONE and the distance is set to 0
when the adapter is first created or when it is cleared. This also means that
before the first byte with an offset is removed from the adapter, the offset
and distance returned are GST_BUFFER_OFFSET_NONE and 0 respectively.

Feature: `v1_10`

## `distance`
pointer to a location for distance, or `None`

# Returns

The previous seen offset.
<!-- impl Adapter::fn prev_pts -->
Get the pts that was before the current byte in the adapter. When
`distance` is given, the amount of bytes between the pts and the current
position is returned.

The pts is reset to GST_CLOCK_TIME_NONE and the distance is set to 0 when
the adapter is first created or when it is cleared. This also means that before
the first byte with a pts is removed from the adapter, the pts
and distance returned are GST_CLOCK_TIME_NONE and 0 respectively.
## `distance`
pointer to location for distance, or `None`

# Returns

The previously seen pts.
<!-- impl Adapter::fn prev_pts_at_offset -->
Get the pts that was before the byte at offset `offset` in the adapter. When
`distance` is given, the amount of bytes between the pts and the current
position is returned.

The pts is reset to GST_CLOCK_TIME_NONE and the distance is set to 0 when
the adapter is first created or when it is cleared. This also means that before
the first byte with a pts is removed from the adapter, the pts
and distance returned are GST_CLOCK_TIME_NONE and 0 respectively.
## `offset`
the offset in the adapter at which to get timestamp
## `distance`
pointer to location for distance, or `None`

# Returns

The previously seen pts at given offset.
<!-- impl Adapter::fn pts_at_discont -->
Get the PTS that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_CLOCK_TIME_NONE.

Feature: `v1_10`


# Returns

The PTS at the last discont or GST_CLOCK_TIME_NONE.
<!-- impl Adapter::fn push -->
Adds the data from `buf` to the data stored inside `self` and takes
ownership of the buffer.
## `buf`
a `gst::Buffer` to add to queue in the adapter
<!-- impl Adapter::fn take -->
Returns a freshly allocated buffer containing the first `nbytes` bytes of the
`self`. The returned bytes will be flushed from the adapter.

Caller owns returned value. g_free after usage.

Free-function: g_free
## `nbytes`
the number of bytes to take

# Returns


 oven-fresh hot data, or `None` if `nbytes` bytes are not available
<!-- impl Adapter::fn take_buffer -->
Returns a `gst::Buffer` containing the first `nbytes` bytes of the
`self`. The returned bytes will be flushed from the adapter.
This function is potentially more performant than
`Adapter::take` since it can reuse the memory in pushed buffers
by subbuffering or merging. This function will always return a
buffer with a single memory region.

Note that no assumptions should be made as to whether certain buffer
flags such as the DISCONT flag are set on the returned buffer, or not.
The caller needs to explicitly set or unset flags that should be set or
unset.

Since 1.6 this will also copy over all GstMeta of the input buffers except
for meta with the `gst::MetaFlags::Pooled` flag or with the "memory" tag.

Caller owns a reference to the returned buffer. `gst::Buffer::unref` after
usage.

Free-function: gst_buffer_unref
## `nbytes`
the number of bytes to take

# Returns

a `gst::Buffer` containing the first
 `nbytes` of the adapter, or `None` if `nbytes` bytes are not available.
 `gst::Buffer::unref` when no longer needed.
<!-- impl Adapter::fn take_buffer_fast -->
Returns a `gst::Buffer` containing the first `nbytes` of the `self`.
The returned bytes will be flushed from the adapter. This function
is potentially more performant than `Adapter::take_buffer` since
it can reuse the memory in pushed buffers by subbuffering or
merging. Unlike `Adapter::take_buffer`, the returned buffer may
be composed of multiple non-contiguous `gst::Memory` objects, no
copies are made.

Note that no assumptions should be made as to whether certain buffer
flags such as the DISCONT flag are set on the returned buffer, or not.
The caller needs to explicitly set or unset flags that should be set or
unset.

This will also copy over all GstMeta of the input buffers except
for meta with the `gst::MetaFlags::Pooled` flag or with the "memory" tag.

This function can return buffer up to the return value of
`Adapter::available` without making copies if possible.

Caller owns a reference to the returned buffer. `gst::Buffer::unref` after
usage.

Free-function: gst_buffer_unref
## `nbytes`
the number of bytes to take

# Returns

a `gst::Buffer` containing the first
 `nbytes` of the adapter, or `None` if `nbytes` bytes are not available.
 `gst::Buffer::unref` when no longer needed.
<!-- impl Adapter::fn take_buffer_list -->
Returns a `gst::BufferList` of buffers containing the first `nbytes` bytes of
the `self`. The returned bytes will be flushed from the adapter.
When the caller can deal with individual buffers, this function is more
performant because no memory should be copied.

Caller owns the returned list. Call `gst::BufferList::unref` to free
the list after usage.
## `nbytes`
the number of bytes to take

# Returns

a `gst::BufferList` of buffers containing
 the first `nbytes` of the adapter, or `None` if `nbytes` bytes are not
 available
<!-- impl Adapter::fn take_list -->
Returns a `glib::List` of buffers containing the first `nbytes` bytes of the
`self`. The returned bytes will be flushed from the adapter.
When the caller can deal with individual buffers, this function is more
performant because no memory should be copied.

Caller owns returned list and contained buffers. `gst::Buffer::unref` each
buffer in the list before freeing the list after usage.
## `nbytes`
the number of bytes to take

# Returns

a `glib::List` of
 buffers containing the first `nbytes` of the adapter, or `None` if `nbytes`
 bytes are not available
<!-- impl Adapter::fn unmap -->
Releases the memory obtained with the last `Adapter::map`.
<!-- struct Aggregator -->
Manages a set of pads with the purpose of aggregating their buffers.
Control is given to the subclass when all pads have data.

 * Base class for mixers and muxers. Subclasses should at least implement
 the `AggregatorClass.aggregate`() virtual method.

 * Installs a `GstPadChainFunction`, a `GstPadEventFullFunction` and a
 `GstPadQueryFunction` to queue all serialized data packets per sink pad.
 Subclasses should not overwrite those, but instead implement
 `AggregatorClass.sink_event`() and `AggregatorClass.sink_query`() as
 needed.

 * When data is queued on all pads, the aggregate vmethod is called.

 * One can peek at the data on any given GstAggregatorPad with the
 gst_aggregator_pad_peek_buffer () method, and remove it from the pad
 with the gst_aggregator_pad_pop_buffer () method. When a buffer
 has been taken with pop_buffer (), a new buffer can be queued
 on that pad.

 * If the subclass wishes to push a buffer downstream in its aggregate
 implementation, it should do so through the
 gst_aggregator_finish_buffer () method. This method will take care
 of sending and ordering mandatory events such as stream start, caps
 and segment.

 * Same goes for EOS events, which should not be pushed directly by the
 subclass, it should instead return GST_FLOW_EOS in its aggregate
 implementation.

 * Note that the aggregator logic regarding gap event handling is to turn
 these into gap buffers with matching PTS and duration. It will also
 flag these buffers with GST_BUFFER_FLAG_GAP and GST_BUFFER_FLAG_DROPPABLE
 to ease their identification and subsequent processing.

 * Subclasses must use (a subclass of) `AggregatorPad` for both their
 sink and source pads.
 See `gst::ElementClass::add_static_pad_template_with_gtype`.

This class used to live in gst-plugins-bad and was moved to core.

Feature: `v1_14`

# Implements

[`AggregatorExt`](trait.AggregatorExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`AggregatorExtManual`](prelude/trait.AggregatorExtManual.html)
<!-- trait AggregatorExt -->
Trait containing all `Aggregator` methods.

Feature: `v1_14`

# Implementors

[`Aggregator`](struct.Aggregator.html)
<!-- trait AggregatorExt::fn finish_buffer -->
This method will push the provided output buffer downstream. If needed,
mandatory events such as stream-start, caps, and segment events will be
sent before pushing the buffer.

Feature: `v1_14`

## `buffer`
the `gst::Buffer` to push.
<!-- trait AggregatorExt::fn get_allocator -->
Lets `Aggregator` sub-classes get the memory `allocator`
acquired by the base class and its `params`.

Unref the `allocator` after use it.

Feature: `v1_14`

## `allocator`
the `gst::Allocator`
used
## `params`
the
`gst::AllocationParams` of `allocator`
<!-- trait AggregatorExt::fn get_buffer_pool -->

Feature: `v1_14`


# Returns

the instance of the `gst::BufferPool` used
by `trans`; free it after use it
<!-- trait AggregatorExt::fn get_latency -->
Retrieves the latency values reported by `self` in response to the latency
query, or `GST_CLOCK_TIME_NONE` if there is not live source connected and the element
will not wait for the clock.

Typically only called by subclasses.

Feature: `v1_14`


# Returns

The latency or `GST_CLOCK_TIME_NONE` if the element does not sync
<!-- trait AggregatorExt::fn negotiate -->
Negotiates src pad caps with downstream elements.
Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again
if `AggregatorClass.negotiate`() fails.

Feature: `v1_18`


# Returns

`true` if the negotiation succeeded, else `false`.
<!-- trait AggregatorExt::fn set_latency -->
Lets `Aggregator` sub-classes tell the baseclass what their internal
latency is. Will also post a LATENCY message on the bus so the pipeline
can reconfigure its global latency.

Feature: `v1_14`

## `min_latency`
minimum latency
## `max_latency`
maximum latency
<!-- trait AggregatorExt::fn set_src_caps -->
Sets the caps to be used on the src pad.

Feature: `v1_14`

## `caps`
The `gst::Caps` to set on the src pad.
<!-- trait AggregatorExt::fn simple_get_next_time -->
This is a simple `AggregatorClass.get_next_time`() implementation that
just looks at the `gst::Segment` on the srcpad of the aggregator and bases
the next time on the running time there.

This is the desired behaviour in most cases where you have a live source
and you have a dead line based aggregator subclass.

Feature: `v1_16`


# Returns

The running time based on the position
<!-- trait AggregatorExt::fn update_segment -->
Subclasses should use this to update the segment on their
source pad, instead of directly pushing new segment events
downstream.

Feature: `v1_18`

<!-- trait AggregatorExt::fn get_property_min_upstream_latency -->
Force minimum upstream latency (in nanoseconds). When sources with a
higher latency are expected to be plugged in dynamically after the
aggregator has started playing, this allows overriding the minimum
latency reported by the initial source(s). This is only taken into
account when larger than the actually reported minimum latency.

Feature: `v1_16`

<!-- trait AggregatorExt::fn set_property_min_upstream_latency -->
Force minimum upstream latency (in nanoseconds). When sources with a
higher latency are expected to be plugged in dynamically after the
aggregator has started playing, this allows overriding the minimum
latency reported by the initial source(s). This is only taken into
account when larger than the actually reported minimum latency.

Feature: `v1_16`

<!-- struct AggregatorPad -->
Pads managed by a `Aggregator` subclass.

This class used to live in gst-plugins-bad and was moved to core.

Feature: `v1_14`

# Implements

[`AggregatorPadExt`](trait.AggregatorPadExt.html), [`gst::PadExt`](../gst/trait.PadExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`AggregatorPadExtManual`](prelude/trait.AggregatorPadExtManual.html)
<!-- trait AggregatorPadExt -->
Trait containing all `AggregatorPad` methods.

Feature: `v1_14`

# Implementors

[`AggregatorPad`](struct.AggregatorPad.html)
<!-- trait AggregatorPadExt::fn drop_buffer -->
Drop the buffer currently queued in `self`.

Feature: `v1_14`


# Returns

TRUE if there was a buffer queued in `self`, or FALSE if not.
<!-- trait AggregatorPadExt::fn has_buffer -->
This checks if a pad has a buffer available that will be returned by
a call to `AggregatorPadExt::peek_buffer` or
`AggregatorPadExt::pop_buffer`.

Feature: `v1_14_1`


# Returns

`true` if the pad has a buffer available as the next thing.
<!-- trait AggregatorPadExt::fn is_eos -->

Feature: `v1_14`


# Returns

`true` if the pad is EOS, otherwise `false`.
<!-- trait AggregatorPadExt::fn peek_buffer -->

Feature: `v1_14`


# Returns

A reference to the buffer in `self` or
NULL if no buffer was queued. You should unref the buffer after
usage.
<!-- trait AggregatorPadExt::fn pop_buffer -->
Steal the ref to the buffer currently queued in `self`.

Feature: `v1_14`


# Returns

The buffer in `self` or NULL if no buffer was
 queued. You should unref the buffer after usage.
<!-- trait AggregatorPadExt::fn get_property_emit_signals -->
Enables the emission of signals such as `AggregatorPad::buffer-consumed`

Feature: `v1_16`

<!-- trait AggregatorPadExt::fn set_property_emit_signals -->
Enables the emission of signals such as `AggregatorPad::buffer-consumed`

Feature: `v1_16`

<!-- enum AggregatorStartTimeSelection -->
<!-- enum AggregatorStartTimeSelection::variant Zero -->
Start at running time 0.
<!-- enum AggregatorStartTimeSelection::variant First -->
Start at the running time of
the first buffer that is received.
<!-- enum AggregatorStartTimeSelection::variant Set -->
Start at the running time
selected by the `start-time` property.

Feature: `v1_18`

<!-- struct BaseParse -->
This base class is for parser elements that process data and splits it
into separate audio/video/whatever frames.

It provides for:

 * provides one sink pad and one source pad
 * handles state changes
 * can operate in pull mode or push mode
 * handles seeking in both modes
 * handles events (SEGMENT/EOS/FLUSH)
 * handles queries (POSITION/DURATION/SEEKING/FORMAT/CONVERT)
 * handles flushing

The purpose of this base class is to provide the basic functionality of
a parser and share a lot of rather complex code.

# Description of the parsing mechanism:

## Set-up phase

 * `BaseParse` calls `BaseParseClass.start`() to inform subclass
 that data processing is about to start now.

 * `BaseParse` class calls `BaseParseClass.set_sink_caps`() to
 inform the subclass about incoming sinkpad caps. Subclass could
 already set the srcpad caps accordingly, but this might be delayed
 until calling `BaseParse::finish_frame` with a non-queued frame.

 * At least at this point subclass needs to tell the `BaseParse` class
 how big data chunks it wants to receive (minimum frame size ). It can
 do this with `BaseParseExt::set_min_frame_size`.

 * `BaseParse` class sets up appropriate data passing mode (pull/push)
 and starts to process the data.

## Parsing phase

 * `BaseParse` gathers at least min_frame_size bytes of data either
 by pulling it from upstream or collecting buffers in an internal
 `Adapter`.

 * A buffer of (at least) min_frame_size bytes is passed to subclass
 with `BaseParseClass.handle_frame`(). Subclass checks the contents
 and can optionally return `gst::FlowReturn::Ok` along with an amount of data
 to be skipped to find a valid frame (which will result in a
 subsequent DISCONT). If, otherwise, the buffer does not hold a
 complete frame, `BaseParseClass.handle_frame`() can merely return
 and will be called again when additional data is available. In push
 mode this amounts to an additional input buffer (thus minimal
 additional latency), in pull mode this amounts to some arbitrary
 reasonable buffer size increase.

 Of course, `BaseParseExt::set_min_frame_size` could also be used if
 a very specific known amount of additional data is required. If,
 however, the buffer holds a complete valid frame, it can pass the
 size of this frame to `BaseParse::finish_frame`.

 If acting as a converter, it can also merely indicate consumed input
 data while simultaneously providing custom output data. Note that
 baseclass performs some processing (such as tracking overall consumed
 data rate versus duration) for each finished frame, but other state
 is only updated upon each call to `BaseParseClass.handle_frame`()
 (such as tracking upstream input timestamp).

 Subclass is also responsible for setting the buffer metadata
 (e.g. buffer timestamp and duration, or keyframe if applicable).
 (although the latter can also be done by `BaseParse` if it is
 appropriately configured, see below). Frame is provided with
 timestamp derived from upstream (as much as generally possible),
 duration obtained from configuration (see below), and offset
 if meaningful (in pull mode).

 Note that `BaseParseClass.handle_frame`() might receive any small
 amount of input data when leftover data is being drained (e.g. at
 EOS).

 * As part of finish frame processing, just prior to actually pushing
 the buffer in question, it is passed to
 `BaseParseClass.pre_push_frame`() which gives subclass yet one last
 chance to examine buffer metadata, or to send some custom (tag)
 events, or to perform custom (segment) filtering.

 * During the parsing process `BaseParseClass` will handle both srcpad
 and sinkpad events. They will be passed to subclass if
 `BaseParseClass.sink_event`() or `BaseParseClass.src_event`()
 implementations have been provided.

## Shutdown phase

* `BaseParse` class calls `BaseParseClass.stop`() to inform the
 subclass that data parsing will be stopped.

Subclass is responsible for providing pad template caps for source and
sink pads. The pads need to be named "sink" and "src". It also needs to
set the fixed caps on srcpad, when the format is ensured (e.g. when
base class calls subclass' `BaseParseClass.set_sink_caps`() function).

This base class uses `gst::Format::Default` as a meaning of frames. So,
subclass conversion routine needs to know that conversion from
`gst::Format::Time` to `gst::Format::Default` must return the
frame number that can be found from the given byte position.

`BaseParse` uses subclasses conversion methods also for seeking (or
otherwise uses its own default one, see also below).

Subclass `start` and `stop` functions will be called to inform the beginning
and end of data processing.

Things that subclass need to take care of:

* Provide pad templates
* Fixate the source pad caps when appropriate
* Inform base class how big data chunks should be retrieved. This is
 done with `BaseParseExt::set_min_frame_size` function.
* Examine data chunks passed to subclass with
 `BaseParseClass.handle_frame`() and pass proper frame(s) to
 `BaseParse::finish_frame`, and setting src pad caps and timestamps
 on frame.
* Provide conversion functions
* Update the duration information with `BaseParse::set_duration`
* Optionally passthrough using `BaseParseExt::set_passthrough`
* Configure various baseparse parameters using
 `BaseParseExt::set_average_bitrate`, `BaseParseExt::set_syncable`
 and `BaseParse::set_frame_rate`.

* In particular, if subclass is unable to determine a duration, but
 parsing (or specs) yields a frames per seconds rate, then this can be
 provided to `BaseParse` to enable it to cater for buffer time
 metadata (which will be taken from upstream as much as
 possible). Internally keeping track of frame durations and respective
 sizes that have been pushed provides `BaseParse` with an estimated
 bitrate. A default `BaseParseClass.convert`() (used if not
 overridden) will then use these rates to perform obvious conversions.
 These rates are also used to update (estimated) duration at regular
 frame intervals.

# Implements

[`BaseParseExt`](trait.BaseParseExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`BaseParseExtManual`](prelude/trait.BaseParseExtManual.html)
<!-- trait BaseParseExt -->
Trait containing all `BaseParse` methods.

# Implementors

[`BaseParse`](struct.BaseParse.html)
<!-- trait BaseParseExt::fn add_index_entry -->
Adds an entry to the index associating `offset` to `ts`. It is recommended
to only add keyframe entries. `force` allows to bypass checks, such as
whether the stream is (upstream) seekable, another entry is already "close"
to the new entry, etc.
## `offset`
offset of entry
## `ts`
timestamp associated with offset
## `key`
whether entry refers to keyframe
## `force`
add entry disregarding sanity checks

# Returns

`gboolean` indicating whether entry was added
<!-- trait BaseParseExt::fn convert_default -->
Default implementation of `BaseParseClass.convert`().
## `src_format`
`gst::Format` describing the source format.
## `src_value`
Source value to be converted.
## `dest_format`
`gst::Format` defining the converted format.
## `dest_value`
Pointer where the conversion result will be put.

# Returns

`true` if conversion was successful.
<!-- trait BaseParseExt::fn drain -->
Drains the adapter until it is empty. It decreases the min_frame_size to
match the current adapter size and calls chain method until the adapter
is emptied or chain returns with error.

Feature: `v1_12`

<!-- trait BaseParseExt::fn finish_frame -->
Collects parsed data and pushes this downstream.
Source pad caps must be set when this is called.

If `frame`'s out_buffer is set, that will be used as subsequent frame data.
Otherwise, `size` samples will be taken from the input and used for output,
and the output's metadata (timestamps etc) will be taken as (optionally)
set by the subclass on `frame`'s (input) buffer (which is otherwise
ignored for any but the above purpose/information).

Note that the latter buffer is invalidated by this call, whereas the
caller retains ownership of `frame`.
## `frame`
a `BaseParseFrame`
## `size`
consumed input data represented by frame

# Returns

a `gst::FlowReturn` that should be escalated to caller (of caller)
<!-- trait BaseParseExt::fn merge_tags -->
Sets the parser subclass's tags and how they should be merged with any
upstream stream tags. This will override any tags previously-set
with `BaseParseExt::merge_tags`.

Note that this is provided for convenience, and the subclass is
not required to use this and can still do tag handling on its own.
## `tags`
a `gst::TagList` to merge, or NULL to unset
 previously-set tags
## `mode`
the `gst::TagMergeMode` to use, usually `gst::TagMergeMode::Replace`
<!-- trait BaseParseExt::fn push_frame -->
Pushes the frame's buffer downstream, sends any pending events and
does some timestamp and segment handling. Takes ownership of
frame's buffer, though caller retains ownership of `frame`.

This must be called with sinkpad STREAM_LOCK held.
## `frame`
a `BaseParseFrame`

# Returns

`gst::FlowReturn`
<!-- trait BaseParseExt::fn set_average_bitrate -->
Optionally sets the average bitrate detected in media (if non-zero),
e.g. based on metadata, as it will be posted to the application.

By default, announced average bitrate is estimated. The average bitrate
is used to estimate the total duration of the stream and to estimate
a seek position, if there's no index and the format is syncable
(see `BaseParseExt::set_syncable`).
## `bitrate`
average bitrate in bits/second
<!-- trait BaseParseExt::fn set_duration -->
Sets the duration of the currently playing media. Subclass can use this
when it is able to determine duration and/or notices a change in the media
duration. Alternatively, if `interval` is non-zero (default), then stream
duration is determined based on estimated bitrate, and updated every `interval`
frames.
## `fmt`
`gst::Format`.
## `duration`
duration value.
## `interval`
how often to update the duration estimate based on bitrate, or 0.
<!-- trait BaseParseExt::fn set_frame_rate -->
If frames per second is configured, parser can take care of buffer duration
and timestamping. When performing segment clipping, or seeking to a specific
location, a corresponding decoder might need an initial `lead_in` and a
following `lead_out` number of frames to ensure the desired segment is
entirely filled upon decoding.
## `fps_num`
frames per second (numerator).
## `fps_den`
frames per second (denominator).
## `lead_in`
frames needed before a segment for subsequent decode
## `lead_out`
frames needed after a segment
<!-- trait BaseParseExt::fn set_has_timing_info -->
Set if frames carry timing information which the subclass can (generally)
parse and provide. In particular, intrinsic (rather than estimated) time
can be obtained following a seek.
## `has_timing`
whether frames carry timing information
<!-- trait BaseParseExt::fn set_infer_ts -->
By default, the base class might try to infer PTS from DTS and vice
versa. While this is generally correct for audio data, it may not
be otherwise. Sub-classes implementing such formats should disable
timestamp inferring.
## `infer_ts`
`true` if parser should infer DTS/PTS from each other
<!-- trait BaseParseExt::fn set_latency -->
Sets the minimum and maximum (which may likely be equal) latency introduced
by the parsing process. If there is such a latency, which depends on the
particular parsing of the format, it typically corresponds to 1 frame duration.
## `min_latency`
minimum parse latency
## `max_latency`
maximum parse latency
<!-- trait BaseParseExt::fn set_min_frame_size -->
Subclass can use this function to tell the base class that it needs to
be given buffers of at least `min_size` bytes.
## `min_size`
Minimum size in bytes of the data that this base class should
 give to subclass.
<!-- trait BaseParseExt::fn set_passthrough -->
Set if the nature of the format or configuration does not allow (much)
parsing, and the parser should operate in passthrough mode (which only
applies when operating in push mode). That is, incoming buffers are
pushed through unmodified, i.e. no `BaseParseClass.handle_frame`()
will be invoked, but `BaseParseClass.pre_push_frame`() will still be
invoked, so subclass can perform as much or as little is appropriate for
passthrough semantics in `BaseParseClass.pre_push_frame`().
## `passthrough`
`true` if parser should run in passthrough mode
<!-- trait BaseParseExt::fn set_pts_interpolation -->
By default, the base class will guess PTS timestamps using a simple
interpolation (previous timestamp + duration), which is incorrect for
data streams with reordering, where PTS can go backward. Sub-classes
implementing such formats should disable PTS interpolation.
## `pts_interpolate`
`true` if parser should interpolate PTS timestamps
<!-- trait BaseParseExt::fn set_syncable -->
Set if frame starts can be identified. This is set by default and
determines whether seeking based on bitrate averages
is possible for a format/stream.
## `syncable`
set if frame starts can be identified
<!-- trait BaseParseExt::fn set_ts_at_offset -->
This function should only be called from a `handle_frame` implementation.

`BaseParse` creates initial timestamps for frames by using the last
timestamp seen in the stream before the frame starts. In certain
cases, the correct timestamps will occur in the stream after the
start of the frame, but before the start of the actual picture data.
This function can be used to set the timestamps based on the offset
into the frame data that the picture starts.
## `offset`
offset into current buffer
<!-- trait BaseParseExt::fn get_property_disable_passthrough -->
If set to `true`, baseparse will unconditionally force parsing of the
incoming data. This can be required in the rare cases where the incoming
side-data (caps, pts, dts, ...) is not trusted by the user and wants to
force validation and parsing of the incoming data.
If set to `false`, decision of whether to parse the data or not is up to
the implementation (standard behaviour).
<!-- trait BaseParseExt::fn set_property_disable_passthrough -->
If set to `true`, baseparse will unconditionally force parsing of the
incoming data. This can be required in the rare cases where the incoming
side-data (caps, pts, dts, ...) is not trusted by the user and wants to
force validation and parsing of the incoming data.
If set to `false`, decision of whether to parse the data or not is up to
the implementation (standard behaviour).
<!-- struct BaseParseFrame -->
Frame (context) data passed to each frame parsing virtual methods. In
addition to providing the data to be checked for a valid frame or an already
identified frame, it conveys additional metadata or control information
from and to the subclass w.r.t. the particular frame in question (rather
than global parameters). Some of these may apply to each parsing stage, others
only to some a particular one. These parameters are effectively zeroed at start
of each frame's processing, i.e. parsing virtual method invocation sequence.
<!-- impl BaseParseFrame::fn new -->
Allocates a new `BaseParseFrame`. This function is mainly for bindings,
elements written in C should usually allocate the frame on the stack and
then use `BaseParseFrame::init` to initialise it.
## `buffer`
a `gst::Buffer`
## `flags`
the flags
## `overhead`
number of bytes in this frame which should be counted as
 metadata overhead, ie. not used to calculate the average bitrate.
 Set to -1 to mark the entire frame as metadata. If in doubt, set to 0.

# Returns

a newly-allocated `BaseParseFrame`. Free with
 `BaseParseFrame::free` when no longer needed.
<!-- impl BaseParseFrame::fn copy -->
Copies a `BaseParseFrame`.

Feature: `v1_12_1`


# Returns

A copy of `self`
<!-- impl BaseParseFrame::fn free -->
Frees the provided `self`.
<!-- impl BaseParseFrame::fn init -->
Sets a `BaseParseFrame` to initial state. Currently this means
all public fields are zero-ed and a private flag is set to make
sure `BaseParseFrame::free` only frees the contents but not
the actual frame. Use this function to initialise a `BaseParseFrame`
allocated on the stack.
<!-- struct BaseParseFrameFlags -->
Flags to be used in a `BaseParseFrame`.
<!-- struct BaseParseFrameFlags::const NONE -->
no flag
<!-- struct BaseParseFrameFlags::const NEW_FRAME -->
set by baseclass if current frame
 is passed for processing to the subclass for the first time
 (and not set on subsequent calls with same data).
<!-- struct BaseParseFrameFlags::const NO_FRAME -->
set to indicate this buffer should not be
 counted as frame, e.g. if this frame is dependent on a previous one.
 As it is not counted as a frame, bitrate increases but frame to time
 conversions are maintained.
<!-- struct BaseParseFrameFlags::const CLIP -->
`pre_push_frame` can set this to indicate
 that regular segment clipping can still be performed (as opposed to
 any custom one having been done).
<!-- struct BaseParseFrameFlags::const DROP -->
indicates to `finish_frame` that the
 the frame should be dropped (and might be handled internally by subclass)
<!-- struct BaseParseFrameFlags::const QUEUE -->
indicates to `finish_frame` that the
 the frame should be queued for now and processed fully later
 when the first non-queued frame is finished
<!-- struct BaseSink -->
`BaseSink` is the base class for sink elements in GStreamer, such as
xvimagesink or filesink. It is a layer on top of `gst::Element` that provides a
simplified interface to plugin writers. `BaseSink` handles many details
for you, for example: preroll, clock synchronization, state changes,
activation in push or pull mode, and queries.

In most cases, when writing sink elements, there is no need to implement
class methods from `gst::Element` or to set functions on pads, because the
`BaseSink` infrastructure should be sufficient.

`BaseSink` provides support for exactly one sink pad, which should be
named "sink". A sink implementation (subclass of `BaseSink`) should
install a pad template in its class_init function, like so:

```C
static void
my_element_class_init (GstMyElementClass *klass)
{
  GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);

  // sinktemplate should be a #GstStaticPadTemplate with direction
  // %GST_PAD_SINK and name "sink"
  gst_element_class_add_static_pad_template (gstelement_class, &amp;sinktemplate);

  gst_element_class_set_static_metadata (gstelement_class,
      "Sink name",
      "Sink",
      "My Sink element",
      "The author <my.sink@my.email>");
}
```

`BaseSink` will handle the prerolling correctly. This means that it will
return `gst::StateChangeReturn::Async` from a state change to PAUSED until the first
buffer arrives in this element. The base class will call the
`BaseSinkClass.preroll`() vmethod with this preroll buffer and will then
commit the state change to the next asynchronously pending state.

When the element is set to PLAYING, `BaseSink` will synchronise on the
clock using the times returned from `BaseSinkClass.get_times`(). If this
function returns `GST_CLOCK_TIME_NONE` for the start time, no synchronisation
will be done. Synchronisation can be disabled entirely by setting the object
`BaseSink:sync` property to `false`.

After synchronisation the virtual method `BaseSinkClass.render`() will be
called. Subclasses should minimally implement this method.

Subclasses that synchronise on the clock in the `BaseSinkClass.render`()
method are supported as well. These classes typically receive a buffer in
the render method and can then potentially block on the clock while
rendering. A typical example is an audiosink.
These subclasses can use `BaseSink::wait_preroll` to perform the
blocking wait.

Upon receiving the EOS event in the PLAYING state, `BaseSink` will wait
for the clock to reach the time indicated by the stop time of the last
`BaseSinkClass.get_times`() call before posting an EOS message. When the
element receives EOS in PAUSED, preroll completes, the event is queued and an
EOS message is posted when going to PLAYING.

`BaseSink` will internally use the `gst::EventType::Segment` events to schedule
synchronisation and clipping of buffers. Buffers that fall completely outside
of the current segment are dropped. Buffers that fall partially in the
segment are rendered (and prerolled). Subclasses should do any subbuffer
clipping themselves when needed.

`BaseSink` will by default report the current playback position in
`gst::Format::Time` based on the current clock time and segment information.
If no clock has been set on the element, the query will be forwarded
upstream.

The `BaseSinkClass.set_caps`() function will be called when the subclass
should configure itself to process a specific media type.

The `BaseSinkClass.start`() and `BaseSinkClass.stop`() virtual methods
will be called when resources should be allocated. Any
`BaseSinkClass.preroll`(), `BaseSinkClass.render`() and
`BaseSinkClass.set_caps`() function will be called between the
`BaseSinkClass.start`() and `BaseSinkClass.stop`() calls.

The `BaseSinkClass.event`() virtual method will be called when an event is
received by `BaseSink`. Normally this method should only be overridden by
very specific elements (such as file sinks) which need to handle the
newsegment event specially.

The `BaseSinkClass.unlock`() method is called when the elements should
unblock any blocking operations they perform in the
`BaseSinkClass.render`() method. This is mostly useful when the
`BaseSinkClass.render`() method performs a blocking write on a file
descriptor, for example.

The `BaseSink:max-lateness` property affects how the sink deals with
buffers that arrive too late in the sink. A buffer arrives too late in the
sink when the presentation time (as a combination of the last segment, buffer
timestamp and element base_time) plus the duration is before the current
time of the clock.
If the frame is later than max-lateness, the sink will drop the buffer
without calling the render method.
This feature is disabled if sync is disabled, the
`BaseSinkClass.get_times`() method does not return a valid start time or
max-lateness is set to -1 (the default).
Subclasses can use `BaseSinkExt::set_max_lateness` to configure the
max-lateness value.

The `BaseSink:qos` property will enable the quality-of-service features of
the basesink which gather statistics about the real-time performance of the
clock synchronisation. For each buffer received in the sink, statistics are
gathered and a QOS event is sent upstream with these numbers. This
information can then be used by upstream elements to reduce their processing
rate, for example.

The `BaseSink:async` property can be used to instruct the sink to never
perform an ASYNC state change. This feature is mostly usable when dealing
with non-synchronized streams or sparse streams.

# Implements

[`BaseSinkExt`](trait.BaseSinkExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`BaseSinkExtManual`](prelude/trait.BaseSinkExtManual.html)
<!-- trait BaseSinkExt -->
Trait containing all `BaseSink` methods.

# Implementors

[`BaseSink`](struct.BaseSink.html)
<!-- trait BaseSinkExt::fn do_preroll -->
If the `self` spawns its own thread for pulling buffers from upstream it
should call this method after it has pulled a buffer. If the element needed
to preroll, this function will perform the preroll and will then block
until the element state is changed.

This function should be called with the PREROLL_LOCK held.
## `obj`
the mini object that caused the preroll

# Returns

`gst::FlowReturn::Ok` if the preroll completed and processing can
continue. Any other return value should be returned from the render vmethod.
<!-- trait BaseSinkExt::fn get_blocksize -->
Get the number of bytes that the sink will pull when it is operating in pull
mode.

# Returns

the number of bytes `self` will pull in pull mode.
<!-- trait BaseSinkExt::fn get_drop_out_of_segment -->
Checks if `self` is currently configured to drop buffers which are outside
the current segment

Feature: `v1_12`


# Returns

`true` if the sink is configured to drop buffers outside the
current segment.
<!-- trait BaseSinkExt::fn get_last_sample -->
Get the last sample that arrived in the sink and was used for preroll or for
rendering. This property can be used to generate thumbnails.

The `gst::Caps` on the sample can be used to determine the type of the buffer.

Free-function: gst_sample_unref

# Returns

a `gst::Sample`. `gst::Sample::unref` after
 usage. This function returns `None` when no buffer has arrived in the
 sink yet or when the sink is not in PAUSED or PLAYING.
<!-- trait BaseSinkExt::fn get_latency -->
Get the currently configured latency.

# Returns

The configured latency.
<!-- trait BaseSinkExt::fn get_max_bitrate -->
Get the maximum amount of bits per second that the sink will render.

# Returns

the maximum number of bits per second `self` will render.
<!-- trait BaseSinkExt::fn get_max_lateness -->
Gets the max lateness value. See `BaseSinkExt::set_max_lateness` for
more details.

# Returns

The maximum time in nanoseconds that a buffer can be late
before it is dropped and not rendered. A value of -1 means an
unlimited time.
<!-- trait BaseSinkExt::fn get_processing_deadline -->
Get the processing deadline of `self`. see
`BaseSinkExt::set_processing_deadline` for more information about
the processing deadline.

Feature: `v1_16`


# Returns

the processing deadline
<!-- trait BaseSinkExt::fn get_render_delay -->
Get the render delay of `self`. see `BaseSinkExt::set_render_delay` for more
information about the render delay.

# Returns

the render delay of `self`.
<!-- trait BaseSinkExt::fn get_stats -->
Return various `BaseSink` statistics. This function returns a `gst::Structure`
with name `application/x-gst-base-sink-stats` with the following fields:

- "average-rate" G_TYPE_DOUBLE average frame rate
- "dropped" G_TYPE_UINT64 Number of dropped frames
- "rendered" G_TYPE_UINT64 Number of rendered frames

Feature: `v1_18`


# Returns

pointer to `gst::Structure`
<!-- trait BaseSinkExt::fn get_sync -->
Checks if `self` is currently configured to synchronize against the
clock.

# Returns

`true` if the sink is configured to synchronize against the clock.
<!-- trait BaseSinkExt::fn get_throttle_time -->
Get the time that will be inserted between frames to control the
maximum buffers per second.

# Returns

the number of nanoseconds `self` will put between frames.
<!-- trait BaseSinkExt::fn get_ts_offset -->
Get the synchronisation offset of `self`.

# Returns

The synchronisation offset.
<!-- trait BaseSinkExt::fn is_async_enabled -->
Checks if `self` is currently configured to perform asynchronous state
changes to PAUSED.

# Returns

`true` if the sink is configured to perform asynchronous state
changes.
<!-- trait BaseSinkExt::fn is_last_sample_enabled -->
Checks if `self` is currently configured to store the last received sample in
the last-sample property.

# Returns

`true` if the sink is configured to store the last received sample.
<!-- trait BaseSinkExt::fn is_qos_enabled -->
Checks if `self` is currently configured to send Quality-of-Service events
upstream.

# Returns

`true` if the sink is configured to perform Quality-of-Service.
<!-- trait BaseSinkExt::fn query_latency -->
Query the sink for the latency parameters. The latency will be queried from
the upstream elements. `live` will be `true` if `self` is configured to
synchronize against the clock. `upstream_live` will be `true` if an upstream
element is live.

If both `live` and `upstream_live` are `true`, the sink will want to compensate
for the latency introduced by the upstream elements by setting the
`min_latency` to a strictly positive value.

This function is mostly used by subclasses.
## `live`
if the sink is live
## `upstream_live`
if an upstream element is live
## `min_latency`
the min latency of the upstream elements
## `max_latency`
the max latency of the upstream elements

# Returns

`true` if the query succeeded.
<!-- trait BaseSinkExt::fn set_async_enabled -->
Configures `self` to perform all state changes asynchronously. When async is
disabled, the sink will immediately go to PAUSED instead of waiting for a
preroll buffer. This feature is useful if the sink does not synchronize
against the clock or when it is dealing with sparse streams.
## `enabled`
the new async value.
<!-- trait BaseSinkExt::fn set_blocksize -->
Set the number of bytes that the sink will pull when it is operating in pull
mode.
## `blocksize`
the blocksize in bytes
<!-- trait BaseSinkExt::fn set_drop_out_of_segment -->
Configure `self` to drop buffers which are outside the current segment

Feature: `v1_12`

## `drop_out_of_segment`
drop buffers outside the segment
<!-- trait BaseSinkExt::fn set_last_sample_enabled -->
Configures `self` to store the last received sample in the last-sample
property.
## `enabled`
the new enable-last-sample value.
<!-- trait BaseSinkExt::fn set_max_bitrate -->
Set the maximum amount of bits per second that the sink will render.
## `max_bitrate`
the max_bitrate in bits per second
<!-- trait BaseSinkExt::fn set_max_lateness -->
Sets the new max lateness value to `max_lateness`. This value is
used to decide if a buffer should be dropped or not based on the
buffer timestamp and the current clock time. A value of -1 means
an unlimited time.
## `max_lateness`
the new max lateness value.
<!-- trait BaseSinkExt::fn set_processing_deadline -->
Maximum amount of time (in nanoseconds) that the pipeline can take
for processing the buffer. This is added to the latency of live
pipelines.

This function is usually called by subclasses.

Feature: `v1_16`

## `processing_deadline`
the new processing deadline in nanoseconds.
<!-- trait BaseSinkExt::fn set_qos_enabled -->
Configures `self` to send Quality-of-Service events upstream.
## `enabled`
the new qos value.
<!-- trait BaseSinkExt::fn set_render_delay -->
Set the render delay in `self` to `delay`. The render delay is the time
between actual rendering of a buffer and its synchronisation time. Some
devices might delay media rendering which can be compensated for with this
function.

After calling this function, this sink will report additional latency and
other sinks will adjust their latency to delay the rendering of their media.

This function is usually called by subclasses.
## `delay`
the new delay
<!-- trait BaseSinkExt::fn set_sync -->
Configures `self` to synchronize on the clock or not. When
`sync` is `false`, incoming samples will be played as fast as
possible. If `sync` is `true`, the timestamps of the incoming
buffers will be used to schedule the exact render time of its
contents.
## `sync`
the new sync value.
<!-- trait BaseSinkExt::fn set_throttle_time -->
Set the time that will be inserted between rendered buffers. This
can be used to control the maximum buffers per second that the sink
will render.
## `throttle`
the throttle time in nanoseconds
<!-- trait BaseSinkExt::fn set_ts_offset -->
Adjust the synchronisation of `self` with `offset`. A negative value will
render buffers earlier than their timestamp. A positive value will delay
rendering. This function can be used to fix playback of badly timestamped
buffers.
## `offset`
the new offset
<!-- trait BaseSinkExt::fn wait -->
This function will wait for preroll to complete and will then block until `time`
is reached. It is usually called by subclasses that use their own internal
synchronisation but want to let some synchronization (like EOS) be handled
by the base class.

This function should only be called with the PREROLL_LOCK held (like when
receiving an EOS event in the ::event vmethod or when handling buffers in
::render).

The `time` argument should be the running_time of when the timeout should happen
and will be adjusted with any latency and offset configured in the sink.
## `time`
the running_time to be reached
## `jitter`
the jitter to be filled with time diff, or `None`

# Returns

`gst::FlowReturn`
<!-- trait BaseSinkExt::fn wait_clock -->
This function will block until `time` is reached. It is usually called by
subclasses that use their own internal synchronisation.

If `time` is not valid, no synchronisation is done and `gst::ClockReturn::Badtime` is
returned. Likewise, if synchronisation is disabled in the element or there
is no clock, no synchronisation is done and `gst::ClockReturn::Badtime` is returned.

This function should only be called with the PREROLL_LOCK held, like when
receiving an EOS event in the `BaseSinkClass.event`() vmethod or when
receiving a buffer in
the `BaseSinkClass.render`() vmethod.

The `time` argument should be the running_time of when this method should
return and is not adjusted with any latency or offset configured in the
sink.
## `time`
the running_time to be reached
## `jitter`
the jitter to be filled with time diff, or `None`

# Returns

`gst::ClockReturn`
<!-- trait BaseSinkExt::fn wait_preroll -->
If the `BaseSinkClass.render`() method performs its own synchronisation
against the clock it must unblock when going from PLAYING to the PAUSED state
and call this method before continuing to render the remaining data.

If the `BaseSinkClass.render`() method can block on something else than
the clock, it must also be ready to unblock immediately on
the `BaseSinkClass.unlock`() method and cause the
`BaseSinkClass.render`() method to immediately call this function.
In this case, the subclass must be prepared to continue rendering where it
left off if this function returns `gst::FlowReturn::Ok`.

This function will block until a state change to PLAYING happens (in which
case this function returns `gst::FlowReturn::Ok`) or the processing must be stopped due
to a state change to READY or a FLUSH event (in which case this function
returns `gst::FlowReturn::Flushing`).

This function should only be called with the PREROLL_LOCK held, like in the
render function.

# Returns

`gst::FlowReturn::Ok` if the preroll completed and processing can
continue. Any other return value should be returned from the render vmethod.
<!-- trait BaseSinkExt::fn get_property_async -->
If set to `true`, the basesink will perform asynchronous state changes.
When set to `false`, the sink will not signal the parent when it prerolls.
Use this option when dealing with sparse streams or when synchronisation is
not required.
<!-- trait BaseSinkExt::fn set_property_async -->
If set to `true`, the basesink will perform asynchronous state changes.
When set to `false`, the sink will not signal the parent when it prerolls.
Use this option when dealing with sparse streams or when synchronisation is
not required.
<!-- trait BaseSinkExt::fn get_property_blocksize -->
The amount of bytes to pull when operating in pull mode.
<!-- trait BaseSinkExt::fn set_property_blocksize -->
The amount of bytes to pull when operating in pull mode.
<!-- trait BaseSinkExt::fn get_property_enable_last_sample -->
Enable the last-sample property. If `false`, basesink doesn't keep a
reference to the last buffer arrived and the last-sample property is always
set to `None`. This can be useful if you need buffers to be released as soon
as possible, eg. if you're using a buffer pool.
<!-- trait BaseSinkExt::fn set_property_enable_last_sample -->
Enable the last-sample property. If `false`, basesink doesn't keep a
reference to the last buffer arrived and the last-sample property is always
set to `None`. This can be useful if you need buffers to be released as soon
as possible, eg. if you're using a buffer pool.
<!-- trait BaseSinkExt::fn get_property_last_sample -->
The last buffer that arrived in the sink and was used for preroll or for
rendering. This property can be used to generate thumbnails. This property
can be `None` when the sink has not yet received a buffer.
<!-- trait BaseSinkExt::fn get_property_max_bitrate -->
Control the maximum amount of bits that will be rendered per second.
Setting this property to a value bigger than 0 will make the sink delay
rendering of the buffers when it would exceed to max-bitrate.
<!-- trait BaseSinkExt::fn set_property_max_bitrate -->
Control the maximum amount of bits that will be rendered per second.
Setting this property to a value bigger than 0 will make the sink delay
rendering of the buffers when it would exceed to max-bitrate.
<!-- trait BaseSinkExt::fn get_property_processing_deadline -->
Maximum amount of time (in nanoseconds) that the pipeline can take
for processing the buffer. This is added to the latency of live
pipelines.

Feature: `v1_16`

<!-- trait BaseSinkExt::fn set_property_processing_deadline -->
Maximum amount of time (in nanoseconds) that the pipeline can take
for processing the buffer. This is added to the latency of live
pipelines.

Feature: `v1_16`

<!-- trait BaseSinkExt::fn get_property_render_delay -->
The additional delay between synchronisation and actual rendering of the
media. This property will add additional latency to the device in order to
make other sinks compensate for the delay.
<!-- trait BaseSinkExt::fn set_property_render_delay -->
The additional delay between synchronisation and actual rendering of the
media. This property will add additional latency to the device in order to
make other sinks compensate for the delay.
<!-- trait BaseSinkExt::fn get_property_stats -->
Various `BaseSink` statistics. This property returns a `gst::Structure`
with name `application/x-gst-base-sink-stats` with the following fields:

- "average-rate" G_TYPE_DOUBLE average frame rate
- "dropped" G_TYPE_UINT64 Number of dropped frames
- "rendered" G_TYPE_UINT64 Number of rendered frames

Feature: `v1_18`

<!-- trait BaseSinkExt::fn get_property_throttle_time -->
The time to insert between buffers. This property can be used to control
the maximum amount of buffers per second to render. Setting this property
to a value bigger than 0 will make the sink create THROTTLE QoS events.
<!-- trait BaseSinkExt::fn set_property_throttle_time -->
The time to insert between buffers. This property can be used to control
the maximum amount of buffers per second to render. Setting this property
to a value bigger than 0 will make the sink create THROTTLE QoS events.
<!-- trait BaseSinkExt::fn get_property_ts_offset -->
Controls the final synchronisation, a negative value will render the buffer
earlier while a positive value delays playback. This property can be
used to fix synchronisation in bad files.
<!-- trait BaseSinkExt::fn set_property_ts_offset -->
Controls the final synchronisation, a negative value will render the buffer
earlier while a positive value delays playback. This property can be
used to fix synchronisation in bad files.
<!-- struct BaseSrc -->
This is a generic base class for source elements. The following
types of sources are supported:

 * random access sources like files
 * seekable sources
 * live sources

The source can be configured to operate in any `gst::Format` with the
`BaseSrcExt::set_format` method. The currently set format determines
the format of the internal `gst::Segment` and any `gst::EventType::Segment`
events. The default format for `BaseSrc` is `gst::Format::Bytes`.

`BaseSrc` always supports push mode scheduling. If the following
conditions are met, it also supports pull mode scheduling:

 * The format is set to `gst::Format::Bytes` (default).
 * `BaseSrcClass.is_seekable`() returns `true`.

If all the conditions are met for operating in pull mode, `BaseSrc` is
automatically seekable in push mode as well. The following conditions must
be met to make the element seekable in push mode when the format is not
`gst::Format::Bytes`:

* `BaseSrcClass.is_seekable`() returns `true`.
* `BaseSrcClass.query`() can convert all supported seek formats to the
 internal format as set with `BaseSrcExt::set_format`.
* `BaseSrcClass.do_seek`() is implemented, performs the seek and returns
 `true`.

When the element does not meet the requirements to operate in pull mode, the
offset and length in the `BaseSrcClass.create`() method should be ignored.
It is recommended to subclass `PushSrc` instead, in this situation. If the
element can operate in pull mode but only with specific offsets and
lengths, it is allowed to generate an error when the wrong values are passed
to the `BaseSrcClass.create`() function.

`BaseSrc` has support for live sources. Live sources are sources that when
paused discard data, such as audio or video capture devices. A typical live
source also produces data at a fixed rate and thus provides a clock to publish
this rate.
Use `BaseSrcExt::set_live` to activate the live source mode.

A live source does not produce data in the PAUSED state. This means that the
`BaseSrcClass.create`() method will not be called in PAUSED but only in
PLAYING. To signal the pipeline that the element will not produce data, the
return value from the READY to PAUSED state will be
`gst::StateChangeReturn::NoPreroll`.

A typical live source will timestamp the buffers it creates with the
current running time of the pipeline. This is one reason why a live source
can only produce data in the PLAYING state, when the clock is actually
distributed and running.

Live sources that synchronize and block on the clock (an audio source, for
example) can use `BaseSrc::wait_playing` when the
`BaseSrcClass.create`() function was interrupted by a state change to
PAUSED.

The `BaseSrcClass.get_times`() method can be used to implement pseudo-live
sources. It only makes sense to implement the `BaseSrcClass.get_times`()
function if the source is a live source. The `BaseSrcClass.get_times`()
function should return timestamps starting from 0, as if it were a non-live
source. The base class will make sure that the timestamps are transformed
into the current running_time. The base source will then wait for the
calculated running_time before pushing out the buffer.

For live sources, the base class will by default report a latency of 0.
For pseudo live sources, the base class will by default measure the difference
between the first buffer timestamp and the start time of get_times and will
report this value as the latency.
Subclasses should override the query function when this behaviour is not
acceptable.

There is only support in `BaseSrc` for exactly one source pad, which
should be named "src". A source implementation (subclass of `BaseSrc`)
should install a pad template in its class_init function, like so:

```C
static void
my_element_class_init (GstMyElementClass *klass)
{
  GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
  // srctemplate should be a #GstStaticPadTemplate with direction
  // %GST_PAD_SRC and name "src"
  gst_element_class_add_static_pad_template (gstelement_class, &amp;srctemplate);

  gst_element_class_set_static_metadata (gstelement_class,
     "Source name",
     "Source",
     "My Source element",
     "The author <my.sink@my.email>");
}
```

## Controlled shutdown of live sources in applications

Applications that record from a live source may want to stop recording
in a controlled way, so that the recording is stopped, but the data
already in the pipeline is processed to the end (remember that many live
sources would go on recording forever otherwise). For that to happen the
application needs to make the source stop recording and send an EOS
event down the pipeline. The application would then wait for an
EOS message posted on the pipeline's bus to know when all data has
been processed and the pipeline can safely be stopped.

An application may send an EOS event to a source element to make it
perform the EOS logic (send EOS event downstream or post a
`gst::MessageType::SegmentDone` on the bus). This can typically be done
with the `gst::ElementExt::send_event` function on the element or its parent bin.

After the EOS has been sent to the element, the application should wait for
an EOS message to be posted on the pipeline's bus. Once this EOS message is
received, it may safely shut down the entire pipeline.

# Implements

[`BaseSrcExt`](trait.BaseSrcExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`BaseSrcExtManual`](prelude/trait.BaseSrcExtManual.html)
<!-- trait BaseSrcExt -->
Trait containing all `BaseSrc` methods.

# Implementors

[`BaseSrc`](struct.BaseSrc.html), [`PushSrc`](struct.PushSrc.html)
<!-- trait BaseSrcExt::fn get_allocator -->
Lets `BaseSrc` sub-classes to know the memory `allocator`
used by the base class and its `params`.

Unref the `allocator` after usage.
## `allocator`
the `gst::Allocator`
used
## `params`
the
`gst::AllocationParams` of `allocator`
<!-- trait BaseSrcExt::fn get_blocksize -->
Get the number of bytes that `self` will push out with each buffer.

# Returns

the number of bytes pushed with each buffer.
<!-- trait BaseSrcExt::fn get_buffer_pool -->

# Returns

the instance of the `gst::BufferPool` used
by the src; unref it after usage.
<!-- trait BaseSrcExt::fn get_do_timestamp -->
Query if `self` timestamps outgoing buffers based on the current running_time.

# Returns

`true` if the base class will automatically timestamp outgoing buffers.
<!-- trait BaseSrcExt::fn is_async -->
Get the current async behaviour of `self`. See also `BaseSrcExt::set_async`.

# Returns

`true` if `self` is operating in async mode.
<!-- trait BaseSrcExt::fn is_live -->
Check if an element is in live mode.

# Returns

`true` if element is in live mode.
<!-- trait BaseSrcExt::fn negotiate -->
Negotiates src pad caps with downstream elements.
Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in any case. But marks it again
if `BaseSrcClass.negotiate`() fails.

Do not call this in the `BaseSrcClass.fill`() vmethod. Call this in
`BaseSrcClass.create`() or in `BaseSrcClass.alloc`(), _before_ any
buffer is allocated.

Feature: `v1_18`


# Returns

`true` if the negotiation succeeded, else `false`.
<!-- trait BaseSrcExt::fn new_seamless_segment -->
Prepare a new seamless segment for emission downstream. This function must
only be called by derived sub-classes, and only from the `BaseSrcClass::create` function,
as the stream-lock needs to be held.

The format for the new segment will be the current format of the source, as
configured with `BaseSrcExt::set_format`
## `start`
The new start value for the segment
## `stop`
Stop value for the new segment
## `time`
The new time value for the start of the new segment

# Returns

`true` if preparation of the seamless segment succeeded.
<!-- trait BaseSrcExt::fn query_latency -->
Query the source for the latency parameters. `live` will be `true` when `self` is
configured as a live source. `min_latency` and `max_latency` will be set
to the difference between the running time and the timestamp of the first
buffer.

This function is mostly used by subclasses.
## `live`
if the source is live
## `min_latency`
the min latency of the source
## `max_latency`
the max latency of the source

# Returns

`true` if the query succeeded.
<!-- trait BaseSrcExt::fn set_async -->
Configure async behaviour in `self`, no state change will block. The open,
close, start, stop, play and pause virtual methods will be executed in a
different thread and are thus allowed to perform blocking operations. Any
blocking operation should be unblocked with the unlock vmethod.
## `async`
new async mode
<!-- trait BaseSrcExt::fn set_automatic_eos -->
If `automatic_eos` is `true`, `self` will automatically go EOS if a buffer
after the total size is returned. By default this is `true` but sources
that can't return an authoritative size and only know that they're EOS
when trying to read more should set this to `false`.

When `self` operates in `gst::Format::Time`, `BaseSrc` will send an EOS
when a buffer outside of the currently configured segment is pushed if
`automatic_eos` is `true`. Since 1.16, if `automatic_eos` is `false` an
EOS will be pushed only when the `BaseSrcClass.create`() implementation
returns `gst::FlowReturn::Eos`.
## `automatic_eos`
automatic eos
<!-- trait BaseSrcExt::fn set_blocksize -->
Set the number of bytes that `self` will push out with each buffer. When
`blocksize` is set to -1, a default length will be used.
## `blocksize`
the new blocksize in bytes
<!-- trait BaseSrcExt::fn set_caps -->
Set new caps on the basesrc source pad.
## `caps`
a `gst::Caps`

# Returns

`true` if the caps could be set
<!-- trait BaseSrcExt::fn set_do_timestamp -->
Configure `self` to automatically timestamp outgoing buffers based on the
current running_time of the pipeline. This property is mostly useful for live
sources.
## `timestamp`
enable or disable timestamping
<!-- trait BaseSrcExt::fn set_dynamic_size -->
If not `dynamic`, size is only updated when needed, such as when trying to
read past current tracked size. Otherwise, size is checked for upon each
read.
## `dynamic`
new dynamic size mode
<!-- trait BaseSrcExt::fn set_format -->
Sets the default format of the source. This will be the format used
for sending SEGMENT events and for performing seeks.

If a format of GST_FORMAT_BYTES is set, the element will be able to
operate in pull mode if the `BaseSrcClass.is_seekable`() returns `true`.

This function must only be called in states < `gst::State::Paused`.
## `format`
the format to use
<!-- trait BaseSrcExt::fn set_live -->
If the element listens to a live source, `live` should
be set to `true`.

A live source will not produce data in the PAUSED state and
will therefore not be able to participate in the PREROLL phase
of a pipeline. To signal this fact to the application and the
pipeline, the state change return value of the live source will
be GST_STATE_CHANGE_NO_PREROLL.
## `live`
new live-mode
<!-- trait BaseSrcExt::fn start_complete -->
Complete an asynchronous start operation. When the subclass overrides the
start method, it should call `BaseSrc::start_complete` when the start
operation completes either from the same thread or from an asynchronous
helper thread.
## `ret`
a `gst::FlowReturn`
<!-- trait BaseSrcExt::fn start_wait -->
Wait until the start operation completes.

# Returns

a `gst::FlowReturn`.
<!-- trait BaseSrcExt::fn submit_buffer_list -->
Subclasses can call this from their create virtual method implementation
to submit a buffer list to be pushed out later. This is useful in
cases where the create function wants to produce multiple buffers to be
pushed out in one go in form of a `gst::BufferList`, which can reduce overhead
drastically, especially for packetised inputs (for data streams where
the packetisation/chunking is not important it is usually more efficient
to return larger buffers instead).

Subclasses that use this function from their create function must return
`gst::FlowReturn::Ok` and no buffer from their create virtual method implementation.
If a buffer is returned after a buffer list has also been submitted via this
function the behaviour is undefined.

Subclasses must only call this function once per create function call and
subclasses must only call this function when the source operates in push
mode.

Feature: `v1_14`

## `buffer_list`
a `gst::BufferList`
<!-- trait BaseSrcExt::fn wait_playing -->
If the `BaseSrcClass.create`() method performs its own synchronisation
against the clock it must unblock when going from PLAYING to the PAUSED state
and call this method before continuing to produce the remaining data.

This function will block until a state change to PLAYING happens (in which
case this function returns `gst::FlowReturn::Ok`) or the processing must be stopped due
to a state change to READY or a FLUSH event (in which case this function
returns `gst::FlowReturn::Flushing`).

# Returns

`gst::FlowReturn::Ok` if `self` is PLAYING and processing can
continue. Any other return value should be returned from the create vmethod.
<!-- struct BaseTransform -->
This base class is for filter elements that process data. Elements
that are suitable for implementation using `BaseTransform` are ones
where the size and caps of the output is known entirely from the input
caps and buffer sizes. These include elements that directly transform
one buffer into another, modify the contents of a buffer in-place, as
well as elements that collate multiple input buffers into one output buffer,
or that expand one input buffer into multiple output buffers. See below
for more concrete use cases.

It provides for:

* one sinkpad and one srcpad
* Possible formats on sink and source pad implemented
 with custom transform_caps function. By default uses
 same format on sink and source.

* Handles state changes
* Does flushing
* Push mode
* Pull mode if the sub-class transform can operate on arbitrary data

# Use Cases

## Passthrough mode

 * Element has no interest in modifying the buffer. It may want to inspect it,
 in which case the element should have a transform_ip function. If there
 is no transform_ip function in passthrough mode, the buffer is pushed
 intact.

 * The `BaseTransformClass.passthrough_on_same_caps` variable
 will automatically set/unset passthrough based on whether the
 element negotiates the same caps on both pads.

 * `BaseTransformClass.passthrough_on_same_caps` on an element that
 doesn't implement a transform_caps function is useful for elements that
 only inspect data (such as level)

 * Example elements

 * Level
 * Videoscale, audioconvert, videoconvert, audioresample in certain modes.

## Modifications in-place - input buffer and output buffer are the same thing.

* The element must implement a transform_ip function.
* Output buffer size must <= input buffer size
* If the always_in_place flag is set, non-writable buffers will be copied
 and passed to the transform_ip function, otherwise a new buffer will be
 created and the transform function called.

* Incoming writable buffers will be passed to the transform_ip function
 immediately.
* only implementing transform_ip and not transform implies always_in_place = `true`

 * Example elements:
 * Volume
 * Audioconvert in certain modes (signed/unsigned conversion)
 * videoconvert in certain modes (endianness swapping)

## Modifications only to the caps/metadata of a buffer

* The element does not require writable data, but non-writable buffers
 should be subbuffered so that the meta-information can be replaced.

* Elements wishing to operate in this mode should replace the
 prepare_output_buffer method to create subbuffers of the input buffer
 and set always_in_place to `true`

* Example elements
 * Capsfilter when setting caps on outgoing buffers that have
 none.
 * identity when it is going to re-timestamp buffers by
 datarate.

## Normal mode
 * always_in_place flag is not set, or there is no transform_ip function
 * Element will receive an input buffer and output buffer to operate on.
 * Output buffer is allocated by calling the prepare_output_buffer function.
 * Example elements:
 * Videoscale, videoconvert, audioconvert when doing
 scaling/conversions

## Special output buffer allocations
 * Elements which need to do special allocation of their output buffers
 beyond allocating output buffers via the negotiated allocator or
 buffer pool should implement the prepare_output_buffer method.

 * Example elements:
 * efence

# Sub-class settable flags on GstBaseTransform

* passthrough

 * Implies that in the current configuration, the sub-class is not interested in modifying the buffers.
 * Elements which are always in passthrough mode whenever the same caps has been negotiated on both pads can set the class variable passthrough_on_same_caps to have this behaviour automatically.

* always_in_place
 * Determines whether a non-writable buffer will be copied before passing
 to the transform_ip function.

 * Implied `true` if no transform function is implemented.
 * Implied `false` if ONLY transform function is implemented.

# Implements

[`BaseTransformExt`](trait.BaseTransformExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`BaseTransformExtManual`](prelude/trait.BaseTransformExtManual.html)
<!-- trait BaseTransformExt -->
Trait containing all `BaseTransform` methods.

# Implementors

[`BaseTransform`](struct.BaseTransform.html)
<!-- trait BaseTransformExt::fn get_allocator -->
Lets `BaseTransform` sub-classes know the memory `allocator`
used by the base class and its `params`.

Unref the `allocator` after use.
## `allocator`
the `gst::Allocator`
used
## `params`
the
`gst::AllocationParams` of `allocator`
<!-- trait BaseTransformExt::fn get_buffer_pool -->

# Returns

the instance of the `gst::BufferPool` used
by `self`; free it after use
<!-- trait BaseTransformExt::fn is_in_place -->
See if `self` is configured as a in_place transform.

# Returns

`true` if the transform is configured in in_place mode.

MT safe.
<!-- trait BaseTransformExt::fn is_passthrough -->
See if `self` is configured as a passthrough transform.

# Returns

`true` if the transform is configured in passthrough mode.

MT safe.
<!-- trait BaseTransformExt::fn is_qos_enabled -->
Queries if the transform will handle QoS.

# Returns

`true` if QoS is enabled.

MT safe.
<!-- trait BaseTransformExt::fn reconfigure -->
Negotiates src pad caps with downstream elements if the source pad is
marked as needing reconfiguring. Unmarks GST_PAD_FLAG_NEED_RECONFIGURE in
any case. But marks it again if negotiation fails.

Do not call this in the `BaseTransformClass.transform`() or
`BaseTransformClass.transform_ip`() vmethod. Call this in
`BaseTransformClass.submit_input_buffer`(),
`BaseTransformClass.prepare_output_buffer`() or in
`BaseTransformClass.generate_output`() _before_ any output buffer is
allocated.

It will be default be called when handling an ALLOCATION query or at the
very beginning of the default `BaseTransformClass.submit_input_buffer`()
implementation.

Feature: `v1_18`


# Returns

`true` if the negotiation succeeded, else `false`.
<!-- trait BaseTransformExt::fn reconfigure_sink -->
Instructs `self` to request renegotiation upstream. This function is
typically called after properties on the transform were set that
influence the input format.
<!-- trait BaseTransformExt::fn reconfigure_src -->
Instructs `self` to renegotiate a new downstream transform on the next
buffer. This function is typically called after properties on the transform
were set that influence the output format.
<!-- trait BaseTransformExt::fn set_gap_aware -->
If `gap_aware` is `false` (the default), output buffers will have the
`gst::BufferFlags::Gap` flag unset.

If set to `true`, the element must handle output buffers with this flag set
correctly, i.e. it can assume that the buffer contains neutral data but must
unset the flag if the output is no neutral data.

MT safe.
## `gap_aware`
New state
<!-- trait BaseTransformExt::fn set_in_place -->
Determines whether a non-writable buffer will be copied before passing
to the transform_ip function.

 * Always `true` if no transform function is implemented.
 * Always `false` if ONLY transform function is implemented.

MT safe.
## `in_place`
Boolean value indicating that we would like to operate
on in_place buffers.
<!-- trait BaseTransformExt::fn set_passthrough -->
Set passthrough mode for this filter by default. This is mostly
useful for filters that do not care about negotiation.

Always `true` for filters which don't implement either a transform
or transform_ip or generate_output method.

MT safe.
## `passthrough`
boolean indicating passthrough mode.
<!-- trait BaseTransformExt::fn set_prefer_passthrough -->
If `prefer_passthrough` is `true` (the default), `self` will check and
prefer passthrough caps from the list of caps returned by the
transform_caps vmethod.

If set to `false`, the element must order the caps returned from the
transform_caps function in such a way that the preferred format is
first in the list. This can be interesting for transforms that can do
passthrough transforms but prefer to do something else, like a
capsfilter.

MT safe.
## `prefer_passthrough`
New state
<!-- trait BaseTransformExt::fn set_qos_enabled -->
Enable or disable QoS handling in the transform.

MT safe.
## `enabled`
new state
<!-- trait BaseTransformExt::fn update_qos -->
Set the QoS parameters in the transform. This function is called internally
when a QOS event is received but subclasses can provide custom information
when needed.

MT safe.
## `proportion`
the proportion
## `diff`
the diff against the clock
## `timestamp`
the timestamp of the buffer generating the QoS expressed in
running_time.
<!-- trait BaseTransformExt::fn update_src_caps -->
Updates the srcpad caps and sends the caps downstream. This function
can be used by subclasses when they have already negotiated their caps
but found a change in them (or computed new information). This way,
they can notify downstream about that change without losing any
buffer.
## `updated_caps`
An updated version of the srcpad caps to be pushed
downstream

# Returns

`true` if the caps could be sent downstream `false` otherwise
<!-- struct FlowCombiner -->
Utility struct to help handling `gst::FlowReturn` combination. Useful for
`gst::Element`<!-- -->s that have multiple source pads and need to combine
the different `gst::FlowReturn` for those pads.

`FlowCombiner` works by using the last `gst::FlowReturn` for all `gst::Pad`
it has in its list and computes the combined return value and provides
it to the caller.

To add a new pad to the `FlowCombiner` use `FlowCombiner::add_pad`.
The new `gst::Pad` is stored with a default value of `gst::FlowReturn::Ok`.

In case you want a `gst::Pad` to be removed, use `FlowCombiner::remove_pad`.

Please be aware that this struct isn't thread safe as its designed to be
 used by demuxers, those usually will have a single thread operating it.

These functions will take refs on the passed `gst::Pad`<!-- -->s.

Aside from reducing the user's code size, the main advantage of using this
helper struct is to follow the standard rules for `gst::FlowReturn` combination.
These rules are:

* `gst::FlowReturn::Eos`: only if all returns are EOS too
* `gst::FlowReturn::NotLinked`: only if all returns are NOT_LINKED too
* `gst::FlowReturn::Error` or below: if at least one returns an error return
* `gst::FlowReturn::NotNegotiated`: if at least one returns a not-negotiated return
* `gst::FlowReturn::Flushing`: if at least one returns flushing
* `gst::FlowReturn::Ok`: otherwise

`gst::FlowReturn::Error` or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are
returned immediately from the `FlowCombiner::update_flow` function.
<!-- impl FlowCombiner::fn new -->
Creates a new `FlowCombiner`, use `FlowCombiner::free` to free it.

# Returns

A new `FlowCombiner`
<!-- impl FlowCombiner::fn add_pad -->
Adds a new `gst::Pad` to the `FlowCombiner`.
## `pad`
the `gst::Pad` that is being added
<!-- impl FlowCombiner::fn clear -->
Removes all pads from a `FlowCombiner` and resets it to its initial state.
<!-- impl FlowCombiner::fn free -->
Frees a `FlowCombiner` struct and all its internal data.
<!-- impl FlowCombiner::fn ref -->
Increments the reference count on the `FlowCombiner`.

Feature: `v1_12_1`


# Returns

the `FlowCombiner`.
<!-- impl FlowCombiner::fn remove_pad -->
Removes a `gst::Pad` from the `FlowCombiner`.
## `pad`
the `gst::Pad` to remove
<!-- impl FlowCombiner::fn reset -->
Reset flow combiner and all pads to their initial state without removing pads.
<!-- impl FlowCombiner::fn unref -->
Decrements the reference count on the `FlowCombiner`.

Feature: `v1_12_1`

<!-- impl FlowCombiner::fn update_flow -->
Computes the combined flow return for the pads in it.

The `gst::FlowReturn` parameter should be the last flow return update for a pad
in this `FlowCombiner`. It will use this value to be able to shortcut some
combinations and avoid looking over all pads again. e.g. The last combined
return is the same as the latest obtained `gst::FlowReturn`.
## `fret`
the latest `gst::FlowReturn` received for a pad in this `FlowCombiner`

# Returns

The combined `gst::FlowReturn`
<!-- impl FlowCombiner::fn update_pad_flow -->
Sets the provided pad's last flow return to provided value and computes
the combined flow return for the pads in it.

The `gst::FlowReturn` parameter should be the last flow return update for a pad
in this `FlowCombiner`. It will use this value to be able to shortcut some
combinations and avoid looking over all pads again. e.g. The last combined
return is the same as the latest obtained `gst::FlowReturn`.
## `pad`
the `gst::Pad` whose `gst::FlowReturn` to update
## `fret`
the latest `gst::FlowReturn` received for a pad in this `FlowCombiner`

# Returns

The combined `gst::FlowReturn`
<!-- struct PushSrc -->
This class is mostly useful for elements that cannot do
random access, or at least very slowly. The source usually
prefers to push out a fixed size buffer.

Subclasses usually operate in a format that is different from the
default GST_FORMAT_BYTES format of `BaseSrc`.

Classes extending this base class will usually be scheduled
in a push based mode. If the peer accepts to operate without
offsets and within the limits of the allowed block size, this
class can operate in getrange based mode automatically. To make
this possible, the subclass should implement and override the
SCHEDULING query.

The subclass should extend the methods from the baseclass in
addition to the ::create method.

Seeking, flushing, scheduling and sync is all handled by this
base class.

# Implements

[`BaseSrcExt`](trait.BaseSrcExt.html), [`gst::ElementExt`](../gst/trait.ElementExt.html), [`gst::ObjectExt`](../gst/trait.ObjectExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html), [`BaseSrcExtManual`](prelude/trait.BaseSrcExtManual.html)