Commit graph

43 commits

Author SHA1 Message Date
Sebastian Dröge 9c540d8abb Move everything to net/ndi for preparing to merge into gst-plugins-rs 2022-10-12 19:25:32 +03:00
Sebastian Dröge c221e9e870 Update to gstreamer-rs 0.18 2022-01-22 12:12:03 +02:00
Sebastian Dröge f890abe5cb Add support for receiving compressed data from the source
This requires building against and using the NDI Advanced SDK and is
opt-in via the "advanced-sdk" cargo feature.
2021-10-01 13:12:14 +03:00
Sebastian Dröge b98efea5aa Allow selecting the receive color format in the source 2021-10-01 12:50:57 +03:00
Sebastian Dröge febb2fb035 Add receive-time timestamping mode
This directly uses the receive times of each packet.
2021-09-30 11:02:26 +03:00
Sebastian Dröge b3184b45bc Combine audio/video source into a single element and add a demuxer for that
This simplifies the code considerably.
2021-09-29 14:48:32 +03:00
Sebastian Dröge 291d951b01 Update to gstreamer-rs 0.17 2021-09-13 13:43:31 +03:00
Sebastian Dröge 2345c455c1 Add initial version of NDI sink
The sink can accept audio or video directly, or if both should be
provided at once it is necesary to use the ndisinkcombiner before the
ndisink to merge both audio and video into the same stream.

Fixes https://github.com/teltek/gst-plugin-ndi/issues/10
2021-02-26 11:00:23 +02:00
Sebastian Dröge 84e4fe7f59 Add new timestamp mode based on the receive time and timecode
In addition to the old one based on the receive time and timestamp.

Also make that new mode the default as it will usually give more
accurate results because the timestamp is just the send time while the
timecode is usually set by the sender based on the media timestamps.
2021-02-26 11:00:23 +02:00
Sebastian Dröge bb1e1b1529 Use glib GEnum derive macro instead of implementing this manually 2021-02-23 12:40:28 +02:00
Sebastian Dröge 0aef5152a7 Simplify code for Rust 2018 a bit 2021-02-23 12:37:24 +02:00
Sebastian Dröge eee4a65d19 Update to byte-slice-cast 1.0 and switch from lazy_static to once_cell 2021-02-23 12:29:04 +02:00
Sebastian Dröge 5fa3b689f0 Update to gstreamer-rs 0.16 2020-07-27 16:10:39 +03:00
Sebastian Dröge f2a4699d13 Add a device provider for listing available sources
Fixes https://github.com/teltek/gst-plugin-ndi/issues/36
2020-01-20 22:01:33 +02:00
Sebastian Dröge 06e5d7cb95 Depend on gstreamer 0.14.4 for gst::calculate_linear_regression()
Instead of having our own unsafe binding for it.
2019-08-14 22:49:55 +03:00
Sebastian Dröge 57d928ad96 Switch to 2018 edition
Fixes https://github.com/teltek/gst-plugin-ndi/issues/15
2019-07-23 14:26:04 +03:00
Sebastian Dröge cd741f37be Fix compilation with --no-default-features 2019-07-22 09:12:04 +03:00
Sebastian Dröge fa9f788190 Improve type-safety a bit by making the Receiver generic over the stream type 2019-07-19 11:34:20 +03:00
Sebastian Dröge 33370e42ad Collect observations for the timestamp/receive time mappings and smoothen them
This allows keeping audio/video more in sync with how the sender was
sending it, while also handling network jitter and clock drift in a
reasonable way.
2019-07-19 10:52:47 +03:00
Sebastian Dröge 66d4fd1d90 Move connecting and capturing to separate threads
This ensures that we'll be able to capture every frame even if
downstream of the source is blocking for a moment, and also allows us to
make all operations cancellable.
2019-07-18 15:44:31 +03:00
Sebastian Dröge 19d25d20a7 Implement cancellation of connection attempts 2019-07-17 12:12:58 +03:00
Sebastian Dröge 34858762f7 Consolidate element properties
stream-name is called ndi-name everywhere in the NDI SDK and documentation
ip is called ip-address everywhere

Rename loss-threshold to timeout and change it to be in milliseconds
instead of iterations.

