Commit dcca72ce authored by Benjamin Berg's avatar Benjamin Berg
Browse files

Run uncrustify to reindent code.

parent 4df762ac
......@@ -42,7 +42,7 @@ struct _GnomeScreencastWindow
ScreencastPortal *portal;
#endif
GCancellable *cancellable;
GCancellable *cancellable;
ScreencastSink *stream_sink;
......@@ -64,8 +64,8 @@ struct _GnomeScreencastWindow
G_DEFINE_TYPE (GnomeScreencastWindow, gnome_screencast_window, GTK_TYPE_APPLICATION_WINDOW)
static GstElement*
sink_create_source_cb (GnomeScreencastWindow *self, ScreencastSink *sink)
static GstElement *
sink_create_source_cb (GnomeScreencastWindow * self, ScreencastSink * sink)
{
GstBin *bin;
GstElement *src, *dst, *res;
......@@ -81,7 +81,7 @@ sink_create_source_cb (GnomeScreencastWindow *self, ScreencastSink *sink)
dst = gst_element_factory_make ("intervideosink", "inter video sink");
g_object_set (dst,
"channel", "screencast-inter-video",
"max-lateness", (gint64) -1,
"max-lateness", (gint64) - 1,
NULL);
gst_bin_add (bin, dst);
......@@ -189,9 +189,7 @@ find_sink_list_row_activated_cb (GnomeScreencastWindow *self, ScreencastSinkRow
self->stream_sink = screencast_sink_start_stream (sink);
if (!self->stream_sink)
{
g_warning ("ScreencastWindow: Could not start streaming!");
}
g_warning ("ScreencastWindow: Could not start streaming!");
g_signal_connect_object (self->stream_sink,
"create-source",
......@@ -246,11 +244,12 @@ gnome_screencast_window_class_init (GnomeScreencastWindowClass *klass)
#if HAVE_SCREENCAST_PORTAL
static void
screencast_portal_init_async_cb (GObject *source_object,
screencast_portal_init_async_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
gpointer user_data)
{
GnomeScreencastWindow *window;
g_autoptr(GError) error = NULL;
if (!g_async_initable_init_finish (G_ASYNC_INITABLE (source_object), res, &error))
......
......@@ -22,9 +22,9 @@
struct _ScreencastDummyProvider
{
GObject parent_instance;
GObject parent_instance;
GPtrArray *sinks;
GPtrArray *sinks;
};
static void screencast_dummy_provider_provider_iface_init (ScreencastProviderIface *iface);
......
......@@ -4,10 +4,10 @@
G_BEGIN_DECLS
#define SCREENCAST_TYPE_DUMMY_PROVIDER (screencast_dummy_provider_get_type())
#define SCREENCAST_TYPE_DUMMY_PROVIDER (screencast_dummy_provider_get_type ())
G_DECLARE_FINAL_TYPE (ScreencastDummyProvider, screencast_dummy_provider, SCREENCAST, DUMMY_PROVIDER, GObject)
ScreencastDummyProvider *screencast_dummy_provider_new (void);
ScreencastDummyProvider * screencast_dummy_provider_new (void);
G_END_DECLS
......@@ -56,9 +56,9 @@ G_DEFINE_TYPE_EXTENDED (ScreencastDummyWFDSink, screencast_dummy_wfd_sink, G_TYP
static void
screencast_dummy_wfd_sink_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ScreencastDummyWFDSink *sink = SCREENCAST_DUMMY_WFD_SINK (object);
......@@ -171,7 +171,7 @@ client_connected_cb (ScreencastDummyWFDSink *sink, WfdClient *client, WfdServer
G_CONNECT_SWAPPED);
}
static GstElement*
static GstElement *
server_create_source_cb (ScreencastDummyWFDSink *sink, WfdServer *server)
{
GstElement *res;
......
......@@ -4,10 +4,10 @@
G_BEGIN_DECLS
#define SCREENCAST_TYPE_DUMMY_WFD_SINK (screencast_dummy_wfd_sink_get_type())
#define SCREENCAST_TYPE_DUMMY_WFD_SINK (screencast_dummy_wfd_sink_get_type ())
G_DECLARE_FINAL_TYPE (ScreencastDummyWFDSink, screencast_dummy_wfd_sink, SCREENCAST, DUMMY_WFD_SINK, GObject)
ScreencastDummyWFDSink *screencast_dummy_wfd_sink_new (void);
ScreencastDummyWFDSink * screencast_dummy_wfd_sink_new (void);
G_END_DECLS
......@@ -494,16 +494,16 @@ screencast_portal_get_source (ScreencastPortal *self)
/* The sync call here is not nice, but not a big deal either */
res = g_dbus_proxy_call_with_unix_fd_list_sync (self->screencast,
"OpenPipeWireRemote",
g_variant_builder_end (&builder),
G_DBUS_CALL_FLAGS_NONE,
500,
"OpenPipeWireRemote",
g_variant_builder_end (&builder),
G_DBUS_CALL_FLAGS_NONE,
500,
NULL,
&out_fd_list,
NULL,
&error);
if (!res || !out_fd_list || g_unix_fd_list_get_length(out_fd_list) != 1)
if (!res || !out_fd_list || g_unix_fd_list_get_length (out_fd_list) != 1)
{
g_warning ("Error opening pipewire remote: %s", error->message);
return NULL;
......
......@@ -296,7 +296,7 @@ client_connected_cb (ScreencastWFDP2PSink *sink, WfdClient *client, WfdServer *s
G_CONNECT_SWAPPED);
}
static GstElement*
static GstElement *
server_create_source_cb (ScreencastWFDP2PSink *sink, WfdServer *server)
{
GstElement *res;
......@@ -313,6 +313,7 @@ p2p_connected (GObject *source_object,
{
ScreencastWFDP2PSink *sink = NULL;
NMActiveConnection *ac = NULL;
g_autoptr(GError) error = NULL;
g_debug ("ScreencastWfdP2PSink: Got P2P connection");
......@@ -370,6 +371,7 @@ screencast_wfd_p2p_sink_sink_start_stream (ScreencastSink *sink)
{
ScreencastWFDP2PSink *self = SCREENCAST_WFD_P2P_SINK (sink);
GVariant *options = NULL;
g_autoptr(GVariantBuilder) builder = NULL;
g_return_val_if_fail (self->state == SCREENCAST_SINK_STATE_DISCONNECTED, NULL);
......
......@@ -198,6 +198,7 @@ wfd_client_configure_client_media (GstRTSPClient * client,
GstRTSPContext * ctx)
{
WfdClient *self = WFD_CLIENT (client);
g_autoptr(GstRTSPThreadPool) thread_pool = NULL;
g_autoptr(GstRTSPThread) thread = NULL;
g_autoptr(GstElement) element = NULL;
......@@ -435,7 +436,9 @@ wfd_client_pre_options_request (GstRTSPClient *client, GstRTSPContext *ctx)
self->init_state = INIT_STATE_DONE;
}
else
g_idle_add (wfd_client_idle_wfd_query_params, g_object_ref (client));
{
g_idle_add (wfd_client_idle_wfd_query_params, g_object_ref (client));
}
}
return GST_RTSP_STS_OK;
......
......@@ -24,8 +24,7 @@ enum {
static GParamSpec *properties[N_PROPS];
enum
{
enum {
SIGNAL_CREATE_SOURCE,
NR_SIGNALS
};
......@@ -145,7 +144,7 @@ wfd_media_factory_create_element (GstRTSPMediaFactory *factory, const GstRTSPUrl
parse = gst_element_factory_make ("h264parse", "wfd-h264parse");
success &= gst_bin_add (bin, parse);
g_object_set (parse,
"config-interval", (gint) -1,
"config-interval", (gint) - 1,
NULL);
caps = gst_caps_from_string ("video/x-h264,alignment=nal,stream-format=byte-stream");
......@@ -217,64 +216,70 @@ wfd_media_factory_create_element (GstRTSPMediaFactory *factory, const GstRTSPUrl
static gboolean
pipeline_bus_watch_cb (GstBus *bus,
GstMessage *message,
gpointer data)
GstMessage *message,
gpointer data)
{
switch (GST_MESSAGE_TYPE (message)) {
switch (GST_MESSAGE_TYPE (message))
{
case GST_MESSAGE_ERROR: {
GError *err;
gchar *debug;
GError *err;
gchar *debug;
gst_message_parse_error (message, &err, &debug);
g_print ("Error from %s: %s\n", GST_MESSAGE_SRC_NAME (message), err->message);
g_error_free (err);
g_free (debug);
gst_message_parse_error (message, &err, &debug);
g_print ("Error from %s: %s\n", GST_MESSAGE_SRC_NAME (message), err->message);
g_error_free (err);
g_free (debug);
break;
}
break;
}
case GST_MESSAGE_WARNING: {
GError *err;
gchar *debug;
GError *err;
gchar *debug;
gst_message_parse_warning (message, &err, &debug);
g_print ("Warning from %s: %s\n", GST_MESSAGE_SRC_NAME (message), err->message);
g_error_free (err);
g_free (debug);
gst_message_parse_warning (message, &err, &debug);
g_print ("Warning from %s: %s\n", GST_MESSAGE_SRC_NAME (message), err->message);
g_error_free (err);
g_free (debug);
break;
}
break;
}
case GST_MESSAGE_QOS: {
gboolean live;
guint64 running_time, stream_time, timestamp, duration;
guint64 processed, dropped;
gint64 jitter;
gdouble proportion;
gint quality;
gst_message_parse_qos (message, &live, &running_time, &stream_time, &timestamp, &duration);
gst_message_parse_qos_stats (message, NULL, &processed, &dropped);
gst_message_parse_qos_values (message, &jitter, &proportion, &quality);
g_debug ("QOS: proportion: %.3f, processed: %" G_GUINT64_FORMAT ", dropped: %" G_GUINT64_FORMAT "",
proportion, processed, dropped);
break;
}
gboolean live;
guint64 running_time, stream_time, timestamp, duration;
guint64 processed, dropped;
gint64 jitter;
gdouble proportion;
gint quality;
gst_message_parse_qos (message, &live, &running_time, &stream_time, &timestamp, &duration);
gst_message_parse_qos_stats (message, NULL, &processed, &dropped);
gst_message_parse_qos_values (message, &jitter, &proportion, &quality);
g_debug ("QOS: proportion: %.3f, processed: %" G_GUINT64_FORMAT ", dropped: %" G_GUINT64_FORMAT "",
proportion, processed, dropped);
break;
}
case GST_MESSAGE_EOS:
/* end-of-stream */
g_debug ("reached EOS");
break;
default:
/* unhandled message */
break;
}
}
return TRUE;
}
static GstElement*
static GstElement *
wfd_media_factory_create_pipeline (GstRTSPMediaFactory *factory, GstRTSPMedia *media)
{
GstElement *pipeline;
g_autoptr(GstBus) bus = NULL;
pipeline = GST_RTSP_MEDIA_FACTORY_CLASS (wfd_media_factory_parent_class)->create_pipeline (factory, media);
......@@ -448,6 +453,7 @@ static void
wfd_media_factory_init (WfdMediaFactory *self)
{
GstRTSPMediaFactory *media_factory = GST_RTSP_MEDIA_FACTORY (self);
g_autoptr(GstElementFactory) x264enc_factory = NULL;
/* Default to openh264 and assume it is usable, prefer x264enc when available. */
......
......@@ -41,6 +41,7 @@ wfd_params_new (void)
{
WfdParams *self;
WfdVideoCodec *basic_codec;
g_autoptr(GList) resolutions = NULL;
self = g_slice_new0 (WfdParams);
......
......@@ -18,8 +18,7 @@ enum {
static GParamSpec *properties[N_PROPS];
enum
{
enum {
SIGNAL_CREATE_SOURCE,
NR_SIGNALS
};
......@@ -170,6 +169,7 @@ static gboolean
clean_pool (gpointer user_data)
{
GstRTSPServer *server = GST_RTSP_SERVER (user_data);
g_autoptr(GstRTSPSessionPool) pool = NULL;
pool = gst_rtsp_server_get_session_pool (server);
......@@ -178,7 +178,7 @@ clean_pool (gpointer user_data)
return G_SOURCE_CONTINUE;
}
static GstElement*
static GstElement *
factory_source_create_cb (WfdMediaFactory *factory, WfdServer *self)
{
GstElement *res;
......@@ -213,8 +213,8 @@ wfd_server_init (WfdServer *self)
static GstRTSPFilterResult
pool_filter_remove_cb (GstRTSPSessionPool *pool,
GstRTSPSession *session,
gpointer user_data)
GstRTSPSession *session,
gpointer user_data)
{
return GST_RTSP_FILTER_REMOVE;
}
......@@ -222,7 +222,7 @@ pool_filter_remove_cb (GstRTSPSessionPool *pool,
static GstRTSPFilterResult
client_filter_remove_cb (GstRTSPServer *server,
GstRTSPClient *client,
gpointer user_data)
gpointer user_data)
{
return GST_RTSP_FILTER_REMOVE;
}
......@@ -231,6 +231,7 @@ void
wfd_server_purge (WfdServer *self)
{
GstRTSPServer *server = GST_RTSP_SERVER (self);
g_autoptr(GstRTSPSessionPool) session_pool = NULL;
g_autoptr(GstRTSPThreadPool) thread_pool = NULL;
......@@ -242,4 +243,3 @@ wfd_server_purge (WfdServer *self)
thread_pool = gst_rtsp_server_get_thread_pool (server);
gst_rtsp_session_pool_filter (session_pool, pool_filter_remove_cb, NULL);
}
......@@ -358,6 +358,7 @@ GList *
wfd_video_codec_get_resolutions (WfdVideoCodec *self)
{
WfdResolution *resolution;
g_autoptr(GList) res = NULL;
guint32 bits, i;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment