gstreamer/subprojects/gst-plugins-good/ext/soup
Daniel Kolesa 0bcefa7350 soup: move libsoup session into its own thread
Starting with libsoup3, there is no attempt to handle thread safety
inside the library, and it was never considered fully safe before
either. Therefore, move all session handling into its own thread.

The libsoup thread has its own context and main loop. When some
request is made or a response needs to be read, an idle source
is created to issue that; the gstreamer thread issuing that waits
for that to be complete. There is a per-src condition variable to
deal with that.

Since the thread/loop needs to be longer-lived than the soup
session itself, a wrapper object is provided to contain them. The
soup session only has a single reference, owned by the wrapper
object.

It is no longer possible to force an external session, since this
does not seem to be used anywhere within gstreamer and would be
tricky to implement; this is because one would not have to provide
just a session, but also the complete thread arrangement made in
the same way as the system currently does internally, in order to
be safe.

Messages are still built gstreamer-side. It is safe to do so until
the message is sent on the session. Headers are also processed on
the gstreamer side, which should likewise be safe.

All requests as well as reads on the libsoup thread are issued
asynchronously. That allows libsoup to schedule things with as
little blocking as possible, and means that concurrent access
to the session is possible, when sharing the session.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/947

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1555>
2022-01-28 08:49:09 +00:00
..
stub soup-stub: Gate G_URI_FLAGS_SCHEME_NORMALIZE behind glib version check 2021-10-13 19:24:02 +00:00
gstsoup.c soup: Reintroduce compile-time libsoup dependency for static builds 2022-01-21 07:23:33 +00:00
gstsoupelement.c soup: Initialize debug category before use 2022-01-21 07:23:33 +00:00
gstsoupelements.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstsouphttpclientsink.c soup: Runtime compatibility support for libsoup2 and libsoup3 2021-10-13 08:32:25 +00:00
gstsouphttpclientsink.h soup: Runtime compatibility support for libsoup2 and libsoup3 2021-10-13 08:32:25 +00:00
gstsouphttpsrc.c soup: move libsoup session into its own thread 2022-01-28 08:49:09 +00:00
gstsouphttpsrc.h soup: move libsoup session into its own thread 2022-01-28 08:49:09 +00:00
gstsouploader.c soup: move libsoup session into its own thread 2022-01-28 08:49:09 +00:00
gstsouploader.h soup: move libsoup session into its own thread 2022-01-28 08:49:09 +00:00
gstsouputils.c soup: Runtime compatibility support for libsoup2 and libsoup3 2021-10-13 08:32:25 +00:00
gstsouputils.h soup: Reintroduce compile-time libsoup dependency for static builds 2022-01-21 07:23:33 +00:00
meson.build soup: Reintroduce compile-time libsoup dependency for static builds 2022-01-21 07:23:33 +00:00