Skip to content

Conversation

ardera
Copy link
Owner

@ardera ardera commented Mar 27, 2023

No description provided.

@ardera ardera force-pushed the feature/compositor-ng branch 2 times, most recently from c81fa43 to ad4cabd Compare April 8, 2023 10:08
@ardera ardera force-pushed the feature/compositor-ng branch 2 times, most recently from 0e0889e to d4fbfdf Compare May 13, 2023 14:01
@ardera ardera linked an issue Jun 1, 2023 that may be closed by this pull request
@Stefichen5
Copy link

I am having issues compiling this (#d8c7b4595454c89a7017c73793ad00490c79dc1f). I get the following error:

.../flutter-pi-d8c7b4595454c89a7017c73793ad00490c79dc1f/src/plugins/gstreamer_video_player/frame.c:518:61: error: ‘i’ undeclared (first use in this function)
  518 |         guint x_tiles = GST_VIDEO_TILE_X_TILES(info->stride[i]);
      |                                                             ^

Looking inside the file, I think I can see the problem:

static bool calculate_plane_size(const GstVideoInfo *info, int plane_index, size_t *plane_size_out) {
    // Taken from: https://github.com/GStreamer/gstreamer/blob/621604aa3e4caa8db27637f63fa55fac2f7721e5/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c#L1278-L1301

    #if THIS_GSTREAMER_VER >= GSTREAMER_VER(1, 21, 3)
    if (GST_VIDEO_FORMAT_INFO_IS_TILED(info->finfo)) {
        guint x_tiles = GST_VIDEO_TILE_X_TILES(info->stride[i]);
        guint y_tiles = GST_VIDEO_TILE_Y_TILES(info->stride[i]);
        return x_tiles * y_tiles * GST_VIDEO_FORMAT_INFO_TILE_SIZE(info->finfo, i);
    }
    #endif
   //...

Compared to the source:

for (i = 0; i < GST_VIDEO_MAX_PLANES; i++) {
      if (i < GST_VIDEO_INFO_N_PLANES (info)) {
        if (GST_VIDEO_FORMAT_INFO_IS_TILED (info->finfo)) {
          guint x_tiles = GST_VIDEO_TILE_X_TILES (info->stride[i]);
          guint y_tiles = GST_VIDEO_TILE_Y_TILES (info->stride[i]);
          plane_size[i] = x_tiles * y_tiles *
//...

I think the following patch might help (at least it compiles):

-    if (GST_VIDEO_FORMAT_INFO_IS_TILED(info->finfo)) {
-        guint x_tiles = GST_VIDEO_TILE_X_TILES(info->stride[i]);
-        guint y_tiles = GST_VIDEO_TILE_Y_TILES(info->stride[i]);
-        return x_tiles * y_tiles * GST_VIDEO_FORMAT_INFO_TILE_SIZE(info->finfo, i);
+    for (int i = 0; i < GST_VIDEO_MAX_PLANES; i++) {
+        if (GST_VIDEO_FORMAT_INFO_IS_TILED(info->finfo)) {
+            guint x_tiles = GST_VIDEO_TILE_X_TILES(info->stride[i]);
+            guint y_tiles = GST_VIDEO_TILE_Y_TILES(info->stride[i]);
+            *plane_size_out = x_tiles * y_tiles * GST_VIDEO_FORMAT_INFO_TILE_SIZE(info->finfo, i);
+            return true;
+        }

@ardera ardera linked an issue Jun 10, 2023 that may be closed by this pull request
@ardera
Copy link
Owner Author

ardera commented Jun 10, 2023

@Stefichen5 Thanks for reporting, actually that's a typo and the fix is to use plane_index instead of i :)
It's fixed in efa730d 9cb0ae4.

ardera added 17 commits August 22, 2023 11:44
- uses libseat, which is a fairly new lib
- not really functional right now
modesetting.{c,h}:
- add drmdev interface for opening/closing drm device as master
- slight drmdev API refactor
- remove "flags" parameter for drmdev_add_fb* functions
- add methods for suspending / resuming DRM device
  - split into non-master and master DRM fd
  - master DRM fd is closed and reopened on suspend/resume

user_input.{c,h}:
- add callbacks for opening, closing and the switch VT keybind to struct user_input_interface
- add methods for suspending, resuming user input
  - will call libinput_suspend, libinput_resume internally

egl_gbm_render_surface.c:
- remove the whole opaque fb workaround
- not really necessary it seems
- correct invocation of kms_req_builder_push_fb_layer

flutter-pi.c:
- work with new interfaces of user_input, drmdev
- add initial call to libseat_dispatch
- add on_switch_vt callback
- add user input device open/close callbacks
- fix setting of cmd_args.has_physical_dimensions in parse_cmd_args
- use optimal tiling for vulkan render surfaces
- specify valid values for the vulkan image layout
- remove old opaque fb casting workaround in vulkan render surface
- call vkDeviceWaitIdle before present fb bc apparently on intel, something doesn't work with synchronization
- remove non-null libseat assertion (since we can run without libseat as well)
- use LOG_DEBUG instead of LOG_ERROR for libseat_open_seat error
- make locales output use LOG_DEBUG_UNPREFIXED
- fix integer type for bitmask in modesetting.c
- otherwise playbin will fail to initialize
- see #233 (comment)
- add new platform message interface for gstreamer video player
- add a way to create gstreamer video player from raw gstreamer pipeline
- add new API for using standard message codec values without decoding
- prepare for new FlutterSendKeyEvent API
- fix some compiler warnings (esp. for release mode)
- add & enable LTO support
- prepare for mouse cursor support
- suffix pixel formats with _FpiPixelFormat to fix namespace collisions with next flutter version
- remove CXX from cmake project languages
- fix use-after-free in plugin registry
- add new platform message interface for gstreamer video player
- add a way to create gstreamer video player from raw gstreamer pipeline
- add new API for using standard message codec values without decoding
- add some `raw_std_method_call_...` API for checking, handling method calls
- make gstreamer plugin use that API
- a function returning new memory can't be pure
ardera added 19 commits August 22, 2023 11:44
drmdev_unref should be used instead.
Use kms_req_builder_unref instead.
Add TODO on reducing EGL API traffic by keeping a single EGL context
current for the whole lifetime of a gstreamer streaming thread.
Move all asserts from `util/collection.h` into separate
`util/asserts.h`. Include new header in `collection.h` by default.
Use linked list instead of pointer_set.
Use linked list instead of concurrent_pointer_set for texture list.
Also use atomic variable for tracking next unused texture id.
Use linked list instead of concurrent_pointer_set.
Use linked list instead of pointer_set for device id to fd map.
Remove queue, concurrent_queue, pointer_set, concurrent_pointer_set
Remove some imports from collection.h, include them directly in any
files that needs them instead.
Use a single style convention for all header guards.
@ardera ardera force-pushed the feature/compositor-ng branch from 1c5c42d to 566c504 Compare August 22, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment