From d44b2316fa2128e082dbe4b583919cceb8c3197f Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 22 Jun 2020 17:39:12 +0530 Subject: [PATCH] sendonly: Don't assume we're building on UNIX Fixes https://github.com/centricular/gstwebrtc-demos/issues/203 --- webrtc/sendonly/webrtc-recvonly-h264.c | 13 ++++++++----- webrtc/sendonly/webrtc-unidirectional-h264.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/webrtc/sendonly/webrtc-recvonly-h264.c b/webrtc/sendonly/webrtc-recvonly-h264.c index 9ba7fe4926..87b24f2f26 100644 --- a/webrtc/sendonly/webrtc-recvonly-h264.c +++ b/webrtc/sendonly/webrtc-recvonly-h264.c @@ -1,9 +1,12 @@ #include #include -#include #include #include +#ifdef G_OS_UNIX +#include +#endif + #define GST_USE_UNSTABLE_API #include @@ -50,8 +53,6 @@ void soup_websocket_handler (G_GNUC_UNUSED SoupServer * server, static gchar *get_string_from_json_object (JsonObject * object); -gboolean exit_sighandler (gpointer user_data); - @@ -649,7 +650,7 @@ get_string_from_json_object (JsonObject * object) return text; } - +#ifdef G_OS_UNIX gboolean exit_sighandler (gpointer user_data) { @@ -658,7 +659,7 @@ exit_sighandler (gpointer user_data) g_main_loop_quit (mainloop); return TRUE; } - +#endif int main (int argc, char *argv[]) @@ -677,8 +678,10 @@ main (int argc, char *argv[]) mainloop = g_main_loop_new (NULL, FALSE); g_assert (mainloop != NULL); +#ifdef G_OS_UNIX g_unix_signal_add (SIGINT, exit_sighandler, mainloop); g_unix_signal_add (SIGTERM, exit_sighandler, mainloop); +#endif soup_server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "webrtc-soup-server", NULL); diff --git a/webrtc/sendonly/webrtc-unidirectional-h264.c b/webrtc/sendonly/webrtc-unidirectional-h264.c index 4887c7eed2..b8060145fe 100644 --- a/webrtc/sendonly/webrtc-unidirectional-h264.c +++ b/webrtc/sendonly/webrtc-unidirectional-h264.c @@ -1,9 +1,12 @@ #include #include -#include #include #include +#ifdef G_OS_UNIX +#include +#endif + #define GST_USE_UNSTABLE_API #include @@ -42,8 +45,6 @@ void soup_websocket_handler (G_GNUC_UNUSED SoupServer * server, static gchar *get_string_from_json_object (JsonObject * object); -gboolean exit_sighandler (gpointer user_data); - struct _ReceiverEntry { SoupWebsocketConnection *connection; @@ -531,7 +532,7 @@ get_string_from_json_object (JsonObject * object) return text; } - +#ifdef G_OS_UNIX gboolean exit_sighandler (gpointer user_data) { @@ -540,7 +541,7 @@ exit_sighandler (gpointer user_data) g_main_loop_quit (mainloop); return TRUE; } - +#endif int main (int argc, char *argv[]) @@ -559,8 +560,10 @@ main (int argc, char *argv[]) mainloop = g_main_loop_new (NULL, FALSE); g_assert (mainloop != NULL); +#ifdef G_OS_UNIX g_unix_signal_add (SIGINT, exit_sighandler, mainloop); g_unix_signal_add (SIGTERM, exit_sighandler, mainloop); +#endif soup_server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "webrtc-soup-server", NULL);