Commit graph libervia-backend/libervia/frontends/tools
Author SHA1 Message Date
Goffi
68da01a043 Dates update. 2026-03-31 12:57:17 +02:00
Goffi
82e2c6efac apply black to the whole codebase. 2026-03-09 09:22:04 +01:00
Goffi
f3f40848b3 black reformatting 2025-11-20 14:50:03 +01:00
Goffi
fa2144a167 frontends (tools/webrtc): Add SinksPipeline:
This sinks allow to use custom pipelines, or to disable playback (e.g.; if we want to
record only by setting `record_fd`).
2025-11-19 17:18:44 +01:00
Goffi
e77bf03f99 frontends (tools/webrtc): Add recording to file descriptor:
A new `record_fd` argument can now be used to specify a file descriptor. If set, the
incoming stream will be written there.

For now `record_fd` must be specified on `WebRTC` creation. In the future, it should
be possible to add or remove it it during a call.
2025-11-17 12:54:13 +01:00
Goffi
ed1a652029 frontends (tools/webrtc): Handle SourcesStdin:
Update the pipeline workflow to handle `SourcesStdin`. A `decodebin` is used to autodetect
the stream type, then audio and/or video elements are created and plugged accordingly.
2025-11-08 22:21:46 +01:00
Goffi
59cf0b846d cli (call), frontends(tools/webrtc_models): Add source for stdin:
If data is piped in with `auto` source, a new `SourcesStdin` is used.
2025-11-08 22:21:23 +01:00
Goffi
e91ebd8cf2 frontends (tools/webrtc): Use actual video sizes for dimension checks and PIP positioning. 2025-11-08 16:06:06 +01:00
Goffi
ac56375b70 frontends(tools/webrtc): raise webrtcbin latency to default's 200 2025-11-08 16:06:06 +01:00
Goffi
ba7ea7664a frontends (tools/webrtc): Add a video recovery mecanism:
When packets are lost, artefacts appear and the remove stream video quickly becomes mush
(can be reproduced by blocking UDP for few seconds). To recover from this situation, the
video pad is monitored for GAP events, and when they occur, a new keyframe is requested 1s
after the last GAP.
2025-11-08 16:06:06 +01:00
Goffi
3ad1f14c25 frontends (tools/Webrtc): use specific configs for video sources:
- Each video source (webcam, desktop, muted) has now a specific config, to adapt
  framerate, bitrate and keyframe max distance.
- Improve logging.
- Tuned pipeline to make it error resilient and improve bitrate.
2025-11-08 16:05:54 +01:00
Goffi
450ea7b381 frontends (tools/webrtc): More tuning for remote video sink:
This tuning is done to avoid mush after a few minutes.
2025-11-06 22:25:26 +01:00
Goffi
cebd60ae56 frontends (tools/webrtc): Fix audio muting. 2025-11-06 22:23:57 +01:00
Goffi
a5e1280af8 frontends (tools/webrtc): Fix pipeline for desktop sharing:
Fix desktop sharing, and improve error handling.
2025-11-06 22:23:51 +01:00
Goffi
9a2830c7e2 frontends (tools/webrtc): improve ICE candidate buffering:
Buffer and wait for remote description to be set before sending ICE candidate. This avoids
the sending of ICE candidates before the negotiation is done.
2025-11-06 22:18:58 +01:00
Goffi
40b1c93f4c frontends (tools/webrtc): Fix PIP merging. 2025-11-06 22:15:47 +01:00
Goffi
d55315e75f tools (webrtc): improved pipeline:
- Adjust parameters and elements to better handle the buffering and jitter.
- Add logging, better error handling.
2025-11-06 22:10:13 +01:00
Goffi
2fce8ba7d6 frontends (tools/webrtc): Better error handling and logging 2025-10-29 13:20:45 +01:00
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +02:00
Goffi
0a8bb228d5 frontends (tools/aio): Fix excessive use of CPU:
Use a short delay instead of `loop.call_soonloop.call_soon` when work as been done, as
this was resulting in an excessive use of CPU.
2024-09-06 17:38:31 +02:00
Goffi
a3651eb70a frontends (tools/webrtc): fix typo resulting in bad pipeline for audio. 2024-07-05 16:27:52 +02:00
Goffi
53fdaa9d09 Reformatted code base using black. 2024-06-19 18:44:57 +02:00
Goffi
b259137603 frontends: remote control implementation:
This is the frontends common part of remote control implementation. It handle the creation
of WebRTC session, and management of inputs. For now the reception use freedesktop.org
Desktop portal, and works mostly with Wayland based Desktop Environments.

