Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20)
# macOS: the oldest release the library loads on. Without it the build machine's SDK version is used.
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0" CACHE STRING "Minimum macOS version")
project(ModAVDExtras VERSION 0.3.0 LANGUAGES C)
project(ModAVDExtras VERSION 0.3.1 LANGUAGES C)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
Expand Down
4 changes: 4 additions & 0 deletions release/0.3.1.SHA256SUMS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2ca4031b57ab1cb17128ed472bf8b49ce65a9c6453f29fe37473a6d8b60a9cb6 external_renderer_ipc.dll
9950a940a726559da079bb7b97a0d8c6e3fc1d77a30489cae52b3e87513a4e61 libmodavd_extras.dylib
b19a24eedea6949f2c081a20c92c474ceb3b3269e08b241c677588fbb2e10918 libmodavd_extras.so
2d9104bf0795722a9ee94e7136721c836f71b0d20ba93ed21297e98ffcfc8ab7 modavd_extras.dll
51 changes: 51 additions & 0 deletions release/0.3.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ModAVDExtras v0.3.1

- `modavd_extras.dll`:`2d9104bf0795722a9ee94e7136721c836f71b0d20ba93ed21297e98ffcfc8ab7`
- `external_renderer_ipc.dll`:`2ca4031b57ab1cb17128ed472bf8b49ce65a9c6453f29fe37473a6d8b60a9cb6`
- `libmodavd_extras.dylib`:`9950a940a726559da079bb7b97a0d8c6e3fc1d77a30489cae52b3e87513a4e61`
- `libmodavd_extras.so`:`b19a24eedea6949f2c081a20c92c474ceb3b3269e08b241c677588fbb2e10918`

这一版修复 Windows 上模拟器退出后截图共享内存不放的问题(ModAVD/ModAVD#210)。没有新增函数,接口版本还是 3;只是 `modavd_open`、`modavd_capture` 在 Windows 上多了几种返回 `MODAVD_E_NOT_FOUND` 的情况。

## 变更

- Windows:模拟器退出后放掉截图共享内存,同一端口的下一台模拟器起来时自己重新映射(#22)。
- 以前句柄一直映射着旧的那块,模拟器退出了也不放;同一端口的下一台(比如改成 1080p 后)再建共享内存时,拿回来的还是旧的、更小的那块,映射失败,截图共享就开不起来。
- 打开时找出监听控制台端口的进程(就是模拟器),等它退出时关掉映射。
- `modavd_capture` 遇到映射已经没了,最多每秒试一次映射当前这台模拟器的共享内存,没有就返回 `MODAVD_E_NOT_FOUND`,过一会儿再调就行,句柄会自己映射下一台的。
- `modavd_open` 普通打开时,共享内存在、控制台端口却没人监听,说明是别的程序留着的旧的:不映射,返回 `MODAVD_E_NOT_FOUND`。带 `MODAVD_OPEN_NO_START` 的照旧信任现有映射。
- MuMu 形状的外壳 `external_renderer_ipc.dll` 走同一条抓图路径。
- `include/modavd_extras.h` 补上了上面这些返回值的说明。
- `modavd_version_string()` 返回 `"0.3.1"`。

## 说明

- 点击、按键、文字的行为没变;Linux、macOS 的代码没变。
- 两个 Windows DLL 的字节都变了:库的代码改了,外壳静态链接着它。

## 许可证与源码

- LGPL-3.0-or-later。正文是 tag 下的 [LICENSE](https://github.com/ModAVD/ModAVDExtras/blob/v0.3.1/LICENSE)(LGPL-3.0)和 [COPYING](https://github.com/ModAVD/ModAVDExtras/blob/v0.3.1/COPYING)(GPL-3.0);转发这些库时请一起带上。
- 源码:<https://github.com/ModAVD/ModAVDExtras/tree/v0.3.1>。

## 下载与核对

四个文件都由本仓库的 release workflow 在 GitHub 上编出,和 tag 下的 `release/0.3.1.SHA256SUMS.txt` 核对过才上传。编译环境和 v0.3.0 一样:

- Windows:`windows-2025`,`cmake -A x64`,`--config Release`。两个 DLL 都静态链接 C 运行库,只依赖 `KERNEL32`、`WS2_32`,编译带 `/Brepro`。
- macOS:`macos-15`(Apple Silicon),`cmake -DCMAKE_BUILD_TYPE=Release`。
- Linux:`ubuntu-24.04`(x64),`cmake -DCMAKE_BUILD_TYPE=Release`。

请用附件 `SHA256SUMS.txt` 核对:Windows 上 `Get-FileHash .\modavd_extras.dll -Algorithm SHA256`,macOS 上 `shasum -a 256 libmodavd_extras.dylib`,Linux 上 `sha256sum libmodavd_extras.so`。

## English

This release fixes the screenshot shared memory not being released on Windows after the emulator exits (ModAVD/ModAVD#210). No functions were added and the API version is still 3; `modavd_open` and `modavd_capture` just return `MODAVD_E_NOT_FOUND` in a few more cases on Windows.

- Windows: the mapping is released when the emulator exits, and the next emulator on the same port is mapped by the handle itself (#22). Before, the handle kept the old region mapped; the next emulator on the port (for example after switching to 1080p) got the old, smaller region back and the mapping failed, so frame sharing could not start.
- The handle finds the process listening on the console port (the emulator) and closes the mapping when it exits. If the mapping is gone, `modavd_capture` tries to map the current emulator's region at most once a second and returns `MODAVD_E_NOT_FOUND` while there is none; call again later.
- A plain `modavd_open` with a region present but nothing listening on the console port treats the region as left over by another program: it does not map it and returns `MODAVD_E_NOT_FOUND`. With `MODAVD_OPEN_NO_START` the existing mapping is trusted as before.
- The MuMu-shaped shim `external_renderer_ipc.dll` uses the same capture path. `include/modavd_extras.h` documents the return values. `modavd_version_string()` returns `"0.3.1"`.
- Touch, keys and text behave as before; the Linux and macOS code is unchanged. Both Windows DLLs differ from v0.3.0.
- License: LGPL-3.0-or-later; the texts are [LICENSE](https://github.com/ModAVD/ModAVDExtras/blob/v0.3.1/LICENSE) (LGPL-3.0) and [COPYING](https://github.com/ModAVD/ModAVDExtras/blob/v0.3.1/COPYING) (GPL-3.0) at the tag. Ship them with the libraries. Source: <https://github.com/ModAVD/ModAVDExtras/tree/v0.3.1>.
- All four files are built by this repository's release workflow on GitHub, the same way as v0.3.0, and checked against `release/0.3.1.SHA256SUMS.txt` at the tag before upload. Check them with the attached `SHA256SUMS.txt`.
Loading