Forward Android frame mute through the native capture bridge

This commit is contained in:
evgeny committed 2026-10-26 17:14:18 +01:00
1 parent f83e27260d
commit bdaff406be
2 files changed
+8 -5

No files matched your search

@@ -1645,8 +1645,9 @@ int utun_bridge_call_audio_start(uint64_t call_id) {
return call_audio_start(call_id);
}
int utun_bridge_call_audio_feed(uint64_t call_id, const int16_t* pcm, int count, int64_t capture_pts_us) {
return call_audio_feed_pcm(call_id, pcm, count, capture_pts_us);
/* Сохранить настоящий микрофон для AEC/AGC; mute зануляет только результат перед Opus. */
int utun_bridge_call_audio_feed(uint64_t call_id, const int16_t* pcm, int count, int muted, int64_t capture_pts_us) {
return call_audio_feed_pcm_muted(call_id, pcm, count, muted, capture_pts_us);
}
void utun_bridge_call_audio_stop(void) {
@@ -2871,7 +2872,7 @@ JNIEXPORT jboolean JNICALL Java_com_utun_chat_data_NativeLib_nativeCallAudioStar
}
JNIEXPORT jboolean JNICALL Java_com_utun_chat_data_NativeLib_nativeCallAudioFeed(
JNIEnv* env, jobject thiz, jlong callId, jshortArray samples, jlong capturePtsUs) {
JNIEnv* env, jobject thiz, jlong callId, jshortArray samples, jboolean muted, jlong capturePtsUs) {
(void)thiz;
if (!samples) {
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "call capture: null PCM");
@@ -2883,7 +2884,7 @@ JNIEXPORT jboolean JNICALL Java_com_utun_chat_data_NativeLib_nativeCallAudioFeed
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "call capture: JNI PCM access failed");
return JNI_FALSE;
}
int rc = utun_bridge_call_audio_feed((uint64_t)callId, (const int16_t*)data, (int)len, capturePtsUs);
int rc = utun_bridge_call_audio_feed((uint64_t)callId, (const int16_t*)data, (int)len, muted != JNI_FALSE, capturePtsUs);
(*env)->ReleaseShortArrayElements(env, samples, data, JNI_ABORT);
return (rc == 0) ? JNI_TRUE : JNI_FALSE;
}
@@ -124,7 +124,9 @@ int utun_bridge_call_is_online(const char* ch_id, uint64_t peer_node_id);
/* Аудио-движок звонка (call_audio.c, единый голосовой стек): PCM из AudioRecord →
* Opus → peer (feed); принятый Opus → джиттер+декод+stretch → PCM (pull). */
int utun_bridge_call_audio_start(uint64_t call_id);
int utun_bridge_call_audio_feed(uint64_t call_id, const int16_t* pcm, int count, int64_t capture_pts_us);
/* Capture worker: настоящий raw PCM, ровно960 mono-сэмплов @48кГц; muted!=0 применяется после AEC/AGC.
* capture_pts_us — монотонная метка первого сэмпла либо INT64_MIN. 0 = поставлено в uasync, -1 = отказ/ошибка. */
int utun_bridge_call_audio_feed(uint64_t call_id, const int16_t* pcm, int count, int muted, int64_t capture_pts_us);
int utun_bridge_call_audio_pull(uint64_t call_id, int16_t* out, int max_samples);
void utun_bridge_call_audio_stop(void);