feat: 接入端到端 demo 与签名变体
- Flutter 桌面端通过 dart:ffi 调用 Rust Core cdylib - 实现 ECDH P-256 密钥协商、HKDF 子密钥派生、AES-256-GCM 控制帧 - Android 被控端用派生密钥做控制帧加密与媒体包 MAC - 新增 libopus JNI 骨架,默认回退 MediaCodec - 新增 aosp/zhanxun/neutral 签名变体与系统 sharedUserId - 本机独立信令服务与设置页开关 - 新增 .gitignore 排除所有编译产物与打包目录
This commit is contained in:
commit
31b9a52eb4
154 files changed
+13287
No files matched your search
@@ -0,0 +1,12 @@
|
||||
cmake_minimum_required(VERSION 3.22.1)
|
||||
project(ttstd_opus)
|
||||
|
||||
add_library(ttstd_opus SHARED opus_jni.cpp)
|
||||
|
||||
find_library(log-lib log)
|
||||
target_link_libraries(ttstd_opus ${log-lib})
|
||||
|
||||
# TODO(libopus): 将 opus 源码加入后,取消下面注释并启用 native 编码:
|
||||
# add_subdirectory(opus)
|
||||
# target_link_libraries(ttstd_opus opus)
|
||||
# 同时把 opus_jni.cpp 中的 OPUS_NATIVE_AVAILABLE 改为 1。
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <jni.h>
|
||||
#include <android/log.h>
|
||||
|
||||
// 接入 libopus 源码后改为 1,Kotlin 侧会自动切换到 native 编码器。
|
||||
#define OPUS_NATIVE_AVAILABLE 0
|
||||
|
||||
extern "C" JNIEXPORT jboolean JNICALL
|
||||
Java_com_ttstd_lancast_receiver_encode_OpusNative_isAvailable(JNIEnv*, jclass) {
|
||||
return OPUS_NATIVE_AVAILABLE == 1 ? JNI_TRUE : JNI_FALSE;
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jlong JNICALL
|
||||
Java_com_ttstd_lancast_receiver_encode_OpusNative_createEncoder(
|
||||
JNIEnv*, jclass, jint, jint, jint) {
|
||||
if (OPUS_NATIVE_AVAILABLE != 1) return 0;
|
||||
// TODO(libopus): return reinterpret_cast<jlong>(opus_encoder_create(...));
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_ttstd_lancast_receiver_encode_OpusNative_destroyEncoder(JNIEnv*, jclass, jlong) {
|
||||
// TODO(libopus): opus_encoder_destroy(reinterpret_cast<OpusEncoder*>(handle));
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jobjectArray JNICALL
|
||||
Java_com_ttstd_lancast_receiver_encode_OpusNative_encode(
|
||||
JNIEnv* env, jclass, jlong, jbyteArray) {
|
||||
if (OPUS_NATIVE_AVAILABLE != 1) return nullptr;
|
||||
// TODO(libopus): 调用 opus_encode 生成 OPUS 包并返回 ByteArray 数组。
|
||||
return env->NewObjectArray(0, env->FindClass("[B"), nullptr);
|
||||
}
|
||||
Reference in new issue
Block a user