Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any ideas how to make playback less memory\gc hungry? #2

Closed
hellozyemlya opened this issue Mar 14, 2024 · 4 comments
Closed

Any ideas how to make playback less memory\gc hungry? #2

hellozyemlya opened this issue Mar 14, 2024 · 4 comments

Comments

@hellozyemlya
Copy link

Rendering some big 60 fps video takes hell lot of memory for each frame where Bitmap is allocated.

Any ideas how to reuse\lock bitmap between vlcj render callback and main thread?

@UjjwalT1
Copy link
Owner

I dont think I do. Coz while working on this project my intention wasn't on optimising how frame buffer allocation is working. My focus was simply to make something that just works. And I failed even in that too, coz the buffer allocation only works when the application is running as a jar file and fails when running as exe.

@hellozyemlya
Copy link
Author

Thanks for answer. Just for information - find out androidx.compose.ui.graphics.painter.Painter, it allows to implement custom bitmap painter(an alternative for androidx.compose.ui.graphics.painter.BitmapPainter). Will look further to remove allocations at all, just need to know how to repaint image.

Custom drawer allowed to reuse one skia Bitmap, where all access to it wrapped inside synchronized block(as well as resulting ImageBitmap access, that backed by that skia Bitmap instance). That reduces allocation count a lot, now app memory usage is constant.

@hellozyemlya
Copy link
Author

And sorry for troubling - running as exe == running from generated distributions? Probably will take a look at that issue as well, since I want to write more or less similar app. Was very surprised that something already exists, I even tend to fork, and add required functionality for my needs, but there is no license. Anyway, thanks a lot for answers and good code references.

@UjjwalT1
Copy link
Owner

running as exe == running from generated distributions?

Yeah I meant that only .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants