examples: gtk: Add example to illustrate usage of accept-certificate with souphttpsrc
The aim of this example is to show how to make use of the accept-certificate
signal from a GTK GUI, and prompt user in case of invalid certificate.
There are two subtleties to be aware of:
1. the signal is emitted from the GStreamer streaming thread, therefore the
caller can't modify the GUI straight away, instead they must do it from the
main thread (eg. by using g_idle_add())
2. in case of a redirection, then a TLS failure, the caller won't know
about the redirection. Actually, it's possible to be notified of the
redirection by watching "message:element" and inspecting http-headers,
but even in that case, the signal will be received *after* the signal
"accept-certificate" (even though the redirection happened *before*).
This second point is tricky. It's not uncommon to have servers that redirect
http requests to https. So errors of the type "HTTP -> HTTPS -> TLS error"
happen, and if the caller doesn't care about redirection, they might prompt
users with a message such as "TLS error for URL http://...", which wouldn't make
much sense.
This example shows how to handle that right, by connecting to the signal
"message:element", inspecting the http-headers, and in case of redirection,
updating the TLS error dialog to indicate that the request was redirected.
Here are a few examples of streams that exhibit TLS failure (at the time of
this commit, of course):
* https://radiolive.sanjavier.es:8443/stream: unknown-ca
* https://am981.ddns.net:9005/stream.ogg: unknown-ca
* http://stream.diazol.hu:7092/zene.mp3: redir then bad-identity
* https://streaming.fabrik.fm/izwi/echocast/audio/index.m3u8: unknown-ca
(this one is a HLS stream)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4925>
2023-06-23 06:11:49 +00:00
|
|
|
executable('gtkhttpsrc', 'gtkhttpsrc.c',
|
|
|
|
dependencies: [gst_dep, gtk_dep, optional_deps],
|
|
|
|
c_args: gst_plugins_good_args,
|
|
|
|
include_directories: [configinc],
|
|
|
|
install: false)
|
|
|
|
|
2018-07-20 02:48:34 +00:00
|
|
|
executable('gtksink', 'gtksink.c',
|
|
|
|
dependencies: [gst_dep, gtk_dep, optional_deps],
|
|
|
|
c_args: gst_plugins_good_args,
|
|
|
|
include_directories: [configinc],
|
|
|
|
install: false)
|
|
|
|
|
2020-05-11 23:02:01 +00:00
|
|
|
if have_gstgl
|
2018-10-08 19:35:15 +00:00
|
|
|
executable('gtkglsink', 'gtkglsink.c',
|
|
|
|
dependencies: [gst_dep, gstgl_dep, gtk_dep, x11_dep],
|
|
|
|
c_args: gst_plugins_good_args,
|
|
|
|
include_directories: [configinc],
|
|
|
|
install: false)
|
2018-07-20 02:48:34 +00:00
|
|
|
|
2018-10-08 19:35:15 +00:00
|
|
|
executable('glliveshader', 'glliveshader.c',
|
2020-07-24 06:58:34 +00:00
|
|
|
dependencies: [gst_dep, gstgl_dep, gstglproto_dep, gtk_dep, x11_dep],
|
2018-10-08 19:35:15 +00:00
|
|
|
c_args: gst_plugins_good_args,
|
|
|
|
include_directories: [configinc],
|
|
|
|
install: false)
|
|
|
|
endif
|