1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-04 15:41:19 +00:00
Commit graph

268 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras
47d4164a09 sip: media-pipeline: Take srtp into account when determing pipeline state
If we're using srtp we should also consider the state of srtpenc and srtpdec
elements when determining the state of the whole pipeline.
2022-04-24 13:36:26 +02:00
Evangelos Ribeiro Tzaras
bfda8f6a3e sip: media-pipeline: Introduce SRTP elements
The rtpbin will request GstSrtpDec and GstSrtpEnc elements using the
"request-{rtp,rtcp}-{de,en}coder" family of signals.

The newly added boolean use_srtp controls whether the srtp elements are
returned in the signal handler and thus decides if SRTP is used or not.
2022-04-24 13:36:24 +02:00
Evangelos Ribeiro Tzaras
5d0ae4a6fa sip: media-pipeline: Debug pipeline graph on SIGUSR2
Ust GST_DEBUG_BIN_TO_DOT_FILE to generate a dot graph of a pipeline for
debugging purposes when SIGUSR2 is received.

Note the same signal is also used within the dummy plugin to simulate an
incoming call from an unknown number, so when testing you probably want either
the sip plugin or the dummy plugin, but not both.
2022-04-24 13:33:19 +02:00
Evangelos Ribeiro Tzaras
58f9f5cb62 sip: media: Allow specifying SRTP for GStreamer capabilities
When using SRTP the GstCaps must be set accordingly.
2022-04-24 13:31:40 +02:00
Evangelos Ribeiro Tzaras
7ac862155b Uncrustify sources
Ran `find src plugins -iname '*.[c|h]' -print0 | xargs -0 uncrustify --no-backup`
with some minimal manual intervention.
2022-04-24 12:59:42 +02:00
Evangelos Ribeiro Tzaras
605776641d sip: media-pipeline: Fix socket reuse
We were using two distinct pipelines, one for receiving and one for
sending. The receive pipeline was set to the playing state to allocate
the sockets which we would reuse for the sending direction for our NAT
traversal scheme.

The rework to a single pipeline broke reusing sockets subtly.

This happened because the state of the GstUDPSrc could be reset leading
to newly allocated sockets once the pipeline is set to play.

This is now fixed by locking the state of the GstUDPSrc in the ready
state during socket reuse setup and while the pipeline is paused.

Additionally get rid of the "close-socket" property on the udp sources
because it was never needed.

Fixes aa446f82

sq
2022-04-22 19:23:14 +02:00
Evangelos Ribeiro Tzaras
f44b4c7ef8 sip: origin: Debug print public IP as seen by the registrar 2022-04-22 19:23:14 +02:00
Evangelos Ribeiro Tzaras
db503e84cf sip: media-pipeline: Remove unused variables
This is a remnant from the refactor to unify the pipelines.
2022-04-22 19:23:14 +02:00
Evangelos Ribeiro Tzaras
aa446f8218 sip: pipeline: Unify send and receive pipeline
Using a single pipeline makes implementing encryption easier because we don't
need to duplicate srtpenc and srtpdec elements for each direction.

