Comments (3)
The biggest obstacle to porting Memento is macOS it how macOS handles fullscreening applications.
When Memento is fullscreened on macOS and video is playing, the whole system will hang for about 30 seconds before finally entering a functional fullscreen. This is completely unique to macOS and happens no other platform. After extensive messing around, I've discovered that MpvWidget is likely rendering frames on the UI thread. I came to this conclusion after I experienced the same behavior in libmpv's qt_opengl example, code which Memento uses with almost no modification. Interestingly, I did not experience this issue in libmpv's qml example, at least not with the same frequency. After reading Qt's documentation on QQuickFramebufferObject, I found that QQuickFramebufferObject renders everything off the UI thread, while QOpenGLWidget renders everything on the UI thread.
My first attempt to solve this problem was to try and hack together a way to have mpv render frames off the UI thread and then send them to MpvWidget when they were done. I have no knowledge of graphics programming or OpenGL, so I found trying to figure out multithreading OpenGL rendering next to impossible. I was able to get Memento to not outright crash after following this StackOverflow post, but was unable to get mpv to render any frames. Rather, it just kept spitting out mpv_render_context_render() not being called or stuck
while returning 0 for every frame it was called.
Having given up on the widgets approach at that point, I changed the render to use QML/Quick instead, which was something I really didn't want to do. You can see the results of this on the qml branch. While this did show some improvement, it still did not work 100% of the time, which is something it needs to do if I want to be able to releases a macOS version.
Pausing mpv before entering fullscreen on macOS does seem to work, but since Qt events like window changes are asynchronous, it doesn't work 100% of the time, and works 0% of the time if the maximize button is used instead of keystrokes.
At this point, I'm at a loss for what to do. If there's anyone with good ideas or any motivation to fix this, please leave a comment. I'd like to figure it out as well.
from memento.
I was able to solve the freezing problem by creating an Objective-C++ class that monitors the NSNotification for entering and exiting fullscreen and pausing mpv from there. It seems to have a 100% success rate. While it would be nice to have mutltithreaded rendering, it's no longer necessary.
from memento.
There are no longer substantial bugs present in the macOS port.
from memento.
Related Issues (20)
- Error adding term Operation canceled HOT 12
- Subtitle search only works when media is paused HOT 3
- [Feature request] Export only lowest frequency value HOT 1
- Memento fills empty fields with html HOT 1
- Play audio doesn't work HOT 1
- Can't open on MAC M3 Arm HOT 5
- what settings are needed for YouTube links to work? HOT 4
- Kanji Stroke Order font HOT 1
- [Feature Request] Glossary Selection Marker HOT 12
- [Feature Request] Subtitle Delay HOT 3
- MeCab UniDic support HOT 3
- QT6 migration causes subtitle position to shift when on screen controller is shown/hidden HOT 1
- Lack of Styling on Anki Cards Added via Memento HOT 4
- jp mining note support HOT 2
- Setting secondary_sub_visibility to 'auto' within the mpvacious plugin does not work HOT 2
- Any configuration guide? HOT 1
- Jellyfin mpv shim? HOT 1
- Video does not play HOT 3
- Improve popup dictionary styling HOT 3
- Partially visible video when using display scaling HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memento.