sony / flutter-embedded-linux

Embedded Linux embedding for Flutter
BSD 3-Clause "New" or "Revised" License
1.2k stars 128 forks source link

Add external texture plugin for GPU texture #157

Open HidenoriMatsubayashi opened 3 years ago

HidenoriMatsubayashi commented 3 years ago

The current external texture plugin which is the same with Flutter desktop for Windows supports pixel buffer only. However, its performance is not good. So we need to add a texture plugin with a GPU texture buffer.

charafau commented 3 years ago

related issue and PR (for : https://github.com/flutter/flutter/issues/83693 https://github.com/flutter/engine/pull/26562

implementation in tizen engine:

https://github.com/flutter-tizen/engine/pull/86

HidenoriMatsubayashi commented 3 years ago

Thank you for sharing. I guess flutter/engine#26562 is the same implementation with flutter-tizen. I'm looking forward to it will be merged. After that, I'll copy and merge it to our repo.

charafau commented 3 years ago

yes, I think you're right. the reason why I linked tizen one is because in discussion, dev actually shows how to use this code :)

swift-kim commented 2 years ago

Update: https://github.com/flutter/engine/pull/26562#issuecomment-1114156009

talksik commented 1 year ago

Hey @HidenoriMatsubayashi, isn't this thread solved by DMA buffers? Or is that different than external texture plugin.

Is using the DMA buffer that is currently implemented in video_player ensure hardware accelerated rendering? Or is it just improving the memory inefficiency problem compared to PixelBuffer?

Thank you! Been trying to figure out how to improve performance here further. I have gstreamer elements with hardware accelerated decoding, but now need to ensure that rendering is done with hardware acceleration.

HidenoriMatsubayashi commented 1 year ago

isn't this thread solved by DMA buffers? Or is that different than external texture plugin.

No, it's different from dmabuf in video_player. The task in this issue is that porting https://github.com/flutter/engine/pull/26840. Currently, we haven't implemented kFlutterDesktopGpuSurfaceTexture yet. See https://github.com/sony/flutter-embedded-linux/blob/master/src/flutter/shell/platform/linux_embedded/flutter_elinux_texture_registrar.cc#L51C45-L51C45

Is using the DMA buffer that is https://github.com/sony/flutter-elinux-plugins/pull/67 in video_player ensure hardware accelerated rendering? Or is it just improving the memory inefficiency problem compared to PixelBuffer?

The latter.

talksik commented 1 year ago

Thanks @HidenoriMatsubayashi for the detailed explanation!

I will research this further to see if I can make a dent. 👍🏾

barribarrier commented 3 weeks ago

Hi @HidenoriMatsubayashi

Has there been any progress on this? I wanted to do harware accelerated video rendering using video_player too.

HidenoriMatsubayashi commented 3 weeks ago

unfortunately, there is no progress. So it would be great if you could create a patch for this :)

barribarrier commented 3 weeks ago

@HidenoriMatsubayashi Got it. Was there anything wrong with this or is it just left unfinished? https://github.com/HidenoriMatsubayashi/flutter-embedded-linux/commit/d7750d3bfe81c02a860219e676c54675ab037923

HidenoriMatsubayashi commented 2 weeks ago

I don't remember, but it’s unfinished and old.