Commit graph

144 commits

Author SHA1 Message Date
Sebastian Dröge
9afe1d74b8 Set on_program to true by default in the Tally 2019-07-15 18:00:51 +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
71d8f7108c Remove unused FFI code 2019-07-11 23:37:35 +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
Sebastian Dröge
a0c918de71 Never send an empty buffer but simply retry
Sending an empty buffer will cause downstream to fail as it has the
wrong size.
2019-07-11 21:59:42 +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
Alfonso Rodríguez Pereira
3742f8e776
Merge pull request #29 from sdroege/ndi-windows-linking
Use correct library name for linking on Windows
2019-07-11 11:07:23 +02:00
Alfonso Rodríguez Pereira
cc63b187b9
Merge pull request #33 from sdroege/no-custom-error
Never return gst::FlowError::CustomError outside the element
2019-07-11 11:06:47 +02:00
Alfonso Rodríguez Pereira
a355220254
Merge pull request #31 from sdroege/no-vec-from-raw-parts
Use slice::from_raw_parts instead of Vec::from_raw_parts and always free video frames
2019-07-11 11:05:33 +02:00
Alfonso Rodríguez Pereira
33fbc1c508
Merge pull request #30 from sdroege/sleep
Use NDIlib_find_wait_for_sources() instead of thread::sleep()
2019-07-11 11:05:10 +02:00
Sebastian Dröge
c483270f27 Never return gst::FlowError::CustomError outside the element
It's for internal-usage and must be converted to a normal error at the
boundary to the base classes.
2019-07-09 19:29:45 +03:00
Sebastian Dröge
b41d5839d4 Always free video frames with NDIlib_recv_free_video_v2() after last use
And not potentially before or not at all.
2019-07-09 19:27:55 +03:00
Sebastian Dröge
7b8070c55d Use slice::from_raw_parts instead of Vec::from_raw_parts
The latter must only be called on memory that was allocated by Rust for
a Vec and will cause crashes depending on the platform otherwise.

Also it would free the memory as if a Vec was allocated, which would
free memory that we don't own to begin with.
2019-07-09 19:27:55 +03: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
38e39d181e Use correct library name for linking on Windows 2019-07-09 19:26:18 +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
Alfonso Rodríguez Pereira
def42b5514
Merge pull request #26 from teltek/feature_gst_v0.14.0
Update to the new version of the GStreamer Rust bindings, 0.14.0
2019-06-27 13:10:10 +02: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
Ruben Gonzalez
2802a6fc97
Merge pull request #25 from o-reo/freeze_dependencies
freeze dependencies
2019-05-16 16:04:14 +02:00
o-reo
81cde09641 compile: freeze gstreamer-rs dependencies 2019-05-16 15:08:10 +02:00
Ruben Gonzalez
6cc722af25
Merge pull request #24 from o-reo/fix_element_register
fix element register due to gstreamer rs update
2019-04-26 11:00:38 +02:00
o-reo
c1eecbc5c4 fix element register due to gstreamer rs update 2019-04-23 16:17:29 +02:00
rubenrua
6dc39b2dea Fix rust fmt 2019-03-26 17:41:28 +01:00
Ruben Gonzalez
fb56cdc87c
Merge pull request #21 from o-reo/master
FIX changed return for gstreamer functions, fixed NDI frames memory leaks
2019-03-26 17:37:51 +01:00
Ruben Gonzalez
2794366186
Update license (fix #22)
Use the same GStreamer license
2019-03-18 18:24:37 +01:00
o-reo
16139c4565 FIX: Removed NDI free fctns when receiving NDI frame type none 2019-03-06 17:57:28 +01:00
o-reo
547df0f042 FIX: left a bracked after unsafe block refactoring 2019-03-06 16:16:47 +01:00
o-reo
dc2591ab45 FIX: Removed unncessary NDI free methods
- when looping until a specific frame typeis returned no free are needed
2019-03-05 17:59:44 +01:00
o-reo
7c98b2e830 STYLE: clean useless comment 2019-03-04 15:21:01 +01:00
o-reo
761d7ae7ef FIX: Fixed NDI frames memory leaks 2019-03-01 11:24:54 +01:00
o-reo
a407346053 ENH: Changed error message on start to notfound 2019-02-28 13:27:38 +01:00
o-reo
1bacf8237b ENH: Error handling on fn start 2019-02-28 12:13:40 +01:00
o-reo
f74b0b4088 FIX: changed return bool to errorMessages 2019-02-28 11:43:31 +01:00
o-reo
c1f0b8e941 WIP: changed return type for status_change, start, stop, change_caps,... 2019-02-28 10:55:01 +01:00
Ruben Gonzalez
127dbca2f5
Merge pull request #17 from teltek/new_glib_subclassing
Port to new glib subclassing API
2018-12-12 12:21:37 +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
Ruben Gonzalez
c12f216b59
Merge pull request #16 from teltek/fix_initial_timestamps
Improved timestamps calculation
2018-12-11 17:35:54 +01:00
Daniel Vilar
6116729c5d Fixed timestamps 2018-12-11 16:42:27 +01:00
Daniel Vilar
3e38042d7f Improve logging #14 2018-12-11 12:26:50 +01:00
Daniel Vilar
9a2b647443 Updated descriptions of element properties 2018-12-10 17:29:30 +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
Daniel Vilar
f06ac8c035
Merge pull request #11 from teltek/loss_threshold_param
Added parameter to adjust threshold when detecting that a stream was closed
2018-12-05 17:35:46 +01:00
Daniel Vilar
b0b3316616
Merge pull request #12 from teltek/fix_audio_multichannel
Fix issues with multichanel audio
2018-12-05 17:35:34 +01:00
Daniel Vilar
9df0a01a0c If param loss_threshold is 0, we don't close the stream connection when receiving a NDIlib_frame_type_none 2018-12-05 16:13:36 +01:00
Daniel Vilar
e68bb9b4aa Fix issues with multichanel audio 2018-12-05 15:22:01 +01:00
Daniel Vilar
192253ab05 A new parameter was added to adjust the threshold when detecting that a stream was closed 2018-12-05 12:55:01 +01:00
rubenrua
227080e32d Add comment about Newtek NDI times resolution
See: https://github.com/FFmpeg/FFmpeg/blob/master/libavdevice/libndi_newtek_common.h#L27

From NDI SDK Documentation:
This is the timecode of this frame in 100ns intervals. This is generally not used internally by the SDK, but is passed
through to applications who may interpret it as they wish. When sending data, a value of
NDIlib_send_timecode_synthesize can be specified (and should be the default), the operation of this value is
documented in the sending section of this documentation. NDIlib_send_timecode_synthesize will yield UTC
time in 100ns intervals since the Unix Time Epoch 1/1/1970 00:00. When interpreting this timecode a receiving
application may choose to localise the time of day based on time zone offset which can optionally be communicated by
the sender in connection metadata. Since timecode is stored in UTC within NDI, communicating timecode time of day for
non UTC time zones requires a translation
2018-09-27 10:18:54 +02:00
rubenrua
cb1ea2195f Fix rust fmt 2018-09-25 16:04:00 +02:00