Git Product home page Git Product logo

Comments (19)

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on August 15, 2024 1

Thank you for your question. Yes, I'm going to add the Yocto support for the example.

from flutter-embedded-linux.

 avatar commented on August 15, 2024 1

@HidenoriMatsubayashi
Start working on this issue.

from flutter-embedded-linux.

topolittle avatar topolittle commented on August 15, 2024 1

Following the commit ae9e975, the above patch I posted to cross-compile in Yocto is no longer required.

from flutter-embedded-linux.

jmarijan avatar jmarijan commented on August 15, 2024

Thank you for your response. Looking forward to it.

In meanwhile, I am trying to create a recipe for your repo on my own. I am using dunfell version of Yocto.
There is a problem regarding EGL/egl.h library. While cross-compiling your repo on Yocto, following error is received:

`| tmp/work/aarch64-mx8mn-fslc-linux/flutter-embedded-linux/1.0-r0/git/src/flutter/shell/platform/linux_embedded/surface/context_egl.h:92:26: error: no matching function for call to 'eglCreateWindowSurface'
| EGLSurface surface = eglCreateWindowSurface(
| ^~~~~~~~~~~~~~~~~~~~~~

|tmp/work/aarch64-mx8mn-fslc-linux/flutter-embedded-linux/1.0-r0/git/src/flutter/shell/platform/linux_embedded/surface/linuxes_surface_gl_drm.h:48:36: note: in instantiation of member function 'flutter::ContextEgl<gbm_device, gbm_surface, gbm_surface>::CreateOffscreenSurface' requested here
| offscreen_surface_ = context_->CreateOffscreenSurface(window);
| ^

| tmp/work/aarch64-mx8mn-fslc-linux/flutter-embedded-linux/1.0-r0/recipe-sysroot/usr/include/EGL/egl.h:155:31: note: candidate function not viable: cannot convert argument of incomplete type 'gbm_surface *' to 'EGLNativeWindowType' (aka 'wl_egl_window *') for 3rd argument
| EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
`

In my opinion, your EGL/egl.h and EGL/egl.h library which Yocto fetches from source (https://archive.mesa3d.org/; version 20.0.2) are different.
Can you please tell me which version of EGL/egl.h library is in use on your project?

from flutter-embedded-linux.

psstoyanov avatar psstoyanov commented on August 15, 2024

@jmarijan , I believe EGLStream is already marked as pending for implementation in #1

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on August 15, 2024

@jmarijan
Did you add WL_EGL_PLATFORM define? NativeWindowType is different depends on the platforms. You need to specify it properly.

EGLSurface eglCreateWindowSurface(EGLDisplay display, 
    EGLConfig config, NativeWindowType native_window, EGLint const * attrib_list);

See: https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h

#elif defined(WL_EGL_PLATFORM)

typedef struct wl_display     *EGLNativeDisplayType;
typedef struct wl_egl_pixmap  *EGLNativePixmapType;
typedef struct wl_egl_window  *EGLNativeWindowType;

#elif defined(__GBM__)

typedef struct gbm_device  *EGLNativeDisplayType;
typedef struct gbm_bo      *EGLNativePixmapType;
typedef void               *EGLNativeWindowType;

#elif defined(__ANDROID__) || defined(ANDROID)

from flutter-embedded-linux.

jwinarske avatar jwinarske commented on August 15, 2024

https://github.com/jwinarske/meta-flutter/blob/dunfell/recipes-graphics/flutter-embedded-linux/flutter-embedded-linux_git.bb
It builds but I need to sort out the install paths when I have a spare moment, and add some package config flags for the build variants.

@HidenoriMatsubayashi I understand you were asking around Toyota. I own the Toyota Flutter Embedder.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on August 15, 2024

@jwinarske
Thank you for commenting and creating flutter-embedded-linux_git.bb. Actually, @TomohideMorimoto who is one of our member is creating a Yocto meta file for Flutter Engine and this embedder.

Yes, I talked a little with Toyota's members a few weeks ago. Are you one of them? Toyota's Flutter Embedder is focusing AGL, right? I'm interested in Flutter use in AGL and Toyota. Do you have any plans to open source? Especially, I'm interested in what to do with plugins such as video player and webview.

from flutter-embedded-linux.

jwinarske avatar jwinarske commented on August 15, 2024

@jwinarske
Thank you for commenting and creating flutter-embedded-linux_git.bb. Actually, @TomohideMorimoto who is one of our member is creating a Yocto meta file for Flutter Engine and this embedder.

Yes, I talked a little with Toyota's members a few weeks ago. Are you one of them? Toyota's Flutter Embedder is focusing AGL, right? I'm interested in Flutter use in AGL and Toyota. Do you have any plans to open source? Especially, I'm interested in what to do with plugins such as video player and webview.

Open source plans are out of my hands. If/when it does, it will happen through AGL (Yocto based). The flutter-engine recipe won' change much beyond this one, if at all.

As far as plugins go I prefer manually loading a shared module, oppose to statically linking the plugin code. If the plugin is in the filesystem, then it gets loaded, otherwise returns not implemented on the channel. It keeps a clean demarcation between random plugin authors and application owners. So having a plugin that can be built for GTK Linux or standalone plugin (shared module with known API including version) would meet the requirement. Otherwise trying to cross compile a plugin using Flutter tools would require binary repository package changes not standard between organizations. So alignment on plugins is a need.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on August 15, 2024

I see. Thank you for sharing!

from flutter-embedded-linux.

jwinarske avatar jwinarske commented on August 15, 2024

Updated recipes here. Each example app is a separate recipe. Patches are specific to dunfell (libweston-8). I renamed the bins so they can be installed at the same time.

There is currently an issue with XDG protocol hanging. Seems you're missing a surface commit, which also indicates you're building with older Wayland Protocol and Weston.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on August 15, 2024

@jwinarske

There is currently an issue with XDG protocol hanging. Seems you're missing a surface commit, which also indicates you're building with older Wayland Protocol and Weston.

Could you give me some more information? Do you mean that wl_surface_commit should be called every time?

from flutter-embedded-linux.

topolittle avatar topolittle commented on August 15, 2024

I get the following error:
ninja: error: '/usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml'
That's because the path to the xml file is hardcoded to the host in the cmake build file.
The following patch resolves this error.

From f7f5e4e69adae518824dfcfe1002129d2cb19f3a Mon Sep 17 00:00:00 2001
From: Stephane Gilbert [email protected]
Date: Mon, 19 Apr 2021 14:05:38 -0400
Subject: [PATCH] Fix: xdg-shell.xml not found


cmake/build.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/build.cmake b/cmake/build.cmake
index 8abc9b7..ac66080 100644
--- a/cmake/build.cmake
+++ b/cmake/build.cmake
@@ -35,7 +35,7 @@ elseif(${BACKEND_TYPE} STREQUAL "X11")
src/flutter/shell/platform/linux_embedded/window/native_window_x11.cc)
else()
find_program(WaylandScannerExec NAMES wayland-scanner)

  • get_filename_component(_infile /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml ABSOLUTE)
  • get_filename_component(_infile $ENV{PKG_CONFIG_SYSROOT_DIR}/usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml ABSOLUTE)
    set(_client_header ${CMAKE_CURRENT_SOURCE_DIR}/src/wayland/protocol/xdg-shell-client-protocol.h)
    set(_code ${CMAKE_CURRENT_SOURCE_DIR}/src/wayland/protocol/xdg-shell-protocol.c)
    set_source_files_properties(${_client_header} GENERATED)
    --
    2.30.2