Add connect-timeout for timeout during connection

Add bandwidth and receiver-ndi-name properties, and initialize the
latter with a reasonable default value.
2019-07-17 11:01:40 +03:00
Sebastian Dröge 8b00e80316 Add property for selecting between different timestamping modes 2019-07-17 11:01:40 +03:00
Sebastian Dröge a4890d3295 Add timestamp/timecode into ReferenceTimestampMeta on every buffer 2019-07-16 16:03:15 +03:00
Sebastian Dröge fabcc65460 Properly support interlaced video and signal it correctly in the caps and buffer flags 2019-07-16 13:07:50 +03:00
Sebastian Dröge a500b5297b Simplify boolean expression 2019-07-16 12:49:31 +03:00
Sebastian Dröge cd8bca11aa Run everything to rustfmt to give it a consistent indentation 2019-07-15 20:38:00 +03:00
Sebastian Dröge 5022ff412c Fix caps negotiation
We can't just fixate to any close to what we receive right now but only
support exactly the caps we receive. So check the format of each frame
and negotiate exactly those caps as needed when receiving frames.

Also re-negotiate if the caps are ever changing.
2019-07-15 20:13:12 +03:00
Sebastian Dröge 2ad413773e Take the current running time as PTS for now and clean up timestamp/duration calculations
We might want to take the timestamp provided by the NDI SDK at a later
time but this needs to be done correctly.
2019-07-15 18:30:44 +03:00
Sebastian Dröge 25d7c9e74f Use glib::Type instead of element name or factory name for deciding between audio/video 2019-07-15 17:56:29 +03:00
Sebastian Dröge 861d216eed Port audio/video source to the safe NDI SDK wrappers
This also fixes various memory unsafety issues.

And add lots of FIXME comments for code that is currently wrong.
2019-07-11 23:37:35 +03:00
Sebastian Dröge 48f8c498fa Wrap unsafe NDI C API in safe wrappers 2019-07-11 23:25:30 +03:00
Alfonso Rodríguez Pereira 13ce2da387
Merge pull request #27 from sdroege/plugin-version-helper
Use gst-plugin-version-helper crate to populate the plugin metadata
2019-07-11 11:09:36 +02:00
Sebastian Dröge bd1f8cb7d1 Use NDIlib_find_wait_for_sources() instead of thread::sleep() 2019-07-09 19:27:14 +03:00
Sebastian Dröge 3acd848b5f Use gst-plugin-version-helper crate to populate the plugin metadata 2019-07-09 18:35:47 +03:00
rubenrua 28265f1151 Update to the new version of the GStreamer Rust bindings, 0.14.0
https://gstreamer.freedesktop.org/news/#2019-06-24T20:00:00Z
2019-06-25 18:20:50 +02:00
rubenrua 6dc39b2dea Fix rust fmt 2019-03-26 17:41:28 +01:00
Daniel Vilar b85fcdf649 Cast correctly audio data in buffer from *mut u8 to *mut i16 2018-12-12 12:00:33 +01:00
Daniel Vilar d3ba5efff8 Port to new glib subclassing API #13 2018-12-11 17:47:03 +01:00
Daniel Vilar 678c5876de Improved timestamps calculation
Due to the possibility to connect to two or more streams simultaneously with different clocks synchronization It's necessary to improve the timestamps calculation to detect this.

Prior to this commit, we saved the first timestamp that arrive and use it to calculate the running time of the stream for the rest of frames (pts field in gstreamer buffer) in all of the streams. This lead to problems when connecting to multiple streams in multiple computers and the clocks were not correctly synchronized.

To fix this, now we save a different initial timestamp for each stream.
2018-12-10 13:27:23 +01:00
rubenrua cb1ea2195f Fix rust fmt 2018-09-25 16:04:00 +02:00
Sebastian Dröge a8c9d78bff Compare element factory names to distinguish video source from audio source
We could also go via the glib::Type but that requires more steps unless
we also add a getter from the registered type to the audio/video source
modules.
2018-09-25 13:37:59 +03:00
Daniel Vilar 440a353f93 Publish code in Github 2018-09-18 13:39:34 +02:00
Renamed from gst-plugin-ndi/src/lib.rs (Browse further)