From 15ed03927dfebe35a267f2934964f94c0e4d5ec3 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Wed, 16 Nov 2022 09:54:50 +0900 Subject: [PATCH 1/6] Add external output support Add feature to support external output in common profile. The eom API only supports elm_win. So TizenWindowElementary supports this. Currently, only HDMI type is available. It can be extended according to the requirements of the Common profile. https://docs.tizen.org/application/native/guides/device/ext-output/ --- flutter/shell/platform/tizen/BUILD.gn | 3 + flutter/shell/platform/tizen/flutter_tizen.cc | 3 +- .../platform/tizen/public/flutter_tizen.h | 9 ++ .../platform/tizen/tizen_window_elementary.cc | 131 ++++++++++++++++-- .../platform/tizen/tizen_window_elementary.h | 18 ++- tools/generate_sysroot.py | 2 + 6 files changed, 154 insertions(+), 12 deletions(-) diff --git a/flutter/shell/platform/tizen/BUILD.gn b/flutter/shell/platform/tizen/BUILD.gn index 5b88b26..f85b283 100644 --- a/flutter/shell/platform/tizen/BUILD.gn +++ b/flutter/shell/platform/tizen/BUILD.gn @@ -38,6 +38,7 @@ config("flutter_tizen_config") { "${sysroot_path}/usr/include/elementary-1", "${sysroot_path}/usr/include/emile-1", "${sysroot_path}/usr/include/eo-1", + "${sysroot_path}/usr/include/eom", "${sysroot_path}/usr/include/ethumb-1", "${sysroot_path}/usr/include/ethumb-client-1", "${sysroot_path}/usr/include/evas-1", @@ -160,7 +161,9 @@ template("embedder") { libs += [ "tzsh_common", "tzsh_softkey", + "eom", ] + defines += [ "EOM_SUPPORT" ] } defines += invoker.defines diff --git a/flutter/shell/platform/tizen/flutter_tizen.cc b/flutter/shell/platform/tizen/flutter_tizen.cc index 6588925..9069b29 100644 --- a/flutter/shell/platform/tizen/flutter_tizen.cc +++ b/flutter/shell/platform/tizen/flutter_tizen.cc @@ -204,7 +204,8 @@ FlutterDesktopViewRef FlutterDesktopViewCreateFromNewWindow( if (window_properties.renderer_type == FlutterDesktopRendererType::kEvasGL) { window = std::make_unique( window_geometry, window_properties.transparent, - window_properties.focusable, window_properties.top_level); + window_properties.focusable, window_properties.top_level, + window_properties.external_output_type); } else { #ifndef WEARABLE_PROFILE window = std::make_unique( diff --git a/flutter/shell/platform/tizen/public/flutter_tizen.h b/flutter/shell/platform/tizen/public/flutter_tizen.h index c1132d6..6659cce 100644 --- a/flutter/shell/platform/tizen/public/flutter_tizen.h +++ b/flutter/shell/platform/tizen/public/flutter_tizen.h @@ -38,6 +38,13 @@ typedef enum { kMouseMove, } FlutterDesktopPointerEventType; +typedef enum { + // No use external output. + kNone, + // Display to the HDMI external output. + kHDMI, +} FlutterDesktopExternalOutputType; + // Properties for configuring the initial settings of a Flutter window. typedef struct { // The x-coordinate of the top left corner of the window. @@ -56,6 +63,8 @@ typedef struct { bool top_level; // The renderer type of the engine. FlutterDesktopRendererType renderer_type; + // The external output type of the window. + FlutterDesktopExternalOutputType external_output_type; } FlutterDesktopWindowProperties; // Properties for configuring the initial settings of a Flutter view. diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.cc b/flutter/shell/platform/tizen/tizen_window_elementary.cc index 77157bf..e574700 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.cc +++ b/flutter/shell/platform/tizen/tizen_window_elementary.cc @@ -5,6 +5,9 @@ #include "tizen_window_elementary.h" #include +#ifdef EOM_SUPPORT +#include +#endif #include #include "flutter/shell/platform/tizen/logger.h" @@ -34,11 +37,27 @@ uint32_t EvasModifierToEcoreEventModifiers(const Evas_Modifier* evas_modifier) { } // namespace -TizenWindowElementary::TizenWindowElementary(TizenGeometry geometry, - bool transparent, - bool focusable, - bool top_level) +TizenWindowElementary::TizenWindowElementary( + TizenGeometry geometry, + bool transparent, + bool focusable, + bool top_level, + FlutterDesktopExternalOutputType external_output_type) : TizenWindow(geometry, transparent, focusable, top_level) { +#ifdef EOM_SUPPORT + external_output_type_ = external_output_type; + + if (external_output_type_ != FlutterDesktopExternalOutputType::kNone && + !InitializeEom()) { + FT_LOG(Error) << "Failed to initialize eom."; + return; + } +#else + if (external_output_type != FlutterDesktopExternalOutputType::kNone) { + FT_LOG(Error) << "External output is not supported by this profile."; + } +#endif + if (!CreateWindow()) { FT_LOG(Error) << "Failed to create a platform window."; return; @@ -51,6 +70,11 @@ TizenWindowElementary::TizenWindowElementary(TizenGeometry geometry, } TizenWindowElementary::~TizenWindowElementary() { +#ifdef EOM_SUPPORT + if (external_output_type_ != FlutterDesktopExternalOutputType::kNone) { + DestroyEom(); + } +#endif UnregisterEventHandlers(); DestroyWindow(); } @@ -69,11 +93,28 @@ bool TizenWindowElementary::CreateWindow() { elm_win_aux_hint_add(elm_win_, "wm.policy.win.user.geometry", "1"); #endif - Ecore_Evas* ecore_evas = - ecore_evas_ecore_evas_get(evas_object_evas_get(elm_win_)); - int32_t width, height; - ecore_evas_screen_geometry_get(ecore_evas, nullptr, nullptr, &width, &height); +#ifdef EOM_SUPPORT + if (external_output_type_ != FlutterDesktopExternalOutputType::kNone) { + eom_get_output_resolution(ext_output_id_, &width, &height); + + if (width == 0 || height == 0) { + FT_LOG(Error) << "Invalid screen size: " << width << " x " << height; + return false; + } + + if (eom_set_output_window(ext_output_id_, elm_win_) != EOM_ERROR_NONE) { + FT_LOG(Error) << "eom_set_output_window() failed."; + } + } else +#endif + { + Ecore_Evas* ecore_evas = + ecore_evas_ecore_evas_get(evas_object_evas_get(elm_win_)); + + ecore_evas_screen_geometry_get(ecore_evas, nullptr, nullptr, &width, + &height); + } if (width == 0 || height == 0) { FT_LOG(Error) << "Invalid screen size: " << width << " x " << height; return false; @@ -323,8 +364,8 @@ void TizenWindowElementary::UnregisterEventHandlers() { } TizenGeometry TizenWindowElementary::GetGeometry() { - // FIXME : evas_object_geometry_get() and ecore_wl2_window_geometry_get() are - // not equivalent. + // FIXME : evas_object_geometry_get() and ecore_wl2_window_geometry_get() + // are not equivalent. TizenGeometry result; evas_object_geometry_get(elm_win_, &result.left, &result.top, &result.width, &result.height); @@ -403,4 +444,74 @@ void TizenWindowElementary::PrepareInputMethod() { [this](std::string str) { view_delegate_->OnCommit(str); }); } +#ifdef EOM_SUPPORT + +int32_t TizenWindowElementary::GetExternalOutputId() { + eom_output_id* output_ids = NULL; + eom_output_id output_id = 0; + eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN; + int32_t id_cnt = 0; + + output_ids = eom_get_eom_output_ids(&id_cnt); + if (id_cnt == 0) { + FT_LOG(Error) << "No external outputs supported"; + return 0; + } + + for (int32_t i = 0; i < id_cnt; i++) { + eom_get_output_type(output_ids[i], &output_type); + + if (external_output_type_ == FlutterDesktopExternalOutputType::kHDMI && + (output_type == EOM_OUTPUT_TYPE_HDMIA || + output_type == EOM_OUTPUT_TYPE_HDMIB)) { + output_id = output_ids[i]; + break; + } + } + + if (output_ids) + free(output_ids); + + return output_id; +} + +bool TizenWindowElementary::InitializeEom() { + if (eom_init()) { + FT_LOG(Error) << "Eom init fail."; + return false; + } + + int eom_ret; + ext_output_id_ = GetExternalOutputId(); + eom_output_mode_e output_mode = EOM_OUTPUT_MODE_NONE; + if (ext_output_id_ == 0) { + FT_LOG(Error) << "External output id is NULL."; + eom_deinit(); + return false; + } + + eom_ret = + eom_set_output_attribute(ext_output_id_, EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE); + if (eom_ret != EOM_ERROR_NONE) { + FT_LOG(Error) + << "eom_set_output_attribute() failed. Cannot use external output."; + eom_deinit(); + return false; + } + + eom_ret = eom_get_output_mode(ext_output_id_, &output_mode); + if (eom_ret != EOM_ERROR_NONE) { + FT_LOG(Error) + << "eom_get_output_mode() failed. Cannot use external output."; + eom_deinit(); + return false; + } + return true; +} + +void TizenWindowElementary::DestroyEom() { + eom_deinit(); +} +#endif + } // namespace flutter diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.h b/flutter/shell/platform/tizen/tizen_window_elementary.h index 5bff6a0..6028bf6 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.h +++ b/flutter/shell/platform/tizen/tizen_window_elementary.h @@ -12,6 +12,7 @@ #include #include +#include "flutter/shell/platform/tizen/public/flutter_tizen.h" #include "flutter/shell/platform/tizen/tizen_window.h" namespace flutter { @@ -21,7 +22,8 @@ class TizenWindowElementary : public TizenWindow { TizenWindowElementary(TizenGeometry geometry, bool transparent, bool focusable, - bool top_level); + bool top_level, + FlutterDesktopExternalOutputType external_output_type); ~TizenWindowElementary(); @@ -50,6 +52,14 @@ class TizenWindowElementary : public TizenWindow { void Show() override; private: +#ifdef EOM_SUPPORT + bool InitializeEom(); + + void DestroyEom(); + + int GetExternalOutputId(); +#endif + bool CreateWindow(); void DestroyWindow(); @@ -68,6 +78,12 @@ class TizenWindowElementary : public TizenWindow { Evas_Smart_Cb rotation_changed_callback_ = nullptr; std::unordered_map evas_object_callbacks_; + +#ifdef EOM_SUPPORT + int ext_output_id_; + FlutterDesktopExternalOutputType external_output_type_ = + FlutterDesktopExternalOutputType::kNone; +#endif }; } // namespace flutter diff --git a/tools/generate_sysroot.py b/tools/generate_sysroot.py index dd5b32d..d699484 100755 --- a/tools/generate_sysroot.py +++ b/tools/generate_sysroot.py @@ -109,6 +109,8 @@ 'vulkan-loader-devel', 'wayland-extension-client-devel', 'wayland-devel', + 'libeom', + 'libeom-devel', ] # Only available for Tizen 6.5 and above. From 87af81dc4bb025b4ff072cb003bc9f27fcab2579 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 22 Nov 2022 14:06:55 +0900 Subject: [PATCH 2/6] Modify base on review --- flutter/shell/platform/tizen/BUILD.gn | 3 +-- flutter/shell/platform/tizen/public/flutter_tizen.h | 2 +- .../shell/platform/tizen/tizen_window_elementary.cc | 10 +++++----- flutter/shell/platform/tizen/tizen_window_elementary.h | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/flutter/shell/platform/tizen/BUILD.gn b/flutter/shell/platform/tizen/BUILD.gn index f85b283..89efb6b 100644 --- a/flutter/shell/platform/tizen/BUILD.gn +++ b/flutter/shell/platform/tizen/BUILD.gn @@ -159,11 +159,10 @@ template("embedder") { sources += [ "channels/tizen_shell.cc" ] libs += [ + "eom", "tzsh_common", "tzsh_softkey", - "eom", ] - defines += [ "EOM_SUPPORT" ] } defines += invoker.defines diff --git a/flutter/shell/platform/tizen/public/flutter_tizen.h b/flutter/shell/platform/tizen/public/flutter_tizen.h index 6659cce..30d1b2a 100644 --- a/flutter/shell/platform/tizen/public/flutter_tizen.h +++ b/flutter/shell/platform/tizen/public/flutter_tizen.h @@ -39,7 +39,7 @@ typedef enum { } FlutterDesktopPointerEventType; typedef enum { - // No use external output. + // No external output. kNone, // Display to the HDMI external output. kHDMI, diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.cc b/flutter/shell/platform/tizen/tizen_window_elementary.cc index e574700..24f6664 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.cc +++ b/flutter/shell/platform/tizen/tizen_window_elementary.cc @@ -5,7 +5,7 @@ #include "tizen_window_elementary.h" #include -#ifdef EOM_SUPPORT +#ifdef COMMON_PROFILE #include #endif #include @@ -44,7 +44,7 @@ TizenWindowElementary::TizenWindowElementary( bool top_level, FlutterDesktopExternalOutputType external_output_type) : TizenWindow(geometry, transparent, focusable, top_level) { -#ifdef EOM_SUPPORT +#ifdef COMMON_PROFILE external_output_type_ = external_output_type; if (external_output_type_ != FlutterDesktopExternalOutputType::kNone && @@ -70,7 +70,7 @@ TizenWindowElementary::TizenWindowElementary( } TizenWindowElementary::~TizenWindowElementary() { -#ifdef EOM_SUPPORT +#ifdef COMMON_PROFILE if (external_output_type_ != FlutterDesktopExternalOutputType::kNone) { DestroyEom(); } @@ -94,7 +94,7 @@ bool TizenWindowElementary::CreateWindow() { #endif int32_t width, height; -#ifdef EOM_SUPPORT +#ifdef COMMON_PROFILE if (external_output_type_ != FlutterDesktopExternalOutputType::kNone) { eom_get_output_resolution(ext_output_id_, &width, &height); @@ -444,7 +444,7 @@ void TizenWindowElementary::PrepareInputMethod() { [this](std::string str) { view_delegate_->OnCommit(str); }); } -#ifdef EOM_SUPPORT +#ifdef COMMON_PROFILE int32_t TizenWindowElementary::GetExternalOutputId() { eom_output_id* output_ids = NULL; diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.h b/flutter/shell/platform/tizen/tizen_window_elementary.h index 6028bf6..1726e0c 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.h +++ b/flutter/shell/platform/tizen/tizen_window_elementary.h @@ -52,7 +52,7 @@ class TizenWindowElementary : public TizenWindow { void Show() override; private: -#ifdef EOM_SUPPORT +#ifdef COMMON_PROFILE bool InitializeEom(); void DestroyEom(); @@ -79,7 +79,7 @@ class TizenWindowElementary : public TizenWindow { std::unordered_map evas_object_callbacks_; -#ifdef EOM_SUPPORT +#ifdef COMMON_PROFILE int ext_output_id_; FlutterDesktopExternalOutputType external_output_type_ = FlutterDesktopExternalOutputType::kNone; From 677f892fdf8025c9d8518295db1453efeb7558ab Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 22 Nov 2022 15:27:31 +0900 Subject: [PATCH 3/6] Modify base on review --- flutter/shell/platform/tizen/BUILD.gn | 2 +- .../platform/tizen/tizen_window_elementary.cc | 94 ++++++------------- .../platform/tizen/tizen_window_elementary.h | 10 +- tools/generate_sysroot.py | 4 +- 4 files changed, 37 insertions(+), 73 deletions(-) diff --git a/flutter/shell/platform/tizen/BUILD.gn b/flutter/shell/platform/tizen/BUILD.gn index 89efb6b..c6000a6 100644 --- a/flutter/shell/platform/tizen/BUILD.gn +++ b/flutter/shell/platform/tizen/BUILD.gn @@ -128,6 +128,7 @@ template("embedder") { "efl-extension", "eina", "elementary", + "eom", "evas", "feedback", "flutter_engine", @@ -159,7 +160,6 @@ template("embedder") { sources += [ "channels/tizen_shell.cc" ] libs += [ - "eom", "tzsh_common", "tzsh_softkey", ] diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.cc b/flutter/shell/platform/tizen/tizen_window_elementary.cc index 24f6664..ea8e24c 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.cc +++ b/flutter/shell/platform/tizen/tizen_window_elementary.cc @@ -5,9 +5,7 @@ #include "tizen_window_elementary.h" #include -#ifdef COMMON_PROFILE #include -#endif #include #include "flutter/shell/platform/tizen/logger.h" @@ -43,20 +41,13 @@ TizenWindowElementary::TizenWindowElementary( bool focusable, bool top_level, FlutterDesktopExternalOutputType external_output_type) - : TizenWindow(geometry, transparent, focusable, top_level) { -#ifdef COMMON_PROFILE - external_output_type_ = external_output_type; - + : TizenWindow(geometry, transparent, focusable, top_level), + external_output_type_(external_output_type) { if (external_output_type_ != FlutterDesktopExternalOutputType::kNone && - !InitializeEom()) { - FT_LOG(Error) << "Failed to initialize eom."; + !InitializeExternalOutputManager()) { + FT_LOG(Error) << "Failed to initialize the External Output Manager."; return; } -#else - if (external_output_type != FlutterDesktopExternalOutputType::kNone) { - FT_LOG(Error) << "External output is not supported by this profile."; - } -#endif if (!CreateWindow()) { FT_LOG(Error) << "Failed to create a platform window."; @@ -70,11 +61,9 @@ TizenWindowElementary::TizenWindowElementary( } TizenWindowElementary::~TizenWindowElementary() { -#ifdef COMMON_PROFILE if (external_output_type_ != FlutterDesktopExternalOutputType::kNone) { - DestroyEom(); + DestroyExternalOutputManager(); } -#endif UnregisterEventHandlers(); DestroyWindow(); } @@ -93,25 +82,12 @@ bool TizenWindowElementary::CreateWindow() { elm_win_aux_hint_add(elm_win_, "wm.policy.win.user.geometry", "1"); #endif - int32_t width, height; -#ifdef COMMON_PROFILE + int32_t width = 0, height = 0; if (external_output_type_ != FlutterDesktopExternalOutputType::kNone) { - eom_get_output_resolution(ext_output_id_, &width, &height); - - if (width == 0 || height == 0) { - FT_LOG(Error) << "Invalid screen size: " << width << " x " << height; - return false; - } - - if (eom_set_output_window(ext_output_id_, elm_win_) != EOM_ERROR_NONE) { - FT_LOG(Error) << "eom_set_output_window() failed."; - } - } else -#endif - { + eom_get_output_resolution(external_output_id_, &width, &height); + } else { Ecore_Evas* ecore_evas = ecore_evas_ecore_evas_get(evas_object_evas_get(elm_win_)); - ecore_evas_screen_geometry_get(ecore_evas, nullptr, nullptr, &width, &height); } @@ -140,6 +116,14 @@ bool TizenWindowElementary::CreateWindow() { evas_object_image_alpha_set(image_, EINA_TRUE); elm_win_resize_object_add(elm_win_, image_); + if (external_output_type_ != FlutterDesktopExternalOutputType::kNone) { + if (eom_set_output_window(external_output_id_, elm_win_) != + EOM_ERROR_NONE) { + FT_LOG(Error) << "eom_set_output_window() failed."; + return false; + } + } + return elm_win_ && image_; } @@ -364,8 +348,8 @@ void TizenWindowElementary::UnregisterEventHandlers() { } TizenGeometry TizenWindowElementary::GetGeometry() { - // FIXME : evas_object_geometry_get() and ecore_wl2_window_geometry_get() - // are not equivalent. + // FIXME : evas_object_geometry_get() and ecore_wl2_window_geometry_get() are + // not equivalent. TizenGeometry result; evas_object_geometry_get(elm_win_, &result.left, &result.top, &result.width, &result.height); @@ -444,17 +428,15 @@ void TizenWindowElementary::PrepareInputMethod() { [this](std::string str) { view_delegate_->OnCommit(str); }); } -#ifdef COMMON_PROFILE - int32_t TizenWindowElementary::GetExternalOutputId() { - eom_output_id* output_ids = NULL; + eom_output_id* output_ids = nullptr; eom_output_id output_id = 0; eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN; int32_t id_cnt = 0; output_ids = eom_get_eom_output_ids(&id_cnt); - if (id_cnt == 0) { - FT_LOG(Error) << "No external outputs supported"; + if (!output_ids || id_cnt == 0) { + FT_LOG(Error) << "No external output found."; return 0; } @@ -468,50 +450,36 @@ int32_t TizenWindowElementary::GetExternalOutputId() { break; } } - - if (output_ids) - free(output_ids); - + free(output_ids); return output_id; } -bool TizenWindowElementary::InitializeEom() { +bool TizenWindowElementary::InitializeExternalOutputManager() { if (eom_init()) { - FT_LOG(Error) << "Eom init fail."; + FT_LOG(Error) << "eom_init() failed."; return false; } - int eom_ret; - ext_output_id_ = GetExternalOutputId(); - eom_output_mode_e output_mode = EOM_OUTPUT_MODE_NONE; - if (ext_output_id_ == 0) { - FT_LOG(Error) << "External output id is NULL."; + external_output_id_ = GetExternalOutputId(); + if (external_output_id_ == 0) { + FT_LOG(Error) << "Invalid external output ID."; eom_deinit(); return false; } - eom_ret = - eom_set_output_attribute(ext_output_id_, EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE); - if (eom_ret != EOM_ERROR_NONE) { + int ret = eom_set_output_attribute(external_output_id_, + EOM_OUTPUT_ATTRIBUTE_NORMAL); + if (ret != EOM_ERROR_NONE) { FT_LOG(Error) << "eom_set_output_attribute() failed. Cannot use external output."; eom_deinit(); return false; } - - eom_ret = eom_get_output_mode(ext_output_id_, &output_mode); - if (eom_ret != EOM_ERROR_NONE) { - FT_LOG(Error) - << "eom_get_output_mode() failed. Cannot use external output."; - eom_deinit(); - return false; - } return true; } -void TizenWindowElementary::DestroyEom() { +void TizenWindowElementary::DestroyExternalOutputManager() { eom_deinit(); } -#endif } // namespace flutter diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.h b/flutter/shell/platform/tizen/tizen_window_elementary.h index 1726e0c..ea8aac7 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.h +++ b/flutter/shell/platform/tizen/tizen_window_elementary.h @@ -52,13 +52,11 @@ class TizenWindowElementary : public TizenWindow { void Show() override; private: -#ifdef COMMON_PROFILE - bool InitializeEom(); + bool InitializeExternalOutputManager(); - void DestroyEom(); + void DestroyExternalOutputManager(); int GetExternalOutputId(); -#endif bool CreateWindow(); @@ -79,11 +77,9 @@ class TizenWindowElementary : public TizenWindow { std::unordered_map evas_object_callbacks_; -#ifdef COMMON_PROFILE - int ext_output_id_; + int32_t external_output_id_; FlutterDesktopExternalOutputType external_output_type_ = FlutterDesktopExternalOutputType::kNone; -#endif }; } // namespace flutter diff --git a/tools/generate_sysroot.py b/tools/generate_sysroot.py index d699484..9e9be17 100755 --- a/tools/generate_sysroot.py +++ b/tools/generate_sysroot.py @@ -85,6 +85,8 @@ 'jsoncpp-devel', 'libatk', 'libatk-bridge-2_0-0', + 'libeom', + 'libeom-devel', 'libfeedback', 'libfeedback-devel', 'libdlog', @@ -109,8 +111,6 @@ 'vulkan-loader-devel', 'wayland-extension-client-devel', 'wayland-devel', - 'libeom', - 'libeom-devel', ] # Only available for Tizen 6.5 and above. From 9e40e5d455e5fef6caf6bc5edde7719a990e9cf9 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 22 Nov 2022 18:00:59 +0900 Subject: [PATCH 4/6] Update flutter/shell/platform/tizen/tizen_window_elementary.cc Co-authored-by: Swift Kim --- flutter/shell/platform/tizen/tizen_window_elementary.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.cc b/flutter/shell/platform/tizen/tizen_window_elementary.cc index ea8e24c..ce7cfaa 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.cc +++ b/flutter/shell/platform/tizen/tizen_window_elementary.cc @@ -429,12 +429,8 @@ void TizenWindowElementary::PrepareInputMethod() { } int32_t TizenWindowElementary::GetExternalOutputId() { - eom_output_id* output_ids = nullptr; - eom_output_id output_id = 0; - eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN; - int32_t id_cnt = 0; - - output_ids = eom_get_eom_output_ids(&id_cnt); + int32_t num_ids = 0; + eom_output_id* output_ids = eom_get_eom_output_ids(&num_ids); if (!output_ids || id_cnt == 0) { FT_LOG(Error) << "No external output found."; return 0; From aa77f2bb79de7de7af23ad079b566e0e85a89dae Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 22 Nov 2022 18:01:07 +0900 Subject: [PATCH 5/6] Update flutter/shell/platform/tizen/tizen_window_elementary.cc Co-authored-by: Swift Kim --- flutter/shell/platform/tizen/tizen_window_elementary.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.cc b/flutter/shell/platform/tizen/tizen_window_elementary.cc index ce7cfaa..6e3b16f 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.cc +++ b/flutter/shell/platform/tizen/tizen_window_elementary.cc @@ -436,7 +436,9 @@ int32_t TizenWindowElementary::GetExternalOutputId() { return 0; } + eom_output_id output_id = 0; for (int32_t i = 0; i < id_cnt; i++) { + eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN; eom_get_output_type(output_ids[i], &output_type); if (external_output_type_ == FlutterDesktopExternalOutputType::kHDMI && From 1cd83e4b0f1f30475403b94bc0d0736d6756fb3f Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 22 Nov 2022 18:03:21 +0900 Subject: [PATCH 6/6] Modify base on review --- flutter/shell/platform/tizen/tizen_window_elementary.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flutter/shell/platform/tizen/tizen_window_elementary.cc b/flutter/shell/platform/tizen/tizen_window_elementary.cc index 6e3b16f..ea993b8 100644 --- a/flutter/shell/platform/tizen/tizen_window_elementary.cc +++ b/flutter/shell/platform/tizen/tizen_window_elementary.cc @@ -431,13 +431,13 @@ void TizenWindowElementary::PrepareInputMethod() { int32_t TizenWindowElementary::GetExternalOutputId() { int32_t num_ids = 0; eom_output_id* output_ids = eom_get_eom_output_ids(&num_ids); - if (!output_ids || id_cnt == 0) { + if (!output_ids || num_ids == 0) { FT_LOG(Error) << "No external output found."; return 0; } eom_output_id output_id = 0; - for (int32_t i = 0; i < id_cnt; i++) { + for (int32_t i = 0; i < num_ids; i++) { eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN; eom_get_output_type(output_ids[i], &output_type); @@ -461,7 +461,6 @@ bool TizenWindowElementary::InitializeExternalOutputManager() { external_output_id_ = GetExternalOutputId(); if (external_output_id_ == 0) { FT_LOG(Error) << "Invalid external output ID."; - eom_deinit(); return false; } @@ -470,7 +469,6 @@ bool TizenWindowElementary::InitializeExternalOutputManager() { if (ret != EOM_ERROR_NONE) { FT_LOG(Error) << "eom_set_output_attribute() failed. Cannot use external output."; - eom_deinit(); return false; } return true;