[gnome-remote-desktop] vnc-pipewire-stream: Fix some style issues
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] vnc-pipewire-stream: Fix some style issues
- Date: Fri, 19 Aug 2022 13:55:55 +0000 (UTC)
commit 6bbdb0c0466967afec1d6bd230951a8902827c67
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Wed Aug 10 07:15:03 2022 +0200
vnc-pipewire-stream: Fix some style issues
The public grd_vnc_pipewire_stream_resize() function definition should
be in the upper part of the file, not at the bottom.
Also align the declaration in the header file to make it consistent
with the existing definitions and make the "PipeWire" string consistent
across all backends.
src/grd-vnc-pipewire-stream.c | 52 +++++++++++++++++++++----------------------
src/grd-vnc-pipewire-stream.h | 5 ++---
2 files changed, 28 insertions(+), 29 deletions(-)
---
diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
index 9295849d..08493a98 100644
--- a/src/grd-vnc-pipewire-stream.c
+++ b/src/grd-vnc-pipewire-stream.c
@@ -97,6 +97,30 @@ static void grd_vnc_frame_unref (GrdVncFrame *frame);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GrdVncFrame, grd_vnc_frame_unref)
+void
+grd_vnc_pipewire_stream_resize (GrdVncPipeWireStream *stream,
+ GrdVncVirtualMonitor *virtual_monitor)
+{
+ struct spa_rectangle virtual_monitor_rect;
+ uint8_t params_buffer[1024];
+ struct spa_pod_builder pod_builder;
+ const struct spa_pod *params[1];
+
+ virtual_monitor_rect = SPA_RECTANGLE (virtual_monitor->width,
+ virtual_monitor->height);
+
+ pod_builder = SPA_POD_BUILDER_INIT (params_buffer, sizeof (params_buffer));
+
+ params[0] = spa_pod_builder_add_object (
+ &pod_builder,
+ SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
+ SPA_FORMAT_VIDEO_size, SPA_POD_Rectangle (&virtual_monitor_rect),
+ 0);
+
+ pw_stream_update_params (stream->pipewire_stream,
+ params, G_N_ELEMENTS (params));
+}
+
static void
on_stream_state_changed (void *user_data,
enum pw_stream_state old,
@@ -818,7 +842,7 @@ grd_vnc_pipewire_stream_new (GrdSessionVnc *session_vnc,
if (!stream->pipewire_context)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Failed to create pipewire context");
+ "Failed to create PipeWire context");
return NULL;
}
@@ -826,7 +850,7 @@ grd_vnc_pipewire_stream_new (GrdSessionVnc *session_vnc,
if (!stream->pipewire_core)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Failed to connect pipewire context");
+ "Failed to connect PipeWire context");
return NULL;
}
@@ -943,27 +967,3 @@ grd_vnc_pipewire_stream_class_init (GrdVncPipeWireStreamClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
}
-
-void
-grd_vnc_pipewire_stream_resize (GrdVncPipeWireStream *stream,
- GrdVncVirtualMonitor *virtual_monitor)
-{
- struct spa_rectangle virtual_monitor_rect;
- uint8_t params_buffer[1024];
- struct spa_pod_builder pod_builder;
- const struct spa_pod *params[1];
-
- virtual_monitor_rect = SPA_RECTANGLE (virtual_monitor->width,
- virtual_monitor->height);
-
- pod_builder = SPA_POD_BUILDER_INIT (params_buffer, sizeof (params_buffer));
-
- params[0] = spa_pod_builder_add_object (
- &pod_builder,
- SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
- SPA_FORMAT_VIDEO_size, SPA_POD_Rectangle (&virtual_monitor_rect),
- 0);
-
- pw_stream_update_params (stream->pipewire_stream,
- params, G_N_ELEMENTS (params));
-}
diff --git a/src/grd-vnc-pipewire-stream.h b/src/grd-vnc-pipewire-stream.h
index 0fed1bdd..9faaebd9 100644
--- a/src/grd-vnc-pipewire-stream.h
+++ b/src/grd-vnc-pipewire-stream.h
@@ -37,8 +37,7 @@ GrdVncPipeWireStream * grd_vnc_pipewire_stream_new (GrdSessionVnc *
const GrdVncVirtualMonitor *virtual_monitor,
GError **error);
-void
-grd_vnc_pipewire_stream_resize (GrdVncPipeWireStream *stream,
- GrdVncVirtualMonitor *virtual_monitor);
+void grd_vnc_pipewire_stream_resize (GrdVncPipeWireStream *stream,
+ GrdVncVirtualMonitor *virtual_monitor);
#endif /* GRD_VNC_PIPEWIRE_STREAM_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]