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
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::{
ffi, RTSPAddressPool, RTSPMediaStatus, RTSPPublishClockMode, RTSPStream, RTSPStreamTransport,
RTSPSuspendMode, RTSPThread, RTSPTransportMode,
};
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::boxed::Box as Box_;
glib::wrapper! {
/// A class that contains the GStreamer element along with a list of
/// [`RTSPStream`][crate::RTSPStream] objects that can produce data.
///
/// This object is usually created from a [`RTSPMediaFactory`][crate::RTSPMediaFactory].
///
/// ## Properties
///
///
/// #### `bind-mcast-address`
/// Readable | Writeable
///
///
/// #### `buffer-size`
/// Readable | Writeable
///
///
/// #### `clock`
/// Readable | Writeable
///
///
/// #### `dscp-qos`
/// Readable | Writeable
///
///
/// #### `element`
/// Readable | Writeable | Construct Only
///
///
/// #### `ensure-keyunit-on-start`
/// Whether or not a keyunit should be ensured when a client connects. It
/// will also configure the streams to drop delta units to ensure that they start
/// on a keyunit.
///
/// Note that this will only affect non-shared medias for now.
///
/// Readable | Writeable
///
///
/// #### `ensure-keyunit-on-start-timeout`
/// The maximum allowed time before the first keyunit is considered
/// expired.
///
/// Note that this will only have an effect when ensure-keyunit-on-start is
/// enabled.
///
/// Readable | Writeable
///
///
/// #### `eos-shutdown`
/// Readable | Writeable
///
///
/// #### `latency`
/// Readable | Writeable
///
///
/// #### `max-mcast-ttl`
/// Readable | Writeable
///
///
/// #### `profiles`
/// Readable | Writeable
///
///
/// #### `protocols`
/// Readable | Writeable
///
///
/// #### `reusable`
/// Readable | Writeable
///
///
/// #### `shared`
/// Readable | Writeable
///
///
/// #### `stop-on-disconnect`
/// Readable | Writeable
///
///
/// #### `suspend-mode`
/// Readable | Writeable
///
///
/// #### `time-provider`
/// Readable | Writeable
///
///
/// #### `transport-mode`
/// Readable | Writeable
///
/// ## Signals
///
///
/// #### `handle-message`
/// Will be emitted when a message appears on the pipeline bus.
///
/// Detailed
///
///
/// #### `new-state`
///
///
///
/// #### `new-stream`
///
///
///
/// #### `prepared`
///
///
///
/// #### `removed-stream`
///
///
///
/// #### `target-state`
///
///
///
/// #### `unprepared`
///
///
/// # Implements
///
/// [`RTSPMediaExt`][trait@crate::prelude::RTSPMediaExt], [`trait@glib::ObjectExt`], [`RTSPMediaExtManual`][trait@crate::prelude::RTSPMediaExtManual]
#[doc(alias = "GstRTSPMedia")]
pub struct RTSPMedia(Object<ffi::GstRTSPMedia, ffi::GstRTSPMediaClass>);
match fn {
type_ => || ffi::gst_rtsp_media_get_type(),
}
}
impl RTSPMedia {
pub const NONE: Option<&'static RTSPMedia> = None;
/// Create a new [`RTSPMedia`][crate::RTSPMedia] instance. `element` is the bin element that
/// provides the different streams. The [`RTSPMedia`][crate::RTSPMedia] object contains the
/// element to produce RTP data for one or more related (audio/video/..)
/// streams.
///
/// Ownership is taken of `element`.
/// ## `element`
/// a [`gst::Element`][crate::gst::Element]
///
/// # Returns
///
/// a new [`RTSPMedia`][crate::RTSPMedia] object.
#[doc(alias = "gst_rtsp_media_new")]
pub fn new(element: impl IsA<gst::Element>) -> RTSPMedia {
assert_initialized_main_thread!();
unsafe { from_glib_full(ffi::gst_rtsp_media_new(element.upcast().into_glib_ptr())) }
}
}
unsafe impl Send for RTSPMedia {}
unsafe impl Sync for RTSPMedia {}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::RTSPMedia>> Sealed for T {}
}
/// Trait containing all [`struct@RTSPMedia`] methods.
///
/// # Implementors
///
/// [`RTSPMedia`][struct@crate::RTSPMedia], [`RTSPOnvifMedia`][struct@crate::RTSPOnvifMedia]
pub trait RTSPMediaExt: IsA<RTSPMedia> + sealed::Sealed + 'static {
/// Check if the pipeline for `self` can be shared between multiple clients.
///
/// This checks if the media is shareable and whether it is either reusable or
/// was never unprepared before.
///
/// The function must be called with [`lock()`][Self::lock()].
///
/// # Returns
///
/// [`true`] if the media can be shared between clients.
#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(alias = "gst_rtsp_media_can_be_shared")]
fn can_be_shared(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_can_be_shared(
self.as_ref().to_glib_none().0,
))
}
}
/// Find all payloader elements, they should be named pay\`d` in the
/// element of `self`, and create `GstRTSPStreams` for them.
///
/// Collect all dynamic elements, named dynpay\`d`, and add them to
/// the list of dynamic elements.
///
/// Find all depayloader elements, they should be named depay\`d` in the
/// element of `self`, and create `GstRTSPStreams` for them.
#[doc(alias = "gst_rtsp_media_collect_streams")]
fn collect_streams(&self) {
unsafe {
ffi::gst_rtsp_media_collect_streams(self.as_ref().to_glib_none().0);
}
}
//#[doc(alias = "gst_rtsp_media_complete_pipeline")]
//fn complete_pipeline(&self, transports: /*Ignored*/&[gst_rtsp::RTSPTransport]) -> bool {
// unsafe { TODO: call ffi:gst_rtsp_media_complete_pipeline() }
//}
/// Create a new stream in `self` that provides RTP data on `pad`.
/// `pad` should be a pad of an element inside `self`->element.
/// ## `payloader`
/// a [`gst::Element`][crate::gst::Element]
/// ## `pad`
/// a [`gst::Pad`][crate::gst::Pad]
///
/// # Returns
///
/// a new [`RTSPStream`][crate::RTSPStream] that remains valid for as long
/// as `self` exists.
#[doc(alias = "gst_rtsp_media_create_stream")]
fn create_stream(
&self,
payloader: &impl IsA<gst::Element>,
pad: &impl IsA<gst::Pad>,
) -> RTSPStream {
unsafe {
from_glib_none(ffi::gst_rtsp_media_create_stream(
self.as_ref().to_glib_none().0,
payloader.as_ref().to_glib_none().0,
pad.as_ref().to_glib_none().0,
))
}
}
/// Find a stream in `self` with `control` as the control uri.
/// ## `control`
/// the control of the stream
///
/// # Returns
///
/// the [`RTSPStream`][crate::RTSPStream] with
/// control uri `control` or [`None`] when a stream with that control did
/// not exist.
#[doc(alias = "gst_rtsp_media_find_stream")]
fn find_stream(&self, control: &str) -> Option<RTSPStream> {
unsafe {
from_glib_none(ffi::gst_rtsp_media_find_stream(
self.as_ref().to_glib_none().0,
control.to_glib_none().0,
))
}
}
/// Get the [`RTSPAddressPool`][crate::RTSPAddressPool] used as the address pool of `self`.
///
/// # Returns
///
/// the [`RTSPAddressPool`][crate::RTSPAddressPool] of `self`.
/// `g_object_unref()` after usage.
#[doc(alias = "gst_rtsp_media_get_address_pool")]
#[doc(alias = "get_address_pool")]
fn address_pool(&self) -> Option<RTSPAddressPool> {
unsafe {
from_glib_full(ffi::gst_rtsp_media_get_address_pool(
self.as_ref().to_glib_none().0,
))
}
}
/// Get the base_time that is used by the pipeline in `self`.
///
/// `self` must be prepared before this method returns a valid base_time.
///
/// # Returns
///
/// the base_time used by `self`.
#[doc(alias = "gst_rtsp_media_get_base_time")]
#[doc(alias = "get_base_time")]
fn base_time(&self) -> Option<gst::ClockTime> {
unsafe {
from_glib(ffi::gst_rtsp_media_get_base_time(
self.as_ref().to_glib_none().0,
))
}
}
/// Get the kernel UDP buffer size.
///
/// # Returns
///
/// the kernel UDP buffer size.
#[doc(alias = "gst_rtsp_media_get_buffer_size")]
#[doc(alias = "get_buffer_size")]
#[doc(alias = "buffer-size")]
fn buffer_size(&self) -> u32 {
unsafe { ffi::gst_rtsp_media_get_buffer_size(self.as_ref().to_glib_none().0) }
}
/// Get the clock that is used by the pipeline in `self`.
///
/// `self` must be prepared before this method returns a valid clock object.
///
/// # Returns
///
/// the [`gst::Clock`][crate::gst::Clock] used by `self`. unref after usage.
#[doc(alias = "gst_rtsp_media_get_clock")]
#[doc(alias = "get_clock")]
fn clock(&self) -> Option<gst::Clock> {
unsafe {
from_glib_full(ffi::gst_rtsp_media_get_clock(
self.as_ref().to_glib_none().0,
))
}
}
///
/// # Returns
///
/// Whether retransmission requests will be sent
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_rtsp_media_get_do_retransmission")]
#[doc(alias = "get_do_retransmission")]
fn does_retransmission(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_get_do_retransmission(
self.as_ref().to_glib_none().0,
))
}
}
/// Get the configured DSCP QoS of attached media.
///
/// # Returns
///
/// the DSCP QoS value of attached streams or -1 if disabled.
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_get_dscp_qos")]
#[doc(alias = "get_dscp_qos")]
#[doc(alias = "dscp-qos")]
fn dscp_qos(&self) -> i32 {
unsafe { ffi::gst_rtsp_media_get_dscp_qos(self.as_ref().to_glib_none().0) }
}
/// Get the element that was used when constructing `self`.
///
/// # Returns
///
/// a [`gst::Element`][crate::gst::Element]. Unref after usage.
#[doc(alias = "gst_rtsp_media_get_element")]
#[doc(alias = "get_element")]
fn element(&self) -> gst::Element {
unsafe {
from_glib_full(ffi::gst_rtsp_media_get_element(
self.as_ref().to_glib_none().0,
))
}
}
/// Get ensure-keyunit-on-start flag.
///
/// # Returns
///
/// The ensure-keyunit-on-start flag.
#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start")]
#[doc(alias = "get_ensure_keyunit_on_start")]
#[doc(alias = "ensure-keyunit-on-start")]
fn is_ensure_keyunit_on_start(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_get_ensure_keyunit_on_start(
self.as_ref().to_glib_none().0,
))
}
}
/// Get ensure-keyunit-on-start-timeout time.
///
/// # Returns
///
/// The ensure-keyunit-on-start-timeout time.
#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start_timeout")]
#[doc(alias = "get_ensure_keyunit_on_start_timeout")]
#[doc(alias = "ensure-keyunit-on-start-timeout")]
fn ensure_keyunit_on_start_timeout(&self) -> u32 {
unsafe {
ffi::gst_rtsp_media_get_ensure_keyunit_on_start_timeout(self.as_ref().to_glib_none().0)
}
}
/// Get the latency that is used for receiving media.
///
/// # Returns
///
/// latency in milliseconds
#[doc(alias = "gst_rtsp_media_get_latency")]
#[doc(alias = "get_latency")]
fn latency(&self) -> u32 {
unsafe { ffi::gst_rtsp_media_get_latency(self.as_ref().to_glib_none().0) }
}
/// Get the the maximum time-to-live value of outgoing multicast packets.
///
/// # Returns
///
/// the maximum time-to-live value of outgoing multicast packets.
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_rtsp_media_get_max_mcast_ttl")]
#[doc(alias = "get_max_mcast_ttl")]
#[doc(alias = "max-mcast-ttl")]
fn max_mcast_ttl(&self) -> u32 {
unsafe { ffi::gst_rtsp_media_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
}
/// Get the multicast interface used for `self`.
///
/// # Returns
///
/// the multicast interface for `self`.
/// `g_free()` after usage.
#[doc(alias = "gst_rtsp_media_get_multicast_iface")]
#[doc(alias = "get_multicast_iface")]
fn multicast_iface(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::gst_rtsp_media_get_multicast_iface(
self.as_ref().to_glib_none().0,
))
}
}
//#[doc(alias = "gst_rtsp_media_get_permissions")]
//#[doc(alias = "get_permissions")]
//fn permissions(&self) -> /*Ignored*/Option<RTSPPermissions> {
// unsafe { TODO: call ffi:gst_rtsp_media_get_permissions() }
//}
/// Get the allowed profiles of `self`.
///
/// # Returns
///
/// a [`gst_rtsp::RTSPProfile`][crate::gst_rtsp::RTSPProfile]
#[doc(alias = "gst_rtsp_media_get_profiles")]
#[doc(alias = "get_profiles")]
fn profiles(&self) -> gst_rtsp::RTSPProfile {
unsafe {
from_glib(ffi::gst_rtsp_media_get_profiles(
self.as_ref().to_glib_none().0,
))
}
}
/// Get the allowed protocols of `self`.
///
/// # Returns
///
/// a [`gst_rtsp::RTSPLowerTrans`][crate::gst_rtsp::RTSPLowerTrans]
#[doc(alias = "gst_rtsp_media_get_protocols")]
#[doc(alias = "get_protocols")]
fn protocols(&self) -> gst_rtsp::RTSPLowerTrans {
unsafe {
from_glib(ffi::gst_rtsp_media_get_protocols(
self.as_ref().to_glib_none().0,
))
}
}
/// Gets if and how the media clock should be published according to RFC7273.
///
/// # Returns
///
/// The GstRTSPPublishClockMode
#[doc(alias = "gst_rtsp_media_get_publish_clock_mode")]
#[doc(alias = "get_publish_clock_mode")]
fn publish_clock_mode(&self) -> RTSPPublishClockMode {
unsafe {
from_glib(ffi::gst_rtsp_media_get_publish_clock_mode(
self.as_ref().to_glib_none().0,
))
}
}
/// Get the current range as a string. `self` must be prepared with
/// gst_rtsp_media_prepare ().
/// ## `play`
/// for the PLAY request
/// ## `unit`
/// the unit to use for the string
///
/// # Returns
///
/// The range as a string, `g_free()` after usage.
#[doc(alias = "gst_rtsp_media_get_range_string")]
#[doc(alias = "get_range_string")]
fn range_string(&self, play: bool, unit: gst_rtsp::RTSPRangeUnit) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::gst_rtsp_media_get_range_string(
self.as_ref().to_glib_none().0,
play.into_glib(),
unit.into_glib(),
))
}
}
///
/// # Returns
///
/// whether `self` will follow the Rate-Control=no behaviour as specified
/// in the ONVIF replay spec.
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_get_rate_control")]
#[doc(alias = "get_rate_control")]
fn is_rate_control(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_get_rate_control(
self.as_ref().to_glib_none().0,
))
}
}
/// Get the rate and applied_rate of the current segment.
///
/// # Returns
///
/// [`false`] if looking up the rate and applied rate failed. Otherwise
/// [`true`] is returned and `rate` and `applied_rate` are set to the rate and
/// applied_rate of the current segment.
///
/// ## `rate`
/// the rate of the current segment
///
/// ## `applied_rate`
/// the applied_rate of the current segment
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_get_rates")]
#[doc(alias = "get_rates")]
fn rates(&self) -> Option<(f64, f64)> {
unsafe {
let mut rate = std::mem::MaybeUninit::uninit();
let mut applied_rate = std::mem::MaybeUninit::uninit();
let ret = from_glib(ffi::gst_rtsp_media_get_rates(
self.as_ref().to_glib_none().0,
rate.as_mut_ptr(),
applied_rate.as_mut_ptr(),
));
if ret {
Some((rate.assume_init(), applied_rate.assume_init()))
} else {
None
}
}
}
/// Get the amount of time to store retransmission data.
///
/// # Returns
///
/// the amount of time to store retransmission data.
#[doc(alias = "gst_rtsp_media_get_retransmission_time")]
#[doc(alias = "get_retransmission_time")]
fn retransmission_time(&self) -> Option<gst::ClockTime> {
unsafe {
from_glib(ffi::gst_rtsp_media_get_retransmission_time(
self.as_ref().to_glib_none().0,
))
}
}
/// Get the status of `self`. When `self` is busy preparing, this function waits
/// until `self` is prepared or in error.
///
/// # Returns
///
/// the status of `self`.
#[doc(alias = "gst_rtsp_media_get_status")]
#[doc(alias = "get_status")]
fn status(&self) -> RTSPMediaStatus {
unsafe {
from_glib(ffi::gst_rtsp_media_get_status(
self.as_ref().to_glib_none().0,
))
}
}
/// Retrieve the stream with index `idx` from `self`.
/// ## `idx`
/// the stream index
///
/// # Returns
///
/// the [`RTSPStream`][crate::RTSPStream] at index
/// `idx` or [`None`] when a stream with that index did not exist.
#[doc(alias = "gst_rtsp_media_get_stream")]
#[doc(alias = "get_stream")]
fn stream(&self, idx: u32) -> Option<RTSPStream> {
unsafe {
from_glib_none(ffi::gst_rtsp_media_get_stream(
self.as_ref().to_glib_none().0,
idx,
))
}
}
/// Get how `self` will be suspended.
///
/// # Returns
///
/// [`RTSPSuspendMode`][crate::RTSPSuspendMode].
#[doc(alias = "gst_rtsp_media_get_suspend_mode")]
#[doc(alias = "get_suspend_mode")]
#[doc(alias = "suspend-mode")]
fn suspend_mode(&self) -> RTSPSuspendMode {
unsafe {
from_glib(ffi::gst_rtsp_media_get_suspend_mode(
self.as_ref().to_glib_none().0,
))
}
}
/// Get the [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider] for the clock used by `self`. The time provider
/// will listen on `address` and `port` for client time requests.
/// ## `address`
/// an address or [`None`]
/// ## `port`
/// a port or 0
///
/// # Returns
///
/// the [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider] of `self`.
#[doc(alias = "gst_rtsp_media_get_time_provider")]
#[doc(alias = "get_time_provider")]
#[doc(alias = "time-provider")]
fn time_provider(&self, address: Option<&str>, port: u16) -> Option<gst_net::NetTimeProvider> {
unsafe {
from_glib_full(ffi::gst_rtsp_media_get_time_provider(
self.as_ref().to_glib_none().0,
address.to_glib_none().0,
port,
))
}
}
/// Check if the pipeline for `self` can be used for PLAY or RECORD methods.
///
/// # Returns
///
/// The transport mode.
#[doc(alias = "gst_rtsp_media_get_transport_mode")]
#[doc(alias = "get_transport_mode")]
#[doc(alias = "transport-mode")]
fn transport_mode(&self) -> RTSPTransportMode {
unsafe {
from_glib(ffi::gst_rtsp_media_get_transport_mode(
self.as_ref().to_glib_none().0,
))
}
}
//#[doc(alias = "gst_rtsp_media_handle_sdp")]
//fn handle_sdp(&self, sdp: /*Ignored*/&mut gst_sdp::SDPMessage) -> bool {
// unsafe { TODO: call ffi:gst_rtsp_media_handle_sdp() }
//}
/// See [`RTSPStreamExt::is_complete()`][crate::prelude::RTSPStreamExt::is_complete()], [`RTSPStreamExt::is_sender()`][crate::prelude::RTSPStreamExt::is_sender()].
///
/// # Returns
///
/// whether `self` has at least one complete sender stream.
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_has_completed_sender")]
fn has_completed_sender(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_has_completed_sender(
self.as_ref().to_glib_none().0,
))
}
}
/// Check if multicast sockets are configured to be bound to multicast addresses.
///
/// # Returns
///
/// [`true`] if multicast sockets are configured to be bound to multicast addresses.
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_rtsp_media_is_bind_mcast_address")]
fn is_bind_mcast_address(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_is_bind_mcast_address(
self.as_ref().to_glib_none().0,
))
}
}
/// Check if the pipeline for `self` will send an EOS down the pipeline before
/// unpreparing.
///
/// # Returns
///
/// [`true`] if the media will send EOS before unpreparing.
#[doc(alias = "gst_rtsp_media_is_eos_shutdown")]
fn is_eos_shutdown(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_is_eos_shutdown(
self.as_ref().to_glib_none().0,
))
}
}
///
/// # Returns
///
/// [`true`] if `self` is receive-only, [`false`] otherwise.
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_is_receive_only")]
fn is_receive_only(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_is_receive_only(
self.as_ref().to_glib_none().0,
))
}
}
/// Check if the pipeline for `self` can be reused after an unprepare.
///
/// # Returns
///
/// [`true`] if the media can be reused
#[doc(alias = "gst_rtsp_media_is_reusable")]
fn is_reusable(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_is_reusable(
self.as_ref().to_glib_none().0,
))
}
}
/// Check if the pipeline for `self` can be shared between multiple clients in
/// theory. This simply returns the value set via [`set_shared()`][Self::set_shared()].
///
/// To know if a media can be shared in practice, i.e. if it's shareable and
/// either reusable or was never unprepared before, use
/// [`can_be_shared()`][Self::can_be_shared()].
///
/// # Returns
///
/// [`true`] if the media can be shared between clients.
#[doc(alias = "gst_rtsp_media_is_shared")]
fn is_shared(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_is_shared(
self.as_ref().to_glib_none().0,
))
}
}
/// Check if the pipeline for `self` will be stopped when a client disconnects
/// without sending TEARDOWN.
///
/// # Returns
///
/// [`true`] if the media will be stopped when a client disconnects
/// without sending TEARDOWN.
#[doc(alias = "gst_rtsp_media_is_stop_on_disconnect")]
fn is_stop_on_disconnect(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_is_stop_on_disconnect(
self.as_ref().to_glib_none().0,
))
}
}
/// Check if `self` can provide a [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider] for its pipeline clock.
///
/// Use [`time_provider()`][Self::time_provider()] to get the network clock.
///
/// # Returns
///
/// [`true`] if `self` can provide a [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider].
#[doc(alias = "gst_rtsp_media_is_time_provider")]
fn is_time_provider(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_is_time_provider(
self.as_ref().to_glib_none().0,
))
}
}
/// Lock the entire media. This is needed by callers such as rtsp_client to
/// protect the media when it is shared by many clients.
/// The lock prevents that concurrent clients alters the shared media,
/// while one client already is working with it.
/// Typically the lock is taken in external RTSP API calls that uses shared media
/// such as DESCRIBE, SETUP, ANNOUNCE, TEARDOWN, PLAY, PAUSE.
///
/// As best practice take the lock as soon as the function get hold of a shared
/// media object. Release the lock right before the function returns.
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_lock")]
fn lock(&self) {
unsafe {
ffi::gst_rtsp_media_lock(self.as_ref().to_glib_none().0);
}
}
/// Get the number of streams in this media.
///
/// # Returns
///
/// The number of streams.
#[doc(alias = "gst_rtsp_media_n_streams")]
fn n_streams(&self) -> u32 {
unsafe { ffi::gst_rtsp_media_n_streams(self.as_ref().to_glib_none().0) }
}
/// Prepare `self` for streaming. This function will create the objects
/// to manage the streaming. A pipeline must have been set on `self` with
/// [`RTSPMediaExtManual::take_pipeline()`][crate::prelude::RTSPMediaExtManual::take_pipeline()].
///
/// It will preroll the pipeline and collect vital information about the streams
/// such as the duration.
/// ## `thread`
/// a [`RTSPThread`][crate::RTSPThread] to run the
/// bus handler or [`None`]
///
/// # Returns
///
/// [`true`] on success.
#[doc(alias = "gst_rtsp_media_prepare")]
fn prepare(&self, thread: Option<RTSPThread>) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(
ffi::gst_rtsp_media_prepare(self.as_ref().to_glib_none().0, thread.into_glib_ptr()),
"Failed to prepare media"
)
}
}
//#[doc(alias = "gst_rtsp_media_seek")]
//fn seek(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange) -> bool {
// unsafe { TODO: call ffi:gst_rtsp_media_seek() }
//}
//#[cfg(feature = "v1_18")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
//#[doc(alias = "gst_rtsp_media_seek_full")]
//fn seek_full(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange, flags: /*Ignored*/gst::SeekFlags) -> bool {
// unsafe { TODO: call ffi:gst_rtsp_media_seek_full() }
//}
//#[cfg(feature = "v1_18")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
//#[doc(alias = "gst_rtsp_media_seek_trickmode")]
//fn seek_trickmode(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange, flags: /*Ignored*/gst::SeekFlags, rate: f64, trickmode_interval: impl Into<Option<gst::ClockTime>>) -> bool {
// unsafe { TODO: call ffi:gst_rtsp_media_seek_trickmode() }
//}
//#[doc(alias = "gst_rtsp_media_seekable")]
//fn seekable(&self) -> /*Ignored*/gst::ClockTimeDiff {
// unsafe { TODO: call ffi:gst_rtsp_media_seekable() }
//}
/// configure `pool` to be used as the address pool of `self`.
/// ## `pool`
/// a [`RTSPAddressPool`][crate::RTSPAddressPool]
#[doc(alias = "gst_rtsp_media_set_address_pool")]
fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>) {
unsafe {
ffi::gst_rtsp_media_set_address_pool(
self.as_ref().to_glib_none().0,
pool.map(|p| p.as_ref()).to_glib_none().0,
);
}
}
/// Decide whether the multicast socket should be bound to a multicast address or
/// INADDR_ANY.
/// ## `bind_mcast_addr`
/// the new value
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_rtsp_media_set_bind_mcast_address")]
#[doc(alias = "bind-mcast-address")]
fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
unsafe {
ffi::gst_rtsp_media_set_bind_mcast_address(
self.as_ref().to_glib_none().0,
bind_mcast_addr.into_glib(),
);
}
}
/// Set the kernel UDP buffer size.
/// ## `size`
/// the new value
#[doc(alias = "gst_rtsp_media_set_buffer_size")]
#[doc(alias = "buffer-size")]
fn set_buffer_size(&self, size: u32) {
unsafe {
ffi::gst_rtsp_media_set_buffer_size(self.as_ref().to_glib_none().0, size);
}
}
/// Configure the clock used for the media.
/// ## `clock`
/// [`gst::Clock`][crate::gst::Clock] to be used
#[doc(alias = "gst_rtsp_media_set_clock")]
#[doc(alias = "clock")]
fn set_clock(&self, clock: Option<&impl IsA<gst::Clock>>) {
unsafe {
ffi::gst_rtsp_media_set_clock(
self.as_ref().to_glib_none().0,
clock.map(|p| p.as_ref()).to_glib_none().0,
);
}
}
/// Set whether retransmission requests will be sent
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_rtsp_media_set_do_retransmission")]
fn set_do_retransmission(&self, do_retransmission: bool) {
unsafe {
ffi::gst_rtsp_media_set_do_retransmission(
self.as_ref().to_glib_none().0,
do_retransmission.into_glib(),
);
}
}
/// Configure the dscp qos of attached streams to `dscp_qos`.
/// ## `dscp_qos`
/// a new dscp qos value (0-63, or -1 to disable)
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_set_dscp_qos")]
#[doc(alias = "dscp-qos")]
fn set_dscp_qos(&self, dscp_qos: i32) {
unsafe {
ffi::gst_rtsp_media_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
}
}
/// Set whether or not a keyunit should be ensured when a client connects. It
/// will also configure the streams to drop delta units to ensure that they start
/// on a keyunit.
///
/// Note that this will only affect non-shared medias for now.
/// ## `ensure_keyunit_on_start`
/// the new value
#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start")]
#[doc(alias = "ensure-keyunit-on-start")]
fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool) {
unsafe {
ffi::gst_rtsp_media_set_ensure_keyunit_on_start(
self.as_ref().to_glib_none().0,
ensure_keyunit_on_start.into_glib(),
);
}
}
/// Sets the maximum allowed time before the first keyunit is considered
/// expired.
///
/// Note that this will only have an effect when ensure-keyunit-on-start is
/// enabled.
/// ## `timeout`
/// the new value
#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start_timeout")]
#[doc(alias = "ensure-keyunit-on-start-timeout")]
fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32) {
unsafe {
ffi::gst_rtsp_media_set_ensure_keyunit_on_start_timeout(
self.as_ref().to_glib_none().0,
timeout,
);
}
}
/// Set or unset if an EOS event will be sent to the pipeline for `self` before
/// it is unprepared.
/// ## `eos_shutdown`
/// the new value
#[doc(alias = "gst_rtsp_media_set_eos_shutdown")]
#[doc(alias = "eos-shutdown")]
fn set_eos_shutdown(&self, eos_shutdown: bool) {
unsafe {
ffi::gst_rtsp_media_set_eos_shutdown(
self.as_ref().to_glib_none().0,
eos_shutdown.into_glib(),
);
}
}
/// Configure the latency used for receiving media.
/// ## `latency`
/// latency in milliseconds
#[doc(alias = "gst_rtsp_media_set_latency")]
#[doc(alias = "latency")]
fn set_latency(&self, latency: u32) {
unsafe {
ffi::gst_rtsp_media_set_latency(self.as_ref().to_glib_none().0, latency);
}
}
/// Set the maximum time-to-live value of outgoing multicast packets.
/// ## `ttl`
/// the new multicast ttl value
///
/// # Returns
///
/// [`true`] if the requested ttl has been set successfully.
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
#[doc(alias = "gst_rtsp_media_set_max_mcast_ttl")]
#[doc(alias = "max-mcast-ttl")]
fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_set_max_mcast_ttl(
self.as_ref().to_glib_none().0,
ttl,
))
}
}
/// configure `multicast_iface` to be used for `self`.
/// ## `multicast_iface`
/// a multicast interface name
#[doc(alias = "gst_rtsp_media_set_multicast_iface")]
fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
unsafe {
ffi::gst_rtsp_media_set_multicast_iface(
self.as_ref().to_glib_none().0,
multicast_iface.to_glib_none().0,
);
}
}
//#[doc(alias = "gst_rtsp_media_set_permissions")]
//fn set_permissions(&self, permissions: /*Ignored*/Option<&mut RTSPPermissions>) {
// unsafe { TODO: call ffi:gst_rtsp_media_set_permissions() }
//}
/// Set the state of the pipeline managed by `self` to `state`
/// ## `state`
/// the target state of the pipeline
#[doc(alias = "gst_rtsp_media_set_pipeline_state")]
fn set_pipeline_state(&self, state: gst::State) {
unsafe {
ffi::gst_rtsp_media_set_pipeline_state(
self.as_ref().to_glib_none().0,
state.into_glib(),
);
}
}
/// Configure the allowed lower transport for `self`.
/// ## `profiles`
/// the new flags
#[doc(alias = "gst_rtsp_media_set_profiles")]
#[doc(alias = "profiles")]
fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
unsafe {
ffi::gst_rtsp_media_set_profiles(self.as_ref().to_glib_none().0, profiles.into_glib());
}
}
/// Configure the allowed lower transport for `self`.
/// ## `protocols`
/// the new flags
#[doc(alias = "gst_rtsp_media_set_protocols")]
#[doc(alias = "protocols")]
fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
unsafe {
ffi::gst_rtsp_media_set_protocols(
self.as_ref().to_glib_none().0,
protocols.into_glib(),
);
}
}
/// Sets if and how the media clock should be published according to RFC7273.
/// ## `mode`
/// the clock publish mode
#[doc(alias = "gst_rtsp_media_set_publish_clock_mode")]
fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
unsafe {
ffi::gst_rtsp_media_set_publish_clock_mode(
self.as_ref().to_glib_none().0,
mode.into_glib(),
);
}
}
/// Define whether `self` will follow the Rate-Control=no behaviour as specified
/// in the ONVIF replay spec.
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_set_rate_control")]
fn set_rate_control(&self, enabled: bool) {
unsafe {
ffi::gst_rtsp_media_set_rate_control(
self.as_ref().to_glib_none().0,
enabled.into_glib(),
);
}
}
/// Set the amount of time to store retransmission packets.
/// ## `time`
/// the new value
#[doc(alias = "gst_rtsp_media_set_retransmission_time")]
fn set_retransmission_time(&self, time: impl Into<Option<gst::ClockTime>>) {
unsafe {
ffi::gst_rtsp_media_set_retransmission_time(
self.as_ref().to_glib_none().0,
time.into().into_glib(),
);
}
}
/// Set or unset if the pipeline for `self` can be reused after the pipeline has
/// been unprepared.
/// ## `reusable`
/// the new value
#[doc(alias = "gst_rtsp_media_set_reusable")]
#[doc(alias = "reusable")]
fn set_reusable(&self, reusable: bool) {
unsafe {
ffi::gst_rtsp_media_set_reusable(self.as_ref().to_glib_none().0, reusable.into_glib());
}
}
/// Set or unset if the pipeline for `self` can be shared will multiple clients.
/// When `shared` is [`true`], client requests for this media will share the media
/// pipeline.
/// ## `shared`
/// the new value
#[doc(alias = "gst_rtsp_media_set_shared")]
#[doc(alias = "shared")]
fn set_shared(&self, shared: bool) {
unsafe {
ffi::gst_rtsp_media_set_shared(self.as_ref().to_glib_none().0, shared.into_glib());
}
}
/// Set the state of `self` to `state` and for the transports in `transports`.
///
/// `self` must be prepared with [`prepare()`][Self::prepare()];
/// ## `state`
/// the target state of the media
/// ## `transports`
///
/// a `GPtrArray` of [`RTSPStreamTransport`][crate::RTSPStreamTransport] pointers
///
/// # Returns
///
/// [`true`] on success.
#[doc(alias = "gst_rtsp_media_set_state")]
fn set_state(&self, state: gst::State, transports: &[RTSPStreamTransport]) -> bool {
unsafe {
from_glib(ffi::gst_rtsp_media_set_state(
self.as_ref().to_glib_none().0,
state.into_glib(),
transports.to_glib_none().0,
))
}
}
/// Set or unset if the pipeline for `self` should be stopped when a
/// client disconnects without sending TEARDOWN.
/// ## `stop_on_disconnect`
/// the new value
#[doc(alias = "gst_rtsp_media_set_stop_on_disconnect")]
#[doc(alias = "stop-on-disconnect")]
fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) {
unsafe {
ffi::gst_rtsp_media_set_stop_on_disconnect(
self.as_ref().to_glib_none().0,
stop_on_disconnect.into_glib(),
);
}
}
/// Control how @ media will be suspended after the SDP has been generated and
/// after a PAUSE request has been performed.
///
/// Media must be unprepared when setting the suspend mode.
/// ## `mode`
/// the new [`RTSPSuspendMode`][crate::RTSPSuspendMode]
#[doc(alias = "gst_rtsp_media_set_suspend_mode")]
#[doc(alias = "suspend-mode")]
fn set_suspend_mode(&self, mode: RTSPSuspendMode) {
unsafe {
ffi::gst_rtsp_media_set_suspend_mode(self.as_ref().to_glib_none().0, mode.into_glib());
}
}
/// Sets if the media pipeline can work in PLAY or RECORD mode
/// ## `mode`
/// the new value
#[doc(alias = "gst_rtsp_media_set_transport_mode")]
#[doc(alias = "transport-mode")]
fn set_transport_mode(&self, mode: RTSPTransportMode) {
unsafe {
ffi::gst_rtsp_media_set_transport_mode(
self.as_ref().to_glib_none().0,
mode.into_glib(),
);
}
}
//#[doc(alias = "gst_rtsp_media_setup_sdp")]
//fn setup_sdp(&self, sdp: /*Ignored*/&mut gst_sdp::SDPMessage, info: /*Ignored*/&mut SDPInfo) -> bool {
// unsafe { TODO: call ffi:gst_rtsp_media_setup_sdp() }
//}
/// Suspend `self`. The state of the pipeline managed by `self` is set to
/// GST_STATE_NULL but all streams are kept. `self` can be prepared again
/// with [`unsuspend()`][Self::unsuspend()]
///
/// `self` must be prepared with [`prepare()`][Self::prepare()];
///
/// # Returns
///
/// [`true`] on success.
#[doc(alias = "gst_rtsp_media_suspend")]
fn suspend(&self) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(
ffi::gst_rtsp_media_suspend(self.as_ref().to_glib_none().0),
"Failed to suspend media"
)
}
}
/// Unlock the media.
#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_rtsp_media_unlock")]
fn unlock(&self) {
unsafe {
ffi::gst_rtsp_media_unlock(self.as_ref().to_glib_none().0);
}
}
/// Unprepare `self`. After this call, the media should be prepared again before
/// it can be used again. If the media is set to be non-reusable, a new instance
/// must be created.
///
/// # Returns
///
/// [`true`] on success.
#[doc(alias = "gst_rtsp_media_unprepare")]
fn unprepare(&self) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(
ffi::gst_rtsp_media_unprepare(self.as_ref().to_glib_none().0),
"Failed to unprepare media"
)
}
}
/// Unsuspend `self` if it was in a suspended state. This method does nothing
/// when the media was not in the suspended state.
///
/// # Returns
///
/// [`true`] on success.
#[doc(alias = "gst_rtsp_media_unsuspend")]
fn unsuspend(&self) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(
ffi::gst_rtsp_media_unsuspend(self.as_ref().to_glib_none().0),
"Failed to unsuspend media"
)
}
}
/// Set `self` to provide a [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider].
/// ## `time_provider`
/// if a [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider] should be used
#[doc(alias = "gst_rtsp_media_use_time_provider")]
fn use_time_provider(&self, time_provider: bool) {
unsafe {
ffi::gst_rtsp_media_use_time_provider(
self.as_ref().to_glib_none().0,
time_provider.into_glib(),
);
}
}
#[doc(alias = "bind-mcast-address")]
fn get_property_bind_mcast_address(&self) -> bool {
ObjectExt::property(self.as_ref(), "bind-mcast-address")
}
#[cfg(not(feature = "v1_16"))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
#[doc(alias = "bind-mcast-address")]
fn set_bind_mcast_address(&self, bind_mcast_address: bool) {
ObjectExt::set_property(self.as_ref(), "bind-mcast-address", bind_mcast_address)
}
#[cfg(not(feature = "v1_18"))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
#[doc(alias = "dscp-qos")]
fn dscp_qos(&self) -> i32 {
ObjectExt::property(self.as_ref(), "dscp-qos")
}
#[cfg(not(feature = "v1_18"))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
#[doc(alias = "dscp-qos")]
fn set_dscp_qos(&self, dscp_qos: i32) {
ObjectExt::set_property(self.as_ref(), "dscp-qos", dscp_qos)
}
#[cfg(not(feature = "v1_16"))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
#[doc(alias = "max-mcast-ttl")]
fn max_mcast_ttl(&self) -> u32 {
ObjectExt::property(self.as_ref(), "max-mcast-ttl")
}
#[cfg(not(feature = "v1_16"))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
#[doc(alias = "max-mcast-ttl")]
fn set_max_mcast_ttl(&self, max_mcast_ttl: u32) {
ObjectExt::set_property(self.as_ref(), "max-mcast-ttl", max_mcast_ttl)
}
#[doc(alias = "time-provider")]
fn set_time_provider(&self, time_provider: bool) {
ObjectExt::set_property(self.as_ref(), "time-provider", time_provider)
}
/// Will be emitted when a message appears on the pipeline bus.
/// ## `message`
/// a [`gst::Message`][crate::gst::Message]
///
/// # Returns
///
/// a `gboolean` indicating if the call was successful or not.
#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(alias = "handle-message")]
fn connect_handle_message<F: Fn(&Self, &gst::Message) -> bool + Send + Sync + 'static>(
&self,
detail: Option<&str>,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn handle_message_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P, &gst::Message) -> bool + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
message: *mut gst::ffi::GstMessage,
f: glib::ffi::gpointer,
) -> glib::ffi::gboolean {
let f: &F = &*(f as *const F);
f(
RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(message),
)
.into_glib()
}
unsafe {
let f: Box_<F> = Box_::new(f);
let detailed_signal_name = detail.map(|name| format!("handle-message::{name}\0"));
let signal_name: &[u8] = detailed_signal_name
.as_ref()
.map_or(&b"handle-message\0"[..], |n| n.as_bytes());
connect_raw(
self.as_ptr() as *mut _,
signal_name.as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
handle_message_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "new-state")]
fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn new_state_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P, i32) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
object: libc::c_int,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"new-state\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
new_state_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "new-stream")]
fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn new_stream_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
object: *mut ffi::GstRTSPStream,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(
RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(object),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"new-stream\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
new_stream_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "prepared")]
fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn prepared_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"prepared\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
prepared_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "removed-stream")]
fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn removed_stream_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
object: *mut ffi::GstRTSPStream,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(
RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
&from_glib_borrow(object),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"removed-stream\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
removed_stream_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "target-state")]
fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn target_state_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P, i32) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
object: libc::c_int,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"target-state\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
target_state_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "unprepared")]
fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn unprepared_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"unprepared\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
unprepared_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "bind-mcast-address")]
fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_bind_mcast_address_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::bind-mcast-address\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_bind_mcast_address_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "buffer-size")]
fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_buffer_size_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::buffer-size\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_buffer_size_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "clock")]
fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_clock_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::clock\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_clock_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "dscp-qos")]
fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_dscp_qos_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::dscp-qos\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_dscp_qos_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(alias = "ensure-keyunit-on-start")]
fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::ensure-keyunit-on-start\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(alias = "ensure-keyunit-on-start-timeout")]
fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::ensure-keyunit-on-start-timeout\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "eos-shutdown")]
fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_eos_shutdown_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::eos-shutdown\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_eos_shutdown_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "latency")]
fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_latency_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::latency\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_latency_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "max-mcast-ttl")]
fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-mcast-ttl\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "profiles")]
fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_profiles_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::profiles\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_profiles_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "protocols")]
fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_protocols_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::protocols\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_protocols_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "reusable")]
fn connect_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_reusable_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::reusable\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_reusable_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "shared")]
fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_shared_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::shared\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_shared_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "stop-on-disconnect")]
fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::stop-on-disconnect\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "suspend-mode")]
fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_suspend_mode_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::suspend-mode\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_suspend_mode_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "time-provider")]
fn connect_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_time_provider_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::time-provider\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_time_provider_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "transport-mode")]
fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_transport_mode_trampoline<
P: IsA<RTSPMedia>,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut ffi::GstRTSPMedia,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::transport-mode\0".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_transport_mode_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {}