Files
TTSTDConnect/flutter_sender/windows/runner/CMakeLists.txt
T
tongtong 37b2cff82b feat: 打通音频整链,被控端送 PCM、主控端 waveOut 播放
- android_receiver:音频改为直接送 PCM16(FLAG_PCM=0x80),不再走 Opus 编码
  (仓库未打包 libopus,MediaCodec Opus 多数设备不可用,主控端也无解码器)
- rust_core:新增 media/audio 播放队列(上限 1 秒、按帧对齐切分、超出丢最旧)
- rust_core:音频分片校验 MAC 后按 FLAG_PCM 入队,旧 Opus 包明确丢弃并记日志
- rust_core:新增 ttstd_audio_next / ttstd_audio_pending / ttstd_audio_stats
- flutter_sender:新增 audio_player(waveOut)轮询播放队列,有数据才打开设备、静音 3 秒自动关闭
- docs:README 增加音频链路章节与 PCM 取舍,AGENTS 记录 FLAG_PCM 约定
2026-11-27 21:15:17 +08:00

65 lines
2.9 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
cmake_minimum_required(VERSION 3.14)
project(runner LANGUAGES CXX)
# Define the application target. To change its name, change BINARY_NAME in the
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
# work.
#
# Any new source files that you add to the application should be added here.
add_executable(${BINARY_NAME} WIN32
"audio_player.cpp"
"flutter_window.cpp"
"main.cpp"
"utils.cpp"
"video_texture.cpp"
"video_window.cpp"
"win32_window.cpp"
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
"Runner.rc"
"runner.exe.manifest"
)
# Apply the standard set of build settings. This can be removed for applications
# that need different build settings.
apply_standard_settings(${BINARY_NAME})
# 源码为 UTF-8(含中文注释与提示),避免默认代码页导致的 C4819 警告被 /WX 转成错误。
target_compile_options(${BINARY_NAME} PRIVATE "/utf-8")
# Add preprocessor definitions for the build version.
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
# Disable Windows macros that collide with C++ standard library functions.
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
# Add dependency libraries and include directories. Add any application-specific
# dependencies here.
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
# 内嵌的首个插件(视频纹理)需要 plugin 版 wrapper 的 PluginRegistrar/MethodChannel 实现。
target_link_libraries(${BINARY_NAME} PRIVATE flutter_wrapper_plugin)
target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
# Media Foundation:H.264/HEVC 解码到 Flutter 外部纹理。
target_link_libraries(${BINARY_NAME} PRIVATE "mfplat.lib" "mfuuid.lib" "mf.lib" "ole32.lib")
# 音频播放:waveOut 输出 Rust Core 队列里的 PCM。
target_link_libraries(${BINARY_NAME} PRIVATE "winmm.lib")
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
# Run the Flutter tool portions of the build. This must not be removed.
add_dependencies(${BINARY_NAME} flutter_assemble)
# 把 Rust Core cdylib 复制到可执行文件目录,供 dart:ffi 与视频解码插件加载。
set(TTSTD_CORE_DLL
"${CMAKE_CURRENT_SOURCE_DIR}/../../../rust_core/target/release/ttstdconnect_core.dll")
if(EXISTS "${TTSTD_CORE_DLL}")
add_custom_command(TARGET ${BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${TTSTD_CORE_DLL}"
"$<TARGET_FILE_DIR:${BINARY_NAME}>/ttstdconnect_core.dll"
COMMENT "Copying ttstdconnect_core.dll"
)
endif()