diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-10-14 13:58:57 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-11-05 10:41:32 +0200 |
commit | 3f05a28017b2e04cff63c96225adf5a4fc322cc1 (patch) | |
tree | d94fa67040d47ec9bdaacc91ed22782c6cfcb3ce | |
parent | 36d2a12f8176ef1feb54405b777e81d6b15af35c (diff) |
main: Create a remoting output if the waltham plug-in has been loaded
The waltham-transmitter will no longer create an output on its own so
we'll re-use the remoting plug-in for streaming out the buffers to the
remoting side.
Bug-AGL: 3601
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I6f85c3dfc54e81e8fa05f518b77fae24334fafc1
-rw-r--r-- | src/main.c | 55 |
1 files changed, 55 insertions, 0 deletions
@@ -771,6 +771,58 @@ ivi_enable_remote_outputs(struct ivi_compositor *ivi) } } +static void +ivi_enable_waltham_outputs(struct ivi_compositor *ivi) +{ + struct weston_config_section *transmitter_section = NULL; + const char *sect_name; + struct weston_config *config = ivi->config; + + while (weston_config_next_section(config, &transmitter_section, §_name)) { + if (strcmp(sect_name, "transmitter-output")) + continue; + + struct ivi_output *ivi_output = NULL; + bool output_found = false; + char *_name = NULL; + + weston_config_section_get_string(transmitter_section, + "name", &_name, NULL); + wl_list_for_each(ivi_output, &ivi->outputs, link) { + if (!strcmp(ivi_output->name, _name)) { + output_found = true; + break; + } + } + + if (output_found) { + free(_name); + continue; + } + + ivi_output = zalloc(sizeof(*ivi_output)); + + ivi_output->ivi = ivi; + ivi_output->name = _name; + ivi_output->config = transmitter_section; + + if (remote_output_init(ivi_output, ivi->compositor, + transmitter_section, ivi->remoting_api)) { + free(ivi_output->name); + free(ivi_output); + continue; + } + + ivi_output->type = OUTPUT_WALTHAM; + ivi_output->output_destroy.notify = handle_output_destroy; + weston_output_add_destroy_listener(ivi_output->output, + &ivi_output->output_destroy); + + wl_list_insert(&ivi->outputs, &ivi_output->link); + ivi_output_configure_app_id(ivi_output); + } +} + static int load_remoting_plugin(struct ivi_compositor *ivi, struct weston_config *config) { @@ -1531,6 +1583,9 @@ int main(int argc, char *argv[]) if (ivi.remoting_api) ivi_enable_remote_outputs(&ivi); + if (ivi.waltham_transmitter_api) + ivi_enable_waltham_outputs(&ivi); + if (create_listening_socket(display, socket_name) < 0) goto error_compositor; |