diff options
-rw-r--r-- | meson.build | 25 | ||||
-rw-r--r-- | src/ivi-compositor.h | 1 | ||||
-rw-r--r-- | src/main.c | 37 |
3 files changed, 62 insertions, 1 deletions
diff --git a/meson.build b/meson.build index ab4f086..34f8558 100644 --- a/meson.build +++ b/meson.build @@ -59,10 +59,28 @@ foreach depname : depnames if not dep.found() message('Remoting requires @0@ which was not found. '.format(depname)) endif -deps_remoting += dep + deps_remoting += dep endforeach +# the transmitter plug-in requires waltham but we don't have a cflags or libs +# for it so we add waltham depends here. Further more, the output is being +# handled by remoting plug-in +depnames_waltham = [ + 'waltham' +] + +deps_waltham = [] +foreach depname : depnames_waltham + dep = dependency(depname, required: false) + if not dep.found() + message('Waltham requires @0@ which was not found. '.format(depname)) + endif + deps_waltham += dep +endforeach + +deps_waltham += deps_remoting + agl_shell_xml = files('protocol/agl-shell.xml') agl_shell_desktop_xml = files('protocol/agl-shell-desktop.xml') agl_screenshooter = files('protocol/agl-screenshooter.xml') @@ -197,6 +215,11 @@ if deps_remoting.length() == depnames.length() message('Found remoting depends, enabling remoting') endif +if deps_waltham.length() == depnames_waltham.length() + depnames.length() + config_h.set('HAVE_WALTHAM', 1) + message('Found waltham depends, enabling waltham') +endif + if dep_libsmack.found() config_h.set('HAVE_SMACK', 1) deps_libweston += dep_libsmack 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; @@ -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); |