-
Notifications
You must be signed in to change notification settings - Fork 41
Add screenshot feature to mufbset and overlay display on to top #251
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
base: main
Are you sure you want to change the base?
Conversation
|
The screenshot feature is a nice addition to |
|
Yes, unless there's a new framebuffer driver for sunxi that supports layers, it's not physically possible to overlay over a live process without some sort of hacking/glitching. I've tried many alternatives with more or less success:
I think the only way to have the "live" overlay feature, without kernel/driver work, is to patch every core to load a dynamic library containing a function that's called after any framebuffer rendering. We can't just redirect However, the pause feature If you have time, please try it and if you're ok, I can remove the "live" overlay part since it's far from perfect and a lot more complex than the pause overlay mode. |
…ed). It's not perfect but for opaque overlay, it might be enough. Main issue happens for core misusing framebuffer's voffset for double buffering It's not possible to know when the core changed the buffer it wrote too. Thus, it's not possible to backup the framebuffer before drawing since the core can write to anypart of the buffer and move stuff around (instead of overwriting). If we draw to both buffers (but for core moving stuff around, this leads to visual corruption) it's slow because the ioctl to know what is the current offset chosen takes more time than a frame duration.
|
Ok, simplified the code a lot to remove live overlay feature and only support paused overlay feature that works flawlessly. I think it should be possible to update muxsnapshot to use the new options too, but it's in another future PR. Should be ready for review. |
This adds 2 features to mufbset:
Add screenshot feature with saving to PNG
This allow to capture a screenshot (when run like this:
mufbset -s dump.png) to a file, by compressing the framebuffer's active area to a PNG file.Add overlay feature
This allow to display an overlay picture on top of the currently drawn framebuffer. This is useful for display, for example, the volume bar when a core is running (this part will be a PR in
internalrepository), or a5mn leftmessage.It's possible to specify where to overlay the picture, and for how long and if the drawing process should be paused or not.
Currently, overlaying while the drawing process isn't paused is slow because I'm doing it 60 times per second not to miss any frame. I think it's better to compute a fingerprint of the current framebuffer content (for the overlaid area only) and only redraw the overlay if it's changed. I'm currently doing this and will update this PR if it proves better in terms of performance.