Nirbheek Chauhan
2c39756b24
gst-ptp-helper: Fix meson warning about rust_crate_type
...
WARNING: Project targets '>= 1.4' but uses feature deprecated since
'1.3.0': rust_crate_type arg in static_library. Use rust_abi or
rust.proc_macro() instead.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8753 >
2025-04-30 10:18:57 +00:00
Thibault Saunier
2c9a642b66
meson: Give the same name for api_version in all modules
...
There were 2 version of it, apiversion and api_version, I chose the one
with most occurencies: `api_version`
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8178 >
2024-12-20 20:19:28 +00:00
Thibault Saunier
619b1df389
gst-plugin-scanner: Do not create tracers when inspecting plugins
...
Ensuring that GST_TRACERS is not set in that process
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8086 >
2024-12-10 09:35:35 +00:00
Taruntej Kanakamalla
36d8243397
ptp: use ip_mreq instead of ip_mreqn for macOS
...
To join a multicast the macOS still uses the interface address
from the ip_mreq instead of the ip_mreqn unlike other Linux systems.
So add a new conditional block for macOS to use ip_mreq for IP_ADD_MEMBERSHIP
and ip_mreqn for IP_MULTICAST_IF
This is similar to the fix in the glib for multicast join/leave
operation on macOS
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4333
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7851 >
2024-11-11 10:26:43 +00:00
Sebastian Dröge
25184cf496
ptp-helper: Silence deprecation warning
...
The new API is only available since Rust 1.81.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7678 >
2024-10-17 22:39:45 +00:00
Samuel Thibault
31047b878f
ptp-helper: Add GNU/Hurd support
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6970 >
2024-05-30 16:14:29 +00:00
Sebastian Dröge
2a58e6de8f
gstreamer: ptp-helper: Use u64 instead of c_ulong for ifa_flags on Solaris/Illumos
...
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3553#note_2429400
Patch by Marcel Telka <marcel@telka.sk>.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6934 >
2024-05-28 09:06:57 +03:00
Sebastian Dröge
1c88b06912
gstreamer: ptp-helper: Use if_nametoindex
and setsockopt
on Solaris / Illumos too
...
Patch by Marcel Telka <marcel@telka.sk>.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3552
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925 >
2024-05-26 12:34:26 +03:00
Sebastian Dröge
354623a246
gstreamer: ptp-helper: Don't import Context
trait multiple times unnecessarily
...
This only affected the Solaris / Illumos code path.
Patch by Marcel Telka <marcel@telka.sk>.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3551
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925 >
2024-05-26 12:34:21 +03:00
Sebastian Dröge
8bff6b4988
gstreamer: ptp-helper: Use c_ulong
for ifa_flags
on Solaris/Illumos
...
Based on a patch by Marcel Telka <marcel@telka.sk>.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3553
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925 >
2024-05-26 12:34:13 +03:00
Sebastian Dröge
9eb3ab3a59
ptp: Silence warning about some unused trait methods
...
These are not used yet but will likely be useful in the future.
Rust 1.79 (nightly) is warning about them being unused.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6601 >
2024-04-10 14:33:46 +00:00
Sebastian Dröge
9ab9ceb964
ptp-helper: Fix clippy warning and simplify code a bit
...
warning: you seem to be trying to use `match` for an equality check. Consider using `if`
--> ../subprojects/gstreamer/libs/gst/helpers/ptp/main.rs:246:17
|
246 | / match ptp_message.message_type {
247 | | PtpMessageType::DELAY_REQ => {
248 | | if args.verbose {
249 | | trace!("Ignoring our own PTP message");
... |
253 | | _ => (),
254 | | }
| |_________________^
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6245 >
2024-03-06 09:17:53 +00:00
Sebastian Dröge
8859f257c2
ptp: Don't install test executable
...
And handle it like all our other test executables.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6262 >
2024-03-05 18:55:00 +00:00
Jochen Henneberg
c6636533d4
ptp-helper: Allow sync to master clock on same host
...
If we drop all messages with the same clock id as ours we will also
drop all messages coming from a PTP clock on our host since both clock
ids are build from the same MAC address.
At least for Linux we do not see our own messages anyway since the
network stack can well distinguish between multicast send from our
socket or from another socket on the same machine. To make sure that
this works for all supported platforms just drop delay requests since
this is the only message that is sent from the GStreamer PTP clock.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6172 >
2024-02-22 07:52:35 +00:00
Thibault Saunier
9afab6107f
gdb: Fix the way we wrap segments
...
Without that we end up with a reference to a GBoxed instead of the actual segment making the rest of the code fail
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5986 >
2024-01-25 12:27:29 +00:00
Thibault Saunier
f09da2db0e
gdb: Fix issue with undeclared variable
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5986 >
2024-01-25 12:27:29 +00:00
Thibault Saunier
e98c515c58
gdb: Handle the case where the fundamental type table is optimized out
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5986 >
2024-01-25 12:27:29 +00:00
Thibault Saunier
f1070b4380
gdb: Fix python style
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5986 >
2024-01-25 12:27:29 +00:00
Thibault Saunier
6258ee56d2
gdb: Workaround optimized out quark_seq_id
...
On fedora 38 (and it was the case in previous releases), the
quark_seq_id is optimized out so getting quarks from the
global variable always failed. This patch works around that by assuming
it is a valid quark whenever the quark_seq_id is not accessible.
This issue often manifested as Python Exception <class 'TypeError'>:
can only concatenate str (not "NoneType") to str when debugging as
other parts of the code assume that getting the quark for a GType name
will work.
Same as https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3559
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5986 >
2024-01-25 12:27:29 +00:00
Sebastian Dröge
5630294ce6
ptp-helper: Allow unused Stderr
export
...
It's not used when building tests and would otherwise cause a warning.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5872 >
2023-12-29 10:18:52 +02:00
Sebastian Dröge
ba5684d0d7
ptp: Add ttl
configuration to gst_ptp_init_full()
...
This allows configuring the TTL that is used for multicast packets sent
out on the sockets, and is defaulting to 1 as before. The default might
change at some point.
In some networks multiple hops are needed to reach the PTP clock and
this allows to configure GStreamer in a way that works in such networks.
At a later time, per-domain or per-interface TTL configurations might be
added when needed.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5649 >
2023-11-16 12:26:02 +00:00
Sebastian Dröge
ffa30637c4
ptp: Use SO_BINDTOIFINDEX / SO_BINDTODEVICE on Linux
...
This makes sure we really really really only get packets from the
desired interface as passing a device to IP_ADD_MEMBERSHIP apparently
does not have this effect alone.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5584 >
2023-11-02 11:42:44 +00:00
Sebastian Dröge
134a66277e
ptp: Fix a couple of stylistic clippy warnings
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5441 >
2023-10-06 13:39:34 +03:00
Sebastian Dröge
a0522c8193
ptp: Fix compilation with rustc 1.48
...
That's currently the minimum version we declare in meson.build but the
latest changes introduced some usage of 1.62 features.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5265 >
2023-08-31 06:05:18 +00:00
Sebastian Dröge
967aa2abca
ptp: Listen with different sockets on individual interfaces
...
This allows us to portably know on which interface a multicast packet
arrived, and to send back any packets for that clock on the correct
interface.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2728
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5232 >
2023-08-30 12:19:46 +00:00
Sebastian Dröge
c9d9af2fee
ptp: Set port-reuse socket options before binding the socket
...
Otherwise it only works if GStreamer is binding the first socket on this
port.
Unfortunately this requires duplicating a bit more of Rust std because
`UdpSocket` can only be created already bound without allowing to set
any options between socket creation and binding.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4807 >
2023-06-08 13:43:33 +00:00
Sebastian Dröge
2ef261557d
ptp: Correctly parse clock ID from the commandline parameters in the helper
...
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2652
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4806 >
2023-06-08 10:53:32 +00:00
Stéphane Cerveau
8a28136627
gstreamer-full: helpers built as tools
...
gst-plugin-scanner and gst-completion-helper
are now built part of the helpers as tools.
Add libraries to the summary to know
what library will be built and can be exposed
by gstreamer-full
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128 >
2023-05-31 15:17:11 +00:00
Sebastian Dröge
98c5ceb73f
ptp: On Windows handle socket polls that result in no error but also no FD_READ event
...
According to the documentation this should never happen but apparently
does under certain circumstances. As the sockets are set non-blocking,
trying to read from them regardless should not cause any problems.
In all cases that were observed so far, the socket in question actually
has a packet queued up for reading.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4748 >
2023-05-31 13:11:39 +00:00
Sebastian Dröge
fa8fbab0f7
ptp: Parse PTP messages in the helper process and filter earlier
...
This drops invalid, unknown or uninteresting PTP messages in the helper
process already instead of forwarding them to the main process.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4665 >
2023-05-24 14:16:23 +00:00
Sebastian Dröge
5a79d230ce
ptp: Set UDP sockets as non-blocking
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4665 >
2023-05-24 14:16:23 +00:00
Sebastian Dröge
b76f9c8392
ptp: Capture actual send/receive times in the helper process
...
While this doesn't yet use any OS provided times from the actual network
stack, this still gets rid of any IPC jitter between the helper process
and the main process as part of the PTP time calculations and should
improve accuracy.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4665 >
2023-05-24 14:16:23 +00:00
Sebastian Dröge
d55492add4
ptp: Fix compilation with Rust 1.48
...
Use `ErrorKind::NotFound` instead of `ErrorKind::Unsupported` if the
`getrandom` syscall is not available. `Unsupported` was added in 1.53.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4647 >
2023-05-19 12:47:28 +00:00
Sebastian Dröge
87ca02bee7
ptp: Add logging between the helper process and the main process via stderr
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4647 >
2023-05-19 12:47:28 +00:00
Sebastian Dröge
b74669a38a
ptp: Get rid of struct padding in the messages with the helper process
...
Also remove the now unnecessary private header file.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4647 >
2023-05-19 12:47:28 +00:00
Sebastian Dröge
0219b6f6fa
ptp-helper: Add some tests for functionality and memory safety of unsafe code
...
These tests are mostly for ensuring that the calls to system APIs are
done correctly and that there are no memory bugs (that would be caught
by valgrind) in the unsafe code.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4458 >
2023-05-12 17:06:01 +00:00
Sebastian Dröge
6378ebbdcd
ptp-helper: Add a feature option for the PTP support
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4410 >
2023-04-13 12:43:25 +00:00
Sebastian Dröge
2e84603b02
ptp-helper: Convert various meson message() to warning()
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4410 >
2023-04-13 12:43:25 +00:00
Sebastian Dröge
7cba04f2c6
ptp-helper: Don't check for a Rust compiler on unsupported platforms
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4410 >
2023-04-13 12:43:25 +00:00
Sebastian Dröge
b35d598003
ptp-helper: Check for the required Rust toolchain version via meson
...
If an older version is found that gives a more useful output than a
compiler error at a later time.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4410 >
2023-04-13 12:43:25 +00:00
Sebastian Dröge
9d25a5075e
ptp-helper: Set a process priority / nice value of -5 on UNIX platforms
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3889 >
2023-04-07 15:49:02 +00:00
Sebastian Dröge
572d344482
ptp-helper: Set thread priority to time-critical on Windows
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3889 >
2023-04-07 15:49:02 +00:00
Sebastian Dröge
3fdfcdf2f6
ptp-helper: Rewrite in Rust for portability and security
...
This works on Linux, Android, Windows, macOS, FreeBSD, NetBSD, OpenBSD,
DragonFlyBSD, Solaris and Illumos.
Newly supported compared to the C version is Windows.
Compared to the C version various error paths are handled more correctly
and a couple of memory leaks are fixed. Otherwise it should work identically.
The minimum required Rust version for compiling this is 1.48, i.e. the
version currently in Debian stable. On Windows, Rust 1.54 is needed at
least.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1259
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3889 >
2023-04-07 15:49:02 +00:00
Seungha Yang
621feb32e9
gst-plugin-scanner: Add support for Windows
...
Adding Win32 specific plugin loader implementation.
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/11
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3512 >
2023-01-25 18:24:28 +00:00
Xavier Claessens
5f0493d33a
meson: Set install_tag on some targets
...
Trying to follow recommendation from Meson documentation:
https://mesonbuild.com/Installing.html#installation-tags
Move tools into 'bin' or 'bin-devel' categories to keep only libs and
plugins in the default 'runtime' category. This simplifies distribution
of GStreamer application skipping parts that are not needed, similarly
to what Cerbero does by hardcoding huge list of files.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3017 >
2022-09-20 10:08:15 +00:00
Xavier Claessens
b225f4215b
meson: Add PYTHONPATH to load GDB helper module
...
Meson generates a gdbinit file that will automatically load gstreamer
script. However that script uses a helper python module that needs
PYTHONPATH to be pointing into the right location in the source
tree to be able to find gst_gdb.py.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1796 >
2022-04-22 11:53:31 +00:00
Xavier Claessens
b004464ac6
Remove glib and gobject dependencies everywhere
...
They are part of gst_dep already and we have to make sure to always have
gst_dep. The order in dependencies matters, because it is also the order
in which Meson will set -I args. We want gstreamer's config.h to take
precedence over glib's private config.h when it's a subproject.
While at it, remove useless fallback args for gmodule/gio dependencies,
only gstreamer core needs it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2031 >
2022-04-01 16:32:17 +00:00
Xavier Claessens
0fa7923937
Meson: Set install_tag on some files
...
Meson tries to guess the tag (runtime, devel, etc) for every installed
file, but it cannot guess them all. There is a list at the end of
meson-log.txt of files we need to tag manually.
See https://mesonbuild.com/Installing.html#installation-tags .
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1934 >
2022-03-14 08:56:54 -04:00
Xavier Claessens
3d8372cc50
devenv: Add some missing GStreamer specific env variables
...
This should make "meson devenv" closer to what "gst-env.py" sets.
- GST_VALIDATE_SCENARIOS_PATH
- GST_VALIDATE_APPS_DIR
- GST_OMX_CONFIG_DIR
- GST_ENCODING_TARGET_PATH
- GST_PRESET_PATH
- GST_PLUGIN_SCANNER
- GST_PTP_HELPER
- _GI_OVERRIDES_PATH
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1768 >
2022-02-25 20:35:26 +00:00
Nirbheek Chauhan
557d385d6c
gst-ptp-helper: Do not disable multicast loopback
...
Otherwise we cannot run gst-ptp-helper if the PTP master is on the
same device.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1306 >
2021-11-08 07:27:08 +00:00