It also makes it easier to switch to using farstream down the line (see #426).
2022-04-12 08:03:49 +00:00
Evangelos Ribeiro Tzaras
1e9d817ef2 sip: media-pipeline: No need to undef locally declared macros
It cannot bleed into other files, so we don't have to bother cleaning it up.
2022-04-12 08:03:49 +00:00
Eugenio Paolantonio (g7)
f8825befd8 ofono: call: do not try to pass the "properties" property
The "properties" property doesn't exist anymore since
dbfa593a07.

Signed-off-by: Eugenio Paolantonio (g7) <me@medesimo.eu>
2022-04-12 07:40:14 +00:00
Evangelos Ribeiro Tzaras
be9471cc03 sip: media-pipeline: Use debug macros to allow graphing pipelines
If the environment variable GST_DEBUG_DUMP_DOT_DIR is set, a graph of the send
and receive pipelines will be written to disk.

To generate a png from the exported dot files graphviz can be used like this:

`dot -Tpng -oimage.png graph.dot`
2022-04-05 09:46:16 +00:00
Anders Jonsson
397870a75b plugins: Use American spelling 2022-03-29 13:37:54 +00:00
Andrey Skvortsov
86beb37e53 sip-account-widget: Add switch to display password 2022-03-27 11:33:37 +00:00
Evangelos Ribeiro Tzaras
0e3a07aabf sip: media-pipeline: Setup socket reuse for RTP and RTCP during initialization
Now that initialization is split per pipeline and that the OS handles port
allocation we can move setting up socket reuse into the pipeline initialization
step instead of setting it up when starting the media pipelines.

This makes the calls_sip_media_pipeline_start() method a bit simpler.

We're also now reusing sockets for RTCP.

Closes #315
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
a7fcb9c0c0 sip: origin: Try fetching RTCP port from SDP attributes
And fallback to the legacy behaviour of RTCP=RTP+1
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
849f298609 sip: media-pipeline: Remove lport-rtp and lport-rtcp property
We're not setting the desired ports from the outside anymore, but rather
querying the ports that have been allocated by the operating system.

Therefore the lport-rtp and lport-rtcp property have become superfluous and are
being removed. We also adapt to changes outside of the pipeline code.
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
aeebdfbf53 sip: call: Add pipeline as a construct only property
In the future when we will be able to switch pipelines this might change.
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
7033c1cd75 media manager: Manage and hand out available pipelines
The media manager will always try to have a pipeline ready.
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
c4aa8d45e8 sip: media-pipeline: Don't implement GInitable
We don't expect the initialization to be able to fail. The only thing that could
potentially fail is setting up codecs and this has been delayed until after
initialization.
2022-03-05 23:02:13 +01:00
Evangelos Ribeiro Tzaras
fe6951c938 sip: media-pipeline: Keep track of pipeline state
This can be used by the media manager to dispose of pipelines which are done.
2022-03-05 23:00:56 +01:00
Evangelos Ribeiro Tzaras
53d6082d64 sip: media-pipeline: Let the OS allocate sockets for udpsrc
First of we get rid of the bindings between from "lport-rtp" and "lport-rtcp" to
the "port" property of the udpsrc elements. The properties themselves will get
removed a little later as the required changes are rather intrusive and we need
some more infrastructure in place before we can do the switch.
2022-03-05 23:00:22 +01:00
Evangelos Ribeiro Tzaras
f3a6c15e6a sip: media-pipeline: Allow new pipeline without codec set 2022-03-05 23:00:22 +01:00
Evangelos Ribeiro Tzaras
29742a5f8d sip: media-pipeline: Check codec availability before setup 2022-03-05 23:00:22 +01:00
Evangelos Ribeiro Tzaras
02e271b04a sip: media-pipeline: Delay setting codec
After the refactoring this is as simple as delay setting the codec property.
2022-03-05 23:00:22 +01:00
Evangelos Ribeiro Tzaras
792e90516a sip: media-pipeline: Split initialization per GstPipeline
This is the first step in getting rid of the requirement to have the codec set
during object construction. The goal is to have pipelines prepared in advance so
that the codec can be plugged in once negotiation is complete.

Having the pipelines prepared in advance let's us grab allocated local ports of
udpsrc elements for RTP and RTCP instead of setting those and hoping they're not
yet in use.
2022-03-05 23:00:21 +01:00
Evangelos Ribeiro Tzaras
86e76380c2 sip: media-pipeline: Allow pausing pipeline
We want to pause a pipeline in the multi call scenario.
2022-03-05 19:59:08 +01:00
Evangelos Ribeiro Tzaras
16b86c29b2 origin: Add id property and adapt to changes
The id property will be used to keep track of which origin was used for a call,
so that we can default to reusing the same origin when placing a call from the
history.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
04605efac7 plugins: Implement call-type property 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
c2d2c33eae tests: build: Avoid linking against sip module
Fixes the deprecation warning from meson:

DEPRECATION: target sip links against shared module sip, which is incorrect.
             This will be an error in the future, so please use shared_library() for sip instead.
             If shared_module() was used for sip because it has references to undefined symbols,
             use shared_libary() with `override_options: ['b_lundef=false']` instead.
2022-03-02 09:16:12 +01:00
Evangelos Ribeiro Tzaras
30d6c71826 sip: media-manager: Remove unused code
It has outlived its usefulness since 7d113d4180
Also PCMA was never the "best" codec to begin with.
2022-03-01 18:24:04 +01:00
Evangelos Ribeiro Tzaras
92c8a69e17 sip: media-pipeline: Initialize GStreamer if it's not already initialized 2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
a78a2f3daf sip: media-manager: Initialize GStreamer if it's not already initialized 2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
a99755424f media-manager: Don't run deinitialize GStreamer in finalize()
This makes running tests harder as we cannot call gst_init() after gst_deinit()
has been called.

This is what the API reference has to say about it at
https://gstreamer.freedesktop.org/documentation/gstreamer/gst.html?gi-language=c#gst_deinit

It is normally not needed to call this function in a normal application as the
resources will automatically be freed when the program terminates. This function
is therefore mostly used by testsuites and other memory profiling tools.
2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
2d4c3f9b43 sip: call: Remove unnecessary G_OBJECT() cast
g_object_set() takes a gpointer as argument, so there is no need to cast the
argument using G_OBJECT()
2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
fee633e78b sip: media-pipeline: Prefix overriden GObjectClass methods
Purely cosmetical change to be in line with our style guide.
2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
bf428f0fa6 sip: media-pipeline: Remove comment about preexisting linked pads
Since we're not reusing pipelines we don't have to check for any existing linked
pads.
2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
ce00698e71 sip: build: Use simple variant of gnome.mkenums
We were using standard template files anyway.
2022-03-01 18:04:18 +01:00
Evangelos Ribeiro Tzaras
e185cac3cb sip: Debug print remote SDP and codec to be used
Fixes #415
2022-03-01 16:32:30 +01:00
Evangelos Ribeiro Tzaras
876f12df95 sip: media-manager: Don't include sofia-sip/nua.h in public header
It isn't needed in the implementation either. It was only useful because it
included system headers like sys/types.h and sys/socket.h which we should now
include directly.

This will make it easier to move the media manager into the core sources.
2022-03-01 16:31:44 +01:00
Evangelos Ribeiro Tzaras
19cf2ab92f sip: media-pipeline: Add G_BEGIN_DECLS and G_END_DECLS to header 2022-03-01 16:31:44 +01:00
Evangelos Ribeiro Tzaras
3ac8cc1580 dummy-provider: Add new anonymous incoming call on SIGUSR2 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
8c0d135298 media-pipeline: Put deprecated GStreamer function behind version check macro
gst_element_get_request_pad() is marked as deprecated in GStreamer 1.20.0 in
favour of gst_element_request_pad_simple()
2022-02-12 23:49:30 +00:00
Evangelos Ribeiro Tzaras
8f8da42f76 dummy-origin: Emit call-added only after adding to list
Otherwise we get incorrect values when calling calls_origin_get_calls ()
2022-02-03 12:36:58 +01:00
Evangelos Ribeiro Tzaras
69c530dda8 dummy: provider: Fake being a modem
This is useful to avoid the "No modem" warning in the UI and helps us avoiding
to special case the dummy provider/origins.
2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras
6aba8e119c dummy: origin: Restrict supported protocols to "tel" 2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras
a8de63f838 dummy: origin: Fix memory leaks 2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras
f6e6d08332 sip: origin: Fix memory leak 2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras
1b4af654f1 sip: origin: Fix comment style 2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras
7c5dcd37d7 sip: origin: Switch to state notify signal
We don't need the old state here, so let's use the "notify::state" signal
instead of the "state-changed" signal.
2022-01-20 10:23:09 +00:00