-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault on gstreamer_sdp::SDPMessage::parse_buffer #108
Comments
This works for me: fn gst_sdp_message_parse_buffer(data: &[u8]) -> gstreamer_sdp::SDPMessage {
unsafe {
let mut sdp = mem::zeroed();
gstreamer_sdp_sys::gst_sdp_message_new(&mut sdp);
gstreamer_sdp_sys::gst_sdp_message_parse_buffer(
data.to_glib_none().0 as *mut u8,
data.len() as u32,
sdp,
);
from_glib_full(sdp)
}
} |
Good catch! A call to Do you want to send a PR? |
Yep! On a somewhat related topic. fn sdp_message_as_text(offer: gstreamer_webrtc::WebRTCSessionDescription) -> Option<String> {
unsafe {
from_glib_full(gstreamer_sdp_sys::gst_sdp_message_as_text(
(*offer.to_glib_none().0).sdp,
))
}
} Should sdp be available as an attribute? |
Yes, there should be a getter for taking it from the struct field. I expect that there are more things missing for the webrtc and sdp library as nobody wrote an application with those in Rust yet, but all of them should be trivial to fix. |
There should also be a getter for the |
Cool will likely tackle those in the coming days/weeks. Thanks for the help! |
Let me know if you need some help or have any questions, I'd be happy to help with all this :) |
Absolutely! :) |
Example code:
Valgrind output:
Digging into this a little bit more now, but hoping I might be missing something obvious.
I simplified the buffer value to hopefully provide a more concise failure example, but it also segfaults with a full SDP offer.
The text was updated successfully, but these errors were encountered: