Commit graph

2505 commits

Author SHA1 Message Date
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
b91d23521f Remove unnecessary TODO comment 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
4ebcd78acc Print frame timestamp/timecode in debug output 2019-07-15 20:38:00 +03:00
Sebastian Dröge
75eb959c80 Add support for all other video formats 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
4443e03cd2 Remove wrong and unneeded latency query handling 2019-07-15 18:34:09 +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
32289047a5 Remove receiver/latency from Settings to State struct
And clean up usage of both.
2019-07-15 18:30:44 +03:00
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
Sebastian Dröge
f149f8f1b5 Don't use ONCE_INIT anymore now that Once::new() is const 2019-07-11 16:41: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
fbbd70950a Fix a few more clippy warnings 2019-07-11 11:20:39 +03:00
Sebastian Dröge
f7fd1e3f99 togglerecord: Clip raw audio/video buffers to the segment/recording boundaries
And extend tests to actually check for this to work.
2019-07-11 11:20:35 +03:00
Sebastian Dröge
20c02c4b38 togglerecord: Calculate a fallback duration for audio/video buffers based on the caps if possible
I.e. based on the framerate for video and based on the buffer size,
sample size and sample rate for raw audio.
2019-07-11 10:47:30 +03:00
Sebastian Dröge
caeff6f968 threadshare/udpsrc: Use MaybeUninit instead of mem::zeroed() 2019-07-10 17:20:45 +03:00
Sebastian Dröge
70385a4833 Update minimum supported Rust version to 1.36 2019-07-10 11:24:07 +03: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
Sebastian Dröge
8b4f0f91a9 version-helper: Take CARGO_MANIFEST_DIR at runtime, not at compile-time
Otherwise we'll always look at the directory of the version-helper crate
instead of the crate that is actually compiled.
2019-07-07 13:36:48 +03:00
Sebastian Dröge
d0e5868880 version-helper: Add documentation 2019-07-07 13:36:48 +03:00
Sebastian Dröge
107183ad57 version-helper: Don't build the toml crate with all default features
We don't need to build serde, etc for our uses and it increases build
times quite a bit.
2019-07-07 13:36:48 +03:00
Sebastian Dröge
7ab4aff180 version-helper: Get ready for a release on crates.io 2019-07-07 13:36:48 +03:00
Sebastian Dröge
50730574ba version-helper: Check first for a git repository in the manifest dir and only then one directory up
This allows using the crate also in git repositories that contain a
single GStreamer plugin and not only in Cargo workspaces.
2019-07-07 13:36:48 +03:00
Sebastian Dröge
7e93c20b38 version-helper: Extract release version for plugins from a release.txt if there is no git repository
This will allow us packaging the plugins in a tarball and generate
proper plugin metadata.
2019-07-07 13:36:48 +03:00
Sebastian Dröge
924b89a880 closedcaption: Update version number in mcc_enc test 2019-07-07 13:36:25 +03:00
Sebastian Dröge
acc4b6a7e2 Update versions to 0.6.0 2019-07-07 13:20:15 +03:00
Sebastian Dröge
91adc3c416 Clean up Makefile some more
Use $(DESTDIR) as prefix for the installation to make distros' lifes
easier and have a simple "all" / "build" / "install" rule. By default we
do a release build, if DEBUG=1 is specified we do a debug build.
2019-07-06 10:32:22 +03:00
ahamedsajeer.15
ce1ed81922 reqwesthttpsrc: Report correct error messages based on HTTP error status codes
404 is mapped to ResourceError::NotFound
401,402,403,407 are mapped to ResourceError::NotAuthorized
other error status codes are mapped to ResourceError::OpenRead
This mirrors the behavior in souphttpsrc
2019-07-05 18:54:10 +05:30
ahamedsajeer.15
e20a1ce947 reqwesthttpsrc: test for 404 error 2019-07-05 08:58:19 +05:30
Sebastian Dröge
b4efa42d8f Fix various clippy warnings 2019-07-04 18:56:33 +03:00
Sebastian Dröge
63a840e0e7 Bring gitlab CI in sync with gstreamer-rs and add clippy task
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/58
2019-07-04 18:21:29 +03:00
Sebastian Dröge
0a008354a4 reqwesthttpsrc: Drop the receiver before stopping the element
Otherwise there might still some thread waiting for the receiver to
consume a message and we would deadlock here. Dropping the receiver
drops all messages and unblocks them all immediately.

Also don't panic when sending messages to a dropped receiver.
2019-07-04 18:13:36 +03:00
Sebastian Dröge
2df6a5e049 sodium: Statically register the plugin in the example
So that it's not needed to set up GST_PLUGIN_PATH accordingly or install
the plugin first before running the examples.
2019-07-04 14:59:29 +03:00
Sebastian Dröge
e8d6a7cbd4 sodiumdecrypter: Fix some typos 2019-07-04 14:58:52 +03:00