rel 436
2024-05-11 13:52:43 +02:00
Goffi
de7260bfb9 backend, frontend: prepare remote control:
This is a series of changes necessary to prepare the implementation of remote control
feature:

- XEP-0166: add a `priority` attribute to `ApplicationData`: this is needed when several
  applications are working in a same session, to know which one must be handled first.
  Will be used to make Remote Control have precedence over Call content.
- XEP-0166: `_call_plugins` is now async and is not used with `DeferredList` anymore: the
  benefit to have methods called in parallels is very low, and it cause a lot of trouble
  as we can't predict order. Methods are now called sequentially so workflow can be
  predicted.
- XEP-0167: fix `senders` XMPP attribute <=> SDP mapping
- XEP-0234: preflight acceptance key is now `pre-accepted` instead of `file-accepted`, so
  the same key can be used with other jingle applications.
- XEP-0167, XEP-0343: move some method to XEP-0167
- XEP-0353: use new `priority` feature to call preflight methods of applications according
  to it.
- frontend (webrtc): refactor the sources/sink handling with a more flexible mechanism
  based on Pydantic models. It is now possible to have has many Data Channel as necessary,
  to have them in addition to A/V streams, to specify manually GStreamer sources and
  sinks, etc.
- frontend (webrtc): rework of the pipeline to reduce latency.
- frontend: new `portal_desktop` method. Screenshare portal handling has been moved there,
  and RemoteDesktop portal has been added.
- frontend (webrtc): fix `extract_ufrag_pwd` method.

rel 436
2024-05-11 13:52:41 +02:00
Goffi
728b01d236 cli (call, file), frontends: implement webRTC data channel transfer:
- file send/receive commands now supports webRTC transfer. In `send` command, the
  `--webrtc` flags is currenty used to activate it.

- WebRTC related code have been factorized and moved to `libervia.frontends.tools.webrtc*`
  modules.

rel 442
2024-04-06 13:43:09 +02:00
Goffi
ec3e037a1a frontends (tools/webrtc): add a options to merge video for PiP and to specify size:
- the `merge_pip` option is now used to indicate if local feedback and remote video
  streams must be merged with local feedback being a PiP of remote video. By default, it's
  done for `SINKS_AUTO`, but it can be manually specified to use it with `SINKS_APP` or to
  split ``SINKS_AUTO`` in 2 windows.
- target size of the compositor used with `merge_pip` can be specified. By default, 720p
  is used.

rel 428
2024-02-16 18:46:02 +01:00
Goffi
04ed0e2bd6 frontends (tools/webrtc): implement screensharing for Wayland + bug fixes:
- Freedesktop Desktop Screenshare port is now used when Wayland is detected (needs
  `xdg-desktop-portal` with the implementation corresponding to desktop environment).
- Add a binding feature to feedback state to application (e.g. if desktop sharing is
  cancelled from desktop environment, or at portal's permission request level).
- fix misnaming of video source (was wrongly named `camera` instead of `video`).
- fix desktop sharing pad selection in `input-selector` when it has been added once, then
  removed, then added again.

rel 434
2024-01-18 23:29:25 +01:00
Goffi
27ae8655d7 frontends (tools/webrtc): implement X11 desktop sharing:
rel 433
2024-01-16 10:42:00 +01:00
Goffi
3fecc07a7e frontends (tools): module to handle display servers:
rel 433
2024-01-16 10:41:58 +01:00
Goffi
6b26dcedfa frontends (tools/webrtc): fix SINKS_APP condition check. 2023-11-03 15:32:17 +01:00
Goffi
221c73b947 frontends (tools/webrtc): Better message on Python override missing:
raise an exception instead of simple `print` to stop loading the module, and show a more
detailed message with the package to install.
2023-11-02 12:11:21 +01:00
Goffi
547375c079 frontends (tools): webrtc implementation:
this is a factored implementation usable by all non-web frontends. Sources and Sinks can
be configured easily to use tests source or local webcam/microphone, autosinks or a
`appsink` that the frontend will use.

rel 426
2023-11-01 14:03:36 +01:00
Goffi
1ce499a6d2 frontends (tools/aio): add tool to run from thread, run maybe async method, or run GLib loop:
- `run_from_thread` can be used to run a method from a thread.
- `maybe_async` can be used to run a method if we are not sure if it's async or not.
- `install_glib_asyncio_iteration` run the GLib loop from asyncio one's.

rel 426
2023-11-01 14:00:48 +01:00
Goffi
04a0e449c5 frontends (tools) new aio module for tools regarding asyncio:
A first method lets run an async method from blocking code.

rel 424
2023-10-03 16:27:51 +02:00
Goffi
4ab9bd7bc8 refactoring: rename sat_frontends to libervia.frontends 2023-06-02 14:12:38 +02:00