summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-10-02 21:28:51 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-11-05 10:41:32 +0200
commita30af04e6f81514149ef589ecfe71ec80c34e10a (patch)
tree79c4856c8ffcfe343ec1725bb376c93a50787928 /src
parent06e9aa93360beb8a25f2cef78576d1bf0c211a98 (diff)
main: Add support loading waltham transmitter plug-in
This is the same as the remoting plug-in, given that we'll be using the remoting plug-in to create the remoting output. The difference would be that instead of the 'remoting-output' section we'll use 'transmitter-output', with all other section specific being the same. For instance, using agl-shell-app-id we can instruct the application to be assigned to that 'transmitter-output'. Bug-AGL: SPEC-3611 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic16b6b9672802f4f83be121385c0798b9dbe08e9
Diffstat (limited to 'src')
-rw-r--r--src/ivi-compositor.h1
-rw-r--r--src/main.c37
2 files changed, 38 insertions, 0 deletions
diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h
index 0c9d604..50e516b 100644
--- a/src/ivi-compositor.h
+++ b/src/ivi-compositor.h
@@ -70,6 +70,7 @@ struct ivi_compositor {
const struct weston_windowed_output_api *window_api;
const struct weston_drm_output_api *drm_api;
const struct weston_remoting_api *remoting_api;
+ const struct weston_transmitter_api *waltham_transmitter_api;
struct wl_global *agl_shell;
struct wl_global *agl_shell_desktop;
diff --git a/src/main.c b/src/main.c
index 8492f54..6580abc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -57,6 +57,10 @@
#include "remote.h"
#endif
+#ifdef HAVE_WALTHAM
+#include <waltham-transmitter/transmitter_api.h>
+#endif
+
static int cached_tm_mday = -1;
static struct weston_log_scope *log_scope;
@@ -563,6 +567,38 @@ heads_changed(struct wl_listener *listener, void *arg)
}
}
+#ifdef HAVE_WALTHAM
+static int
+load_waltham_plugin(struct ivi_compositor *ivi, struct weston_config *config)
+{
+ struct weston_compositor *compositor = ivi->compositor;
+ int (*module_init)(struct weston_compositor *wc);
+
+ module_init = weston_load_module("waltham-transmitter.so",
+ "wet_module_init");
+ if (!module_init)
+ return -1;
+
+ if (module_init(compositor) < 0)
+ return -1;
+
+ ivi->waltham_transmitter_api = weston_get_transmitter_api(compositor);
+ if (!ivi->waltham_transmitter_api) {
+ weston_log("Failed to load waltham-transmitter plugin.\n");
+ return -1;
+ }
+
+ weston_log("waltham-transmitter plug-in loaded\n");
+ return 0;
+}
+#else
+static int
+load_waltham_plugin(struct ivi_compositor *ivi, struct weston_config *config)
+{
+ return -1;
+}
+#endif
+
#ifdef HAVE_REMOTING
static int
drm_backend_remoted_output_configure(struct weston_output *output,
@@ -809,6 +845,7 @@ load_drm_backend(struct ivi_compositor *ivi, int *argc, char *argv[])
}
load_remoting_plugin(ivi, ivi->config);
+ load_waltham_plugin(ivi, ivi->config);
error:
free(config.gbm_format);