Browse Source

Expose remote video decoder acceptance to Android workers

stream-multiview
evgeny 1 week ago
parent
commit
8703e2678a
  1. 1
      tools/chatgui-android/app/src/main/java/com/utun/chat/data/CallVideoNative.kt
  2. 7
      tools/chatgui-android/jni_bridge/android_call_video_jni.c

1
tools/chatgui-android/app/src/main/java/com/utun/chat/data/CallVideoNative.kt

@ -17,6 +17,7 @@ internal object CallVideoNative {
external fun inspect(codec: Int, bytes: ByteArray): LongArray?
external fun probeKey(codec: Int, profile: Int): ByteArray?
external fun supported(local: ByteArray, peer: ByteArray, format: LongArray): Boolean
external fun decoded(id: Long, generation: Long, accepted: Boolean)
}
internal data class CallVideoFormat(val generation: Long, val width: Int, val height: Int, val fps: Int = 30,

7
tools/chatgui-android/jni_bridge/android_call_video_jni.c

@ -46,8 +46,8 @@ JNIEXPORT jlongArray JNICALL Java_com_utun_chat_data_CallVideoNative_status(JNIE
(void)o; struct call_video_port_status s;
if (call_video_port_status(id, &s)) return NULL;
jlong values[] = {s.key_serial, s.rate_generation, s.rate_request, s.rate_bps, s.configured_generation,
s.error, s.minimum_bps, s.maximum_bps};
jlongArray out = (*e)->NewLongArray(e, 8); if (out) (*e)->SetLongArrayRegion(e, out, 0, 8, values); return out;
s.error, s.minimum_bps, s.maximum_bps, s.decoded_generation, s.decoded_accepted};
jlongArray out = (*e)->NewLongArray(e, 10); if (out) (*e)->SetLongArrayRegion(e, out, 0, 10, values); return out;
}
JNIEXPORT jlongArray JNICALL Java_com_utun_chat_data_CallVideoNative_choose(
JNIEnv *e, jobject o, jbyteArray local, jbyteArray remote, jlongArray desired) {
@ -97,6 +97,9 @@ JNIEXPORT void JNICALL Java_com_utun_chat_data_CallVideoNative_requestKey(JNIEnv
JNIEXPORT jboolean JNICALL Java_com_utun_chat_data_CallVideoNative_range(JNIEnv *e, jobject o, jlong id, jint minimum, jint maximum) {
(void)e; (void)o; return !call_video_port_range(id, minimum, maximum);
}
JNIEXPORT void JNICALL Java_com_utun_chat_data_CallVideoNative_decoded(JNIEnv *e, jobject o, jlong id, jlong generation, jboolean accepted) {
(void)e; (void)o; call_video_port_decoded(id, generation, accepted);
}
JNIEXPORT jlongArray JNICALL Java_com_utun_chat_data_CallVideoNative_inspect(JNIEnv *e, jobject o, jint codec, jbyteArray bytes) {
(void)o;
if (!bytes) return NULL;

Loading…
Cancel
Save