-
Notifications
You must be signed in to change notification settings - Fork 52
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
[WIP] use libvlc android #793
base: main
Are you sure you want to change the base?
Conversation
chivehao
commented
Aug 20, 2024
•
edited
Loading
edited
- EXO播放器需要替换为VLC,EXO不支持播放HiP格式的资源 #791
Signed-off-by: chivehao <chivehao@ikaros.run>
Signed-off-by: chivehao <chivehao@ikaros.run>
这可以解决一堆问题 |
要不要考虑用4.0?已知最新的3在macos的aarch64上是不支持任何字幕的 |
我觉得,可以考虑保留旧的实现(一段时间),因为新播放器放出去测试很可能会出问题,最好是要能设置里直接切回exo。 不过目前可以先看看情况,如果3.x.0-alpha01 带上新播放器后发现有人有严重问题,届时再增加切回旧播放器 |
这个是libvlc android的,mac上估计没法跑,mac上大概也许还得是使用vlcj才行
我试试能不能通过设置切换播放器内核,android only |
Signed-off-by: chivehao <chivehao@ikaros.run>
Signed-off-by: chivehao <chivehao@ikaros.run>
切换的配置加了,但是目前没做对应的逻辑,我先注释了 |
Signed-off-by: chivehao <chivehao@ikaros.run>
Signed-off-by: chivehao <chivehao@ikaros.run>
话说感觉还有一个办法,播放时开个本地 http 服务器供 VLC 连接,就可以对接 bt |
这个感觉更麻烦,一个正常的视频播放,多了好多步骤,个人不推荐这样整 |
這裡的進度到哪了😶 |
之前就停了已经 |
我建议是用 swig, 直接基于 libvlc 写. 必要的时候跟 anitorrent 一样, 写 C++ 直接基于 libvlc 适配. 官方的那个 libvlcjni 构建系统太老了, 它脚本甚至看起来只支持 Ubuntu. 要把它的那套弄出来很难 |
https://code.videolan.org/videolan/libvlcpp https://code.videolan.org/videolan/libvlcpp/-/blob/master/vlcpp/Media.hpp?ref_type=heads VLC 官方有 C++ binding, 写起来应该是会比 C 舒服的. 所以我觉得跟 anitorrent 一样用 C++ 写比较好. 有关如何渲染, 可以参考 libvlcjni 是怎么实现的 |
诶, 不过很有意思的是, VLCJ 的 binding 是独立的 https://github.com/caprica/vlcj-natives, 它看起来非常有可能能直接用, 也就不用自己构建. 但仍然需要调研渲染如何实现. 安卓性能敏感, 需要高渲染效率. 不知道跟 PC 一样用 Canvas 是否可行. 自己构建 C++ 的主要问题就是在 Windows 实在太复杂, macOS 倒是 brew install 就好了. 不过也可以保留 ExoPlayer 引擎, 这样 PR 时可以使用 ExoPlayer 测试. |
给后来人: 简单来说就是我们要给安卓换 VLC. VLC 是 C 写的, 但是 VLC 官方提供 C++ header-only binding, 也就是我们既可以使用 C 也可以使用 C++. 要在 Kotlin 使用 C/C++, 通俗来讲有 JNI/JNA/SWIG 三种方法. SWIG 应该是最现代的方式 (而且 anitorrent 成功使用 SWIG 跑通了, 而且没什么坑). 因此我们只考虑 SWIG. SWIG 是读取 一是直接使用 SWIG 为 libvlc 生成 Java binding, 相当于 Kotlin 直接使用 libvlc. 考虑到我们需要高性能视频解码/渲染, 用这种方式可能更复杂. 因此我建议使用跟 anitorrent 一样的方式 - 自己用 C++ 写一个中间件调用 libvlc, 提供简单的直接符合 Kotlin 侧需求的 C++ 接口. SWIG 为这个中间件生成 binding, 然后由 Kotlin 调用. |
我可能要 3.12 才有可能有时间来做这个 |