From 493d4b22ed82a7a265f0f88a568df9518b7ad50e Mon Sep 17 00:00:00 2001 From: Alexander Irion Date: Tue, 11 Aug 2020 12:53:21 +0200 Subject: Fix crash in controller_screenshot_notify With the following change in weston-8 the wl_signal_emit's data parameter has been changed from output to output_damge: https://github.com/wayland-project/weston/commit/0bb94476532ebbe95e255a9a736ee0c48866db53 has changed wl_signal_emit(&output->frame_signal, output); => wl_signal_emit(&output->frame_signal, output_damage); The function controller_screenshot_notify in ivi-controller.c interprets the data parameter as output, which causes winston to crash. With this chage, the output is now stored in the screenshot_frame_listener struct and controller_screenshot_notify uses the stored value, instead of the signal's data parameter. --- weston-ivi-shell/src/ivi-controller.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c index cabd31b..629e673 100644 --- a/weston-ivi-shell/src/ivi-controller.c +++ b/weston-ivi-shell/src/ivi-controller.c @@ -86,6 +86,7 @@ struct screenshot_frame_listener { struct wl_listener frame_listener; struct wl_listener output_destroyed; struct wl_resource *screenshot; + struct weston_output *output; }; struct screen_id_info { @@ -1206,7 +1207,7 @@ controller_screenshot_notify(struct wl_listener *listener, void *data) struct screenshot_frame_listener *l = wl_container_of(listener, l, frame_listener); - struct weston_output *output = data; + struct weston_output *output = l->output; int32_t width = 0; int32_t height = 0; int32_t stride = 0; @@ -1336,6 +1337,8 @@ controller_screen_screenshot(struct wl_client *client, return; } + l->output = iviscrn->output; + wl_resource_set_implementation(l->screenshot, NULL, l, screenshot_frame_listener_destroy); l->output_destroyed.notify = screenshot_output_destroyed; -- cgit v1.2.1 From 9fce7e7eaa11123c81ffecde874a113b13ab7315 Mon Sep 17 00:00:00 2001 From: Alexander Irion Date: Tue, 11 Aug 2020 12:45:40 +0200 Subject: Add missing include of endian.h htole32, htole16 needs endian.h to be included. --- ivi-layermanagement-api/ilmControl/src/bitmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ivi-layermanagement-api/ilmControl/src/bitmap.c b/ivi-layermanagement-api/ilmControl/src/bitmap.c index 79d2a5d..2bbe758 100644 --- a/ivi-layermanagement-api/ilmControl/src/bitmap.c +++ b/ivi-layermanagement-api/ilmControl/src/bitmap.c @@ -26,6 +26,7 @@ #include #include #include "ivi-wm-client-protocol.h" +#include struct __attribute__ ((__packed__)) BITMAPFILEHEADER { char bfType[2]; -- cgit v1.2.1 From 62a386d3fc2bf46b14d6d412642638b4d7be8583 Mon Sep 17 00:00:00 2001 From: Alexander Irion Date: Tue, 11 Aug 2020 12:36:00 +0200 Subject: Remove unused function importSceneFromTXTHelper --- .../LayerManagerControl/src/sceneio.cpp | 48 ---------------------- 1 file changed, 48 deletions(-) diff --git a/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp b/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp index 6b11c3d..83fb1f5 100644 --- a/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp +++ b/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp @@ -188,54 +188,6 @@ string decodeEscapesequences(string s) return replaceAll(s, code); } -void importSceneFromTXTHelper(istream& stream, StringMapTree* node) -{ - string in; - //Type - getline(stream, in); - int typeSize = in.find(":") - in.find_first_not_of('\t'); - int typeStart = in.find_first_not_of('\t'); - node->mNodeLabel = in.substr(typeStart, typeSize); - while (true) - { - long streamPosition = stream.tellg(); - getline(stream, in); - in = rtrim(in); - - //end of object - if (in.substr(0, 1) == "}") - return; - - //start of object property - if (in.substr(0, 1) == "[") - { - int startIndex = in.find('[') + 1; - int endIndex = in.find(":"); - string propertyName = in.substr(startIndex, endIndex - startIndex); - propertyName = decodeEscapesequences(propertyName); - - startIndex = endIndex + 1; - endIndex = in.find("]"); - string propertyType = in.substr(startIndex, endIndex - startIndex); - propertyType = decodeEscapesequences(propertyType); - - startIndex = in.find('[', endIndex) + 1; - endIndex = in.find_last_of(']'); - string propertyValue = in.substr(startIndex, endIndex - startIndex); - propertyValue = decodeEscapesequences(propertyValue); - - node->mNodeValues[propertyName] = make_pair(propertyType, propertyValue); - } - else - { - stream.seekg(streamPosition); - StringMapTree* child = new StringMapTree; - node->mChildren.push_back(child); - importSceneFromTXTHelper(stream, child); - } - } -} - string makeValidXMLCharacters(string s) { map code; -- cgit v1.2.1 From 7339a15b20debcc0a3e3e8ac1bc8241da003868b Mon Sep 17 00:00:00 2001 From: Alexander Irion Date: Tue, 11 Aug 2020 12:37:18 +0200 Subject: Remove unused function decodeEscapesequences --- .../LayerManagerControl/src/sceneio.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp b/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp index 83fb1f5..54ecbf1 100644 --- a/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp +++ b/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp @@ -175,19 +175,6 @@ void exportSceneToTXTHelper(ostream& stream, StringMapTree* tree, string prefix stream << prefix + "}"; } -string decodeEscapesequences(string s) -{ - map code; - code["\\[\\]"] = "\\"; - code["\\[n]"] = "\n"; - code["\\[t]"] = "\t"; - code["\\[v]"] = "\v"; - code["\\[b]"] = "\b"; - code["\\[f]"] = "\f"; - code["\\[r]"] = "\r"; - return replaceAll(s, code); -} - string makeValidXMLCharacters(string s) { map code; -- cgit v1.2.1 From 4c7d574af5cfba7a06c6d5575ee699ee8381fab8 Mon Sep 17 00:00:00 2001 From: "Tran Ba Khang(MS/EMC31-XC)" Date: Wed, 7 Dec 2022 16:30:17 +0700 Subject: CMakeLists: update libweston to version 8 Update the libweston-8 on ivi-id-agent cmake file. Update the libweston-8-protocols on simple-weston-client cmake file Signed-off-by: Tran Ba Khang(MS/EMC31-XC) --- ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt | 2 +- ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt index d5834f3..3a1d9c6 100644 --- a/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt +++ b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt @@ -25,7 +25,7 @@ find_package(PkgConfig REQUIRED) pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED) pkg_check_modules(WESTON weston>=6.0.0 REQUIRED) pkg_check_modules(PIXMAN pixman-1 REQUIRED) -pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-7 REQUIRED) +pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-8 REQUIRED) find_package(Threads REQUIRED) diff --git a/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt b/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt index 847c9a1..d3bb616 100644 --- a/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt +++ b/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt @@ -22,14 +22,14 @@ project (simple-weston-client) find_package(PkgConfig) pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED) pkg_check_modules(WAYLAND_CURSOR wayland-cursor REQUIRED) -pkg_check_modules(LIBWESTON_PROTOCOLS libweston-7-protocols QUIET) +pkg_check_modules(LIBWESTON_PROTOCOLS libweston-8-protocols QUIET) if(${LIBWESTON_PROTOCOLS_FOUND}) #check for DLT pkg_check_modules(DLT automotive-dlt QUIET) #import the pkgdatadir from libweston-protocols pkgconfig file - execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir libweston-7-protocols + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir libweston-8-protocols OUTPUT_VARIABLE WestonProtocols_PKGDATADIR) string(REGEX REPLACE "[\r\n]" "" WestonProtocols_PKGDATADIR "${WestonProtocols_PKGDATADIR}") SET(LIBWESTON_PROTOCOLS_PKGDATADIR ${WestonProtocols_PKGDATADIR}) -- cgit v1.2.1