-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[RFC] modular driver support #11145
base: master
Are you sure you want to change the base?
[RFC] modular driver support #11145
Conversation
I think this can be reviewed. |
Changes in current version:
|
Logging now works, too. |
0ed8a82
to
3133aef
Compare
@philipl maybe you are interested in taking a look at this? If not feel free to ignore. |
I think this broke when combined with #11216. The ao modules won't load due to missing symbols. I guess it's because of the default hidden visibility of the symbols. You'd need to export more symbols from the lib, or handle them in some other way to make them accessible to modules without being visible from libmpv. |
That would be preferred. Worst case scenario, we would just have to build these files twice again (once for libmpv and again for cplayer). |
There will probably be handful of files that need to be compiled with different symbol visibility, so it will still allow most of the files to benefit from being compiled once. |
I also want this feature to work in libmpv, so one compilation should still be possible. Also if mpv consists of multiple libraries anyways (because of the modules) it wouldn't make a difference to ship cplayer as just another client of libmpv. |
Ok. Then can you update this PR to export the necessary symbols from libmpv so we can see what it looks like in practice? Thanks. |
I am trying to think of something better. Manually having to export random parts of the internals sounds like a nightmare to maintain. |
What about this: libmpv.so becomes libmpvcore.so and exports all symbols. A new shim libmpv.so is added that loads libmpvcore.so via This gives us:
Disadvantages:
|
Would it be easier to build the executable first and extract the objects from there to build libmpv? |
Then all the symbols would be exported to users of libmpv. Also I think there would be issues with PIE/PIC. |
Shouldn't the |
The problem is that we need both at the same time: no internal symbols exported to users of libmpv; (all) internal symbols exported to the modules. (let's focus on libmpv for now, cplayer is easy) |
The new version introduces the proposed shim library. |
b6cccb1
to
f75e2ec
Compare
The aproach with Doing Back to the drawing board. |
49b9088
to
f4269fa
Compare
This implements modular drivers. These allow shipping a binary mpv package that provides all drivers but does not require them to be installed.
The commits are split logically for easier review.
Limitations:
osdep/module-posix.c
seems not to workFixes #11138