RTP buffer, mutable access to payload
Hey,
I'm trying to figure out how to write a payload to RTP buffer.
Consider the following code:
let mut buf = gst::Buffer::new_rtp_with_sizes(42, 0, 0).unwrap();
{
let buf_mut = buf.get_mut().unwrap();
let mut rtpbuf = RTPBuffer::from_buffer_writable(buf_mut).unwrap();
let payload = rtpbuf.payload().unwrap();
payload.copy_from_slice(&data[..]);
}
Obviously, I cannot fill the payload because payload()
returns Result<&[u8], ...>
I guess, I could fill the payload via gst::Buffer
but I will need to know the actual offset of payload. It feels like, either I'm missing something or something is missing from API :) ?
Edited by Tomasz Andrzejak