Giter Club home page Giter Club logo

Comments (3)

alexmercerind avatar alexmercerind commented on June 11, 2024

Hi @lycstar !

Current implementation extracts RAW frame and sends back it to Dart through platform channel for rendering it using RawImage and decodeImageFromPixels.
For more detail, a single buffer is allocated on the heap of size videoHeight * videoWidth * 4 bytes as uint8_t[] in which frame data is stored. Recently its been informed to me (here), that the data sent through platform channels is being retained in memory & seems a new buffer is being allocated everytime (maybe some deepcopying is happening somewhere). So, it needs to be figured out by me first of all as a priority.

You are exactly right, this isn't the best in terms of performance but I don't think there is anything else we can do for showing a video inside Widget tree. Even official video_player plugin does so. Although, it is hard on CPU & does not use GPU.

A native viewport directly from libVLC will be shown if you pass videoHeight and videoWidth as 0, while instantiating Player class. But it will be a separate window & will not be shown inside Widget tree. This native viewport is more performant as its direct libVLC doing its thing & is GPU accelerated.

Apart from all above, I've started to work on FFI based implementation of this plugin so that I can bring this library to Android or mac or console dart applications. Considering that, there will be no need to transfer frame data in that case for console apps.

Thanks.
I'll be willing to improve the implementation, but I believe showing RAW frames is the best that we can have right now.

from dart_vlc.

alexmercerind avatar alexmercerind commented on June 11, 2024

The memory leak issue is fixed & considering its a question, I feel my answer gives you enough reasoning of things.

from dart_vlc.

lycstar avatar lycstar commented on June 11, 2024

@alexmercerind Thank you for your anwser.

from dart_vlc.

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.