fix: auto codec, force-ping button, relay delete button
1. Auto codec: new "Auto" position on quality slider (JNI index 7). When selected, the engine uses the relay's chosen_profile from CallAnswer instead of the local preference. Slider now has 8 positions: Studio 64k → Auto → Codec2 1.2k. 2. Force ping: added refresh button (↻) in Manage Relays dialog header. Calls pingAllServers() to re-check all relays on demand. 3. Delete relay fix: the X button was inside a Surface(onClick=...) which swallowed the touch event. Replaced with a separate Surface that properly intercepts the click. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,9 @@ unsafe fn handle_ref(handle: jlong) -> &'static mut EngineHandle {
|
||||
unsafe { &mut *(handle as *mut EngineHandle) }
|
||||
}
|
||||
|
||||
/// 7 = auto (use relay's chosen profile)
|
||||
const PROFILE_AUTO: jint = 7;
|
||||
|
||||
fn profile_from_int(value: jint) -> QualityProfile {
|
||||
match value {
|
||||
0 => QualityProfile::GOOD, // Opus 24k
|
||||
@@ -35,7 +38,7 @@ fn profile_from_int(value: jint) -> QualityProfile {
|
||||
4 => QualityProfile::STUDIO_32K, // Opus 32k
|
||||
5 => QualityProfile::STUDIO_48K, // Opus 48k
|
||||
6 => QualityProfile::STUDIO_64K, // Opus 64k
|
||||
_ => QualityProfile::GOOD,
|
||||
_ => QualityProfile::GOOD, // auto falls back to GOOD
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,6 +125,7 @@ pub unsafe extern "system" fn Java_com_wzp_engine_WzpEngine_nativeStartCall(
|
||||
|
||||
let config = CallStartConfig {
|
||||
profile: profile_from_int(profile_j),
|
||||
auto_profile: profile_j == PROFILE_AUTO,
|
||||
relay_addr,
|
||||
room,
|
||||
auth_token: if token.is_empty() { Vec::new() } else { token.into_bytes() },
|
||||
|
||||
Reference in New Issue
Block a user