Once the configure phase passes, there are many compilation errors. It's like clang doesn't find all the required include files.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on August 15, 2024

@TomohideMorimoto Please check your build environment and fix properly.

from flutter-embedded-linux.

topolittle avatar topolittle commented on August 15, 2024

I managed to build flutter-wayland-client under Yocto. Here what I have changed:
There was a missing build dependency. I added wayland-protocol to the DEPENDS variable.
I had to make some change to CmakeList.txt to use the Yocto's cross compiler instead of the native one. Here is the patch for it:

From b447ab6b15a9b906b0990eebbc7068ca410baa79 Mon Sep 17 00:00:00 2001
From: Stephane Gilbert <[email protected]>
Date: Tue, 20 Apr 2021 13:08:51 -0400
Subject: [PATCH] Fix: Wrong clang compiler used in Yocto Setting
 CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in CMakeList overrides the compiler
 binary Bitbake should use to cross-compile E.g.: clang++ vs
 aarch64-poky-linux-clang++

---
 CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9008a04..1a7b44a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.10)
 project("flutter_linuxes" LANGUAGES CXX C)
 
 # Rules of compiler and cpp version.
-set(CMAKE_C_COMPILER clang)
-set(CMAKE_CXX_COMPILER clang++)
+#set(CMAKE_C_COMPILER clang)
+#set(CMAKE_CXX_COMPILER clang++)
 set(CMAKE_CXX_STANDARD 17)
 
 # Build options.
-- 
2.30.2

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on August 15, 2024

@topolittle

There was a missing build dependency. I added wayland-protocol to the DEPENDS variable.

I would like to confirm. wayland-protocol isn't explicitly added, but It exists in meta/recipes-graphics/wayland. So, I think it's okay without it. Are you cross-building using the SDK/toolchain generated by Yocto?

from flutter-embedded-linux.

jwinarske avatar jwinarske commented on August 15, 2024

A meta-layer is always in a separate source repo, otherwise you clone the same repo twice, and you end up with source in your meta layer. Not a good pattern.

Why not just reference my layer? Not to mention it's going to get some updates.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on August 15, 2024

Thank you for your advice. I'm wondering if we should make a new repo for the yocto recipe. By the way, just wondering, is your activity on here in a position as Toyota or personal?

from flutter-embedded-linux.

jwinarske avatar jwinarske commented on August 15, 2024

Personal.

from flutter-embedded-linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.