mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
rtp/rtp_buffer: Wrap set_marker() and get_marker() methods
This commit is contained in:
parent
a426c03720
commit
4648cf1b34
1 changed files with 17 additions and 0 deletions
|
@ -86,6 +86,12 @@ impl<'a> RTPBuffer<'a, Writable> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn set_marker(&mut self, m: bool) {
|
||||
unsafe {
|
||||
gst_rtp_sys::gst_rtp_buffer_set_marker(&mut self.rtp_buffer, m.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_payload_type(&mut self, pt: u8) {
|
||||
unsafe {
|
||||
gst_rtp_sys::gst_rtp_buffer_set_payload_type(&mut self.rtp_buffer, pt);
|
||||
|
@ -220,6 +226,14 @@ impl<'a, T> RTPBuffer<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_marker(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_rtp_sys::gst_rtp_buffer_get_marker(
|
||||
glib::translate::mut_override(&self.rtp_buffer),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_payload_size(&self) -> u32 {
|
||||
unsafe {
|
||||
gst_rtp_sys::gst_rtp_buffer_get_payload_len(glib::translate::mut_override(
|
||||
|
@ -370,6 +384,9 @@ mod tests {
|
|||
rtp_buffer.set_seq(42);
|
||||
assert_eq!(rtp_buffer.get_seq(), 42);
|
||||
|
||||
rtp_buffer.set_marker(true);
|
||||
assert!(rtp_buffer.get_marker());
|
||||
|
||||
rtp_buffer.set_payload_type(43);
|
||||
assert_eq!(rtp_buffer.get_payload_type(), 43);
|
||||
|
||||
|
|
Loading…
Reference in a new issue