gstreamer_rtp/auto/
functions.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{ffi, RTCPSDESType};
7use glib::translate::*;
8
9//#[cfg(feature = "v1_16")]
10//#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
11//#[doc(alias = "gst_buffer_add_rtp_source_meta")]
12//pub fn buffer_add_rtp_source_meta(buffer: &gst::Buffer, ssrc: u32, csrc: &[u32]) -> /*Ignored*/RTPSourceMeta {
13//    unsafe { TODO: call ffi:gst_buffer_add_rtp_source_meta() }
14//}
15
16//#[cfg(feature = "v1_16")]
17//#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
18//#[doc(alias = "gst_buffer_get_rtp_source_meta")]
19//pub fn buffer_get_rtp_source_meta(buffer: &gst::Buffer) -> /*Ignored*/Option<RTPSourceMeta> {
20//    unsafe { TODO: call ffi:gst_buffer_get_rtp_source_meta() }
21//}
22
23/// Converts an NTP time to UNIX nanoseconds. `ntptime` can typically be
24/// the NTP time of an SR RTCP message and contains, in the upper 32 bits, the
25/// number of seconds since 1900 and, in the lower 32 bits, the fractional
26/// seconds. The resulting value will be the number of nanoseconds since 1970.
27/// ## `ntptime`
28/// an NTP timestamp
29///
30/// # Returns
31///
32/// the UNIX time for `ntptime` in nanoseconds.
33#[doc(alias = "gst_rtcp_ntp_to_unix")]
34pub fn rtcp_ntp_to_unix(ntptime: u64) -> u64 {
35    assert_initialized_main_thread!();
36    unsafe { ffi::gst_rtcp_ntp_to_unix(ntptime) }
37}
38
39/// Convert `name` into a [`RTCPSDESType`][crate::RTCPSDESType]. `name` is typically a key in a
40/// [`gst::Structure`][crate::gst::Structure] containing SDES items.
41/// ## `name`
42/// a SDES name
43///
44/// # Returns
45///
46/// the [`RTCPSDESType`][crate::RTCPSDESType] for `name` or [`RTCPSDESType::Priv`][crate::RTCPSDESType::Priv] when `name`
47/// is a private sdes item.
48#[doc(alias = "gst_rtcp_sdes_name_to_type")]
49pub fn rtcp_sdes_name_to_type(name: &str) -> RTCPSDESType {
50    assert_initialized_main_thread!();
51    unsafe { from_glib(ffi::gst_rtcp_sdes_name_to_type(name.to_glib_none().0)) }
52}
53
54/// Converts `type_` to the string equivalent. The string is typically used as a
55/// key in a [`gst::Structure`][crate::gst::Structure] containing SDES items.
56/// ## `type_`
57/// a [`RTCPSDESType`][crate::RTCPSDESType]
58///
59/// # Returns
60///
61/// the string equivalent of `type_`
62#[doc(alias = "gst_rtcp_sdes_type_to_name")]
63pub fn rtcp_sdes_type_to_name(type_: RTCPSDESType) -> glib::GString {
64    assert_initialized_main_thread!();
65    unsafe { from_glib_none(ffi::gst_rtcp_sdes_type_to_name(type_.into_glib())) }
66}
67
68/// Converts a UNIX timestamp in nanoseconds to an NTP time. The caller should
69/// pass a value with nanoseconds since 1970. The NTP time will, in the upper
70/// 32 bits, contain the number of seconds since 1900 and, in the lower 32
71/// bits, the fractional seconds. The resulting value can be used as an ntptime
72/// for constructing SR RTCP packets.
73/// ## `unixtime`
74/// an UNIX timestamp in nanoseconds
75///
76/// # Returns
77///
78/// the NTP time for `unixtime`.
79#[doc(alias = "gst_rtcp_unix_to_ntp")]
80pub fn rtcp_unix_to_ntp(unixtime: u64) -> u64 {
81    assert_initialized_main_thread!();
82    unsafe { ffi::gst_rtcp_unix_to_ntp(unixtime) }
83}
84
85/// Retrieve all the factories of the currently registered RTP header
86/// extensions. Call [`ElementFactory::create()`][crate::gst::ElementFactory::create()] with each factory to create
87/// the associated [`RTPHeaderExtension`][crate::RTPHeaderExtension].
88///
89/// # Returns
90///
91/// a `GList` of
92///  [`gst::ElementFactory`][crate::gst::ElementFactory]'s. Use `gst_plugin_feature_list_free()` after use
93#[cfg(feature = "v1_20")]
94#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
95#[doc(alias = "gst_rtp_get_header_extension_list")]
96pub fn rtp_get_header_extension_list() -> Vec<gst::ElementFactory> {
97    assert_initialized_main_thread!();
98    unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_rtp_get_header_extension_list()) }
99}
100
101//#[doc(alias = "gst_rtp_hdrext_set_ntp_56")]
102//pub fn rtp_hdrext_set_ntp_56(data: /*Unimplemented*/Option<Basic: Pointer>, size: u32, ntptime: u64) -> bool {
103//    unsafe { TODO: call ffi:gst_rtp_hdrext_set_ntp_56() }
104//}
105
106//#[doc(alias = "gst_rtp_hdrext_set_ntp_64")]
107//pub fn rtp_hdrext_set_ntp_64(data: /*Unimplemented*/Option<Basic: Pointer>, size: u32, ntptime: u64) -> bool {
108//    unsafe { TODO: call ffi:gst_rtp_hdrext_set_ntp_64() }
109//}