scottlamb / retina

High-level RTSP multimedia streaming library, in Rust
https://crates.io/crates/retina
Apache License 2.0
218 stars 46 forks source link

access raw RTCP packet (headers and all) #59

Closed RustPanda closed 2 years ago

RustPanda commented 2 years ago

Hello. To integrate Gstreamer and WebRTC into Retina, need to transfer the raw RTCP packet. Can you add SenderReport::raw(&self) -> &[u8]?

let launch = "rtpsession name=session \
    appsrc name=rtpsrc ! session.recv_rtp_sink \
    appsrc name=rtcpsrc ! session.recv_rtcp_sink \  
    session.recv_rtp_src ! rtph264depay ! h264parse ! vaapidecodebin ! autovideosink";
scottlamb commented 2 years ago

I can add something. RTCP comes in "compound packets" which usually start with a sender or receiver report (RFC 3550 says they MUST; RFC 5506 weakens this) and usually end with a source description (similarly, RFC 3550 says so, RFC 5506 says not necessarily). What does gstreamer expect—to get just sender report packets? to get compound packets? to get each packet within the compound packet individually?

RustPanda commented 2 years ago

@scottlamb

scottlamb commented 2 years ago

I'm working on an updated interface to access the full compound packet.

scottlamb commented 2 years ago

Now done, on the next branch. Please let me know how the new API works out for you.

RustPanda commented 2 years ago

@scottlamb thanks, I'll check this week