Closed sdroege closed 5 years ago
And generally I would always recommend to keep the unsafe code very localized in safe abstractions, and not spread out all over the codebase, or otherwise there's not much difference to writing everything in C.
Lots of further updates here but I'm not done yet.
Next step is to make all the waiting interruptable and make use of the NDI SDK timestamps in a meaningful way.
And then proper error handling everywhere.
This is now finished from my side.
I'm very pleased to review this code next week.
which ndi SDK is this against? great work btw
On 19 July 2019 21:49:21 EEST, androidwiltron notifications@github.com wrote:
which ndi SDK is this against?
I don't think that I needs a newer version than before, no special new SDK API is used. I was using the latest release of the SDK as of two weeks ago.
It should work with pre-3 streams and at least any 3 version of the SDK, if not older. I'd have to check in detail next week.
Are you running into specific problems?
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
Strange error with cargo build --no-default-features
using ubuntu 18.04 (gstreamer version 1.14.4-1~ubuntu18.04.1) and cargo 1.36.0 (c4fcfb725 2019-05-15)
A possible solution could be using two lazy_static blocks:
diff --git a/src/lib.rs b/src/lib.rs
index 596496e..61b5850 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -47,13 +47,14 @@ lazy_static! {
static ref DEFAULT_RECEIVER_NDI_NAME: String = {
format!("GStreamer NDI Source {}-{}", env!("CARGO_PKG_VERSION"), env!("COMMIT_ID"))
};
+}
- #[cfg(feature = "reference-timestamps")]
+#[cfg(feature = "reference-timestamps")]
+lazy_static! {
static ref TIMECODE_CAPS: gst::Caps = {
gst::Caps::new_simple("timestamp/x-ndi-timecode", &[])
};
- #[cfg(feature = "reference-timestamps")]
static ref TIMESTAMP_CAPS: gst::Caps = {
gst::Caps::new_simple("timestamp/x-ndi-timestamp", &[])
};
Thanks, apparently I didn't test without the default features in the later commits. Will do so now!
Should be fine now, sorry :)
Thank you @sdroege for your work on this.
This fixes various memory unsafety issues, memory leaks and also cleans up the code otherwise.
I'll do more work on the FIXME comments in the next days and also fix various other issues that exist currently.