diff --git a/resources/common/ffmpeg_av_jni.dll b/resources/common/ffmpeg_av_jni.dll index 272932e2..c6b36b2b 100755 Binary files a/resources/common/ffmpeg_av_jni.dll and b/resources/common/ffmpeg_av_jni.dll differ diff --git a/resources/common/libffmpeg_av_jni.jnilib b/resources/common/libffmpeg_av_jni.jnilib index 2e2d8d17..ec6f39cc 100644 Binary files a/resources/common/libffmpeg_av_jni.jnilib and b/resources/common/libffmpeg_av_jni.jnilib differ diff --git a/resources/common/libffmpeg_av_jni.so b/resources/common/libffmpeg_av_jni.so index 7966fe6d..cabd1f6b 100755 Binary files a/resources/common/libffmpeg_av_jni.so and b/resources/common/libffmpeg_av_jni.so differ diff --git a/resources/common/libffmpeg_av_jni.so__ASAN b/resources/common/libffmpeg_av_jni.so__ASAN index 93ac3291..3fe0ae2c 100755 Binary files a/resources/common/libffmpeg_av_jni.so__ASAN and b/resources/common/libffmpeg_av_jni.so__ASAN differ diff --git a/resources/common/libffmpeg_av_jni_arm64.jnilib b/resources/common/libffmpeg_av_jni_arm64.jnilib index 5a0f5160..fbaad2ec 100755 Binary files a/resources/common/libffmpeg_av_jni_arm64.jnilib and b/resources/common/libffmpeg_av_jni_arm64.jnilib differ diff --git a/resources/common/libffmpeg_av_jni_raspi.so b/resources/common/libffmpeg_av_jni_raspi.so index 192cc765..c2c65f1c 100755 Binary files a/resources/common/libffmpeg_av_jni_raspi.so and b/resources/common/libffmpeg_av_jni_raspi.so differ diff --git a/resources/common/libjni_notifications.jnilib b/resources/common/libjni_notifications.jnilib index f5a33b72..987276ee 100644 Binary files a/resources/common/libjni_notifications.jnilib and b/resources/common/libjni_notifications.jnilib differ diff --git a/resources/common/libjni_notifications_arm64.jnilib b/resources/common/libjni_notifications_arm64.jnilib index 17d92ea5..04215acf 100755 Binary files a/resources/common/libjni_notifications_arm64.jnilib and b/resources/common/libjni_notifications_arm64.jnilib differ diff --git a/src/main/java/com/zoffcc/applications/ffmpegav/AVActivity.java b/src/main/java/com/zoffcc/applications/ffmpegav/AVActivity.java index eca45e01..ef5e0abb 100644 --- a/src/main/java/com/zoffcc/applications/ffmpegav/AVActivity.java +++ b/src/main/java/com/zoffcc/applications/ffmpegav/AVActivity.java @@ -2,11 +2,12 @@ import javax.sound.sampled.*; import java.nio.ByteBuffer; +import java.util.Random; public class AVActivity { private static final String TAG = "ffmpegav.AVActivity"; - static final String Version = "0.99.23"; + static final String Version = "0.99.24"; public static final String JAVA_AUDIO_IN_DEVICE_NAME = "Java Audio in (-fallback-)"; private static boolean java_audio_in_device_used = false; @@ -42,6 +43,8 @@ public class AVActivity { private final static int AUDIO_REC_CHANNELS = 1; private final static int AUDIO_REC_SAMPLE_SIZE_BIT = 16; + private static boolean mult_thr_test_finish = false; + public static class ffmpegav_descrid { public String description; @@ -275,7 +278,7 @@ private static void ffmpegav_start_java_audio_in_capture() try { if (t_audio_rec != null) { - t_audio_rec.join(1000); + t_audio_rec.join(1000); } } catch (Exception ignored) { } finally { @@ -762,8 +765,8 @@ public static void main(String[] args) { @Override public void onSuccess(long width, long height, long source_width, long source_height, long pts, int fps, int source_format) { Log.i(TAG, "ffmpeg open video capture onSuccess:" + width + " " + height + " " + - source_width + " " + source_height + " " + pts + " fps: " + fps + - " source_format: " + ffmpegav_video_source_format_name.value_str(source_format)); + source_width + " " + source_height + " " + pts + " fps: " + fps + + " source_format: " + ffmpegav_video_source_format_name.value_str(source_format)); } @Override public void onError() { @@ -771,7 +774,7 @@ public void onError() { @Override public void onBufferTooSmall(int y_buffer_size, int u_buffer_size, int v_buffer_size) { Log.i(TAG, "Video buffer too small, needed sizes: " + y_buffer_size - + " " + u_buffer_size + " "+ v_buffer_size); + + " " + u_buffer_size + " "+ v_buffer_size); ffmpegav_video_buffer_2_y = java.nio.ByteBuffer.allocateDirect(y_buffer_size); ffmpegav_video_buffer_2_u = java.nio.ByteBuffer.allocateDirect(u_buffer_size); ffmpegav_video_buffer_2_v = java.nio.ByteBuffer.allocateDirect(v_buffer_size); @@ -851,11 +854,11 @@ public void onBufferTooSmall(int audio_buffer_size) { // ----------------------- // ----------------------- final int res_vd2 = ffmpegav_open_video_in_device(vdevice, - vsource, 640, 480, 15, 0); + vsource, 640, 480, 15, 0); Log.i(TAG, "ffmpeg open video capture device: " + res_vd2); final int res_ad2 = ffmpegav_open_audio_in_device_wrapper(adevice, - asource); + asource); Log.i(TAG, "ffmpeg open audio capture device: " + res_ad2); ffmpegav_start_video_in_capture(); ffmpegav_start_audio_in_capture_wrapper(); @@ -905,6 +908,231 @@ public void onBufferTooSmall(int audio_buffer_size) { Log.i(TAG, "ffmpeg ========= all OK ========="); Log.i(TAG, "ffmpeg ========= all OK ========="); + + Log.i(TAG, "ffmpeg ========= multi thread test START ========="); + final String vdevice_ = vdevice; + final String vsource_ = vsource; + final String adevice_ = adevice; + final String asource_ = asource; + mult_thr_test_finish = false; + + Thread t1 = new Thread() { + @Override + public void run() { + Random r = new Random(); + while (!mult_thr_test_finish) { + try + { + Log.i(TAG, "T1: ffmpeg open video capture device:start"); + final int res_vd2 = ffmpegav_open_video_in_device(vdevice_, + vsource_, 640, 480, 15, 0); + Log.i(TAG, "T1: ffmpeg open video capture device:done"); + int low = 10; + int high = 80; + int result = r.nextInt(high-low) + low; + Thread.sleep(result); + Log.i(TAG, "T1: ffmpeg close video capture device:start"); + ffmpegav_close_video_in_device(); + Log.i(TAG, "T1: ffmpeg close video capture device:done"); + } + catch(Exception e) {} + } + } + }; + Thread t2 = new Thread() { + @Override + public void run() { + Random r = new Random(); + while (!mult_thr_test_finish) { + try + { + Log.i(TAG, "T2: ffmpeg open audio capture device:start"); + final int res_ad2 = ffmpegav_open_audio_in_device_wrapper(adevice_, asource_); + Log.i(TAG, "T2: ffmpeg open audio capture device:done"); + int low = 10; + int high = 80; + int result = r.nextInt(high-low) + low; + Thread.sleep(result); + Log.i(TAG, "T2: ffmpeg close audio capture device:start"); + ffmpegav_close_audio_in_device_wrapper(); + Log.i(TAG, "T2: ffmpeg close audio capture device:done"); + } + catch(Exception e) {} + } + } + }; + Thread t3 = new Thread() { + @Override + public void run() { + Random r = new Random(); + while (!mult_thr_test_finish) { + try + { + Log.i(TAG, "T3: ffmpeg open video capture device:start"); + final int res_vd2 = ffmpegav_open_video_in_device(vdevice_, + vsource_, 640, 480, 15, 0); + Log.i(TAG, "T3: ffmpeg open video capture device:done"); + int low = 10; + int high = 80; + int result = r.nextInt(high-low) + low; + Thread.sleep(result); + Log.i(TAG, "T3: ffmpeg close video capture device:start"); + ffmpegav_close_video_in_device(); + Log.i(TAG, "T3: ffmpeg close video capture device:done"); + } + catch(Exception e) {} + } + } + }; + Thread t4 = new Thread() { + @Override + public void run() { + Random r = new Random(); + while (!mult_thr_test_finish) { + try + { + Log.i(TAG, "T4: ffmpeg open audio capture device:start"); + final int res_ad2 = ffmpegav_open_audio_in_device_wrapper(adevice_, asource_); + Log.i(TAG, "T4: ffmpeg open audio capture device:done"); + int low = 10; + int high = 80; + int result = r.nextInt(high-low) + low; + Thread.sleep(result); + Log.i(TAG, "T4: ffmpeg close audio capture device:start"); + ffmpegav_close_audio_in_device_wrapper(); + Log.i(TAG, "T4: ffmpeg close audio capture device:done"); + } + catch(Exception e) {} + } + } + }; + Thread t5 = new Thread() { + @Override + public void run() { + Random r = new Random(); + while (!mult_thr_test_finish) { + try + { + Log.i(TAG, "T5: ffmpeg start video capture: start"); + ffmpegav_start_video_in_capture(); + Log.i(TAG, "T5: ffmpeg start video capture: done"); + int low = 10; + int high = 80; + int result = r.nextInt(high-low) + low; + Thread.sleep(result); + Log.i(TAG, "T5: ffmpeg stop video capture: start"); + ffmpegav_stop_video_in_capture(); + Log.i(TAG, "T5: ffmpeg stop video capture: done"); + } + catch(Exception e) {} + } + } + }; + Thread t6 = new Thread() { + @Override + public void run() { + Random r = new Random(); + while (!mult_thr_test_finish) { + try + { + Log.i(TAG, "T6: ffmpeg start audio capture: start"); + ffmpegav_start_audio_in_capture_wrapper(); + Log.i(TAG, "T6: ffmpeg start audio capture: done"); + int low = 10; + int high = 80; + int result = r.nextInt(high-low) + low; + Thread.sleep(result); + Log.i(TAG, "T6: ffmpeg stop audio capture: start"); + ffmpegav_stop_audio_in_capture_wrapper(); + Log.i(TAG, "T6: ffmpeg stop audio capture: done"); + } + catch(Exception e) {} + } + } + }; + Thread t7 = new Thread() { + @Override + public void run() { + Random r = new Random(); + while (!mult_thr_test_finish) { + try + { + Log.i(TAG, "T7: ffmpeg start video capture: start"); + ffmpegav_start_video_in_capture(); + Log.i(TAG, "T7: ffmpeg start video capture: done"); + int low = 10; + int high = 80; + int result = r.nextInt(high-low) + low; + Thread.sleep(result); + Log.i(TAG, "T7: ffmpeg stop video capture: start"); + ffmpegav_stop_video_in_capture(); + Log.i(TAG, "T7: ffmpeg stop video capture: done"); + } + catch(Exception e) {} + } + } + }; + Thread t8 = new Thread() { + @Override + public void run() { + Random r = new Random(); + while (!mult_thr_test_finish) { + try + { + Log.i(TAG, "T8: ffmpeg start audio capture: start"); + ffmpegav_start_audio_in_capture_wrapper(); + Log.i(TAG, "T8: ffmpeg start audio capture: done"); + int low = 10; + int high = 80; + int result = r.nextInt(high-low) + low; + Thread.sleep(result); + Log.i(TAG, "T8: ffmpeg stop audio capture: start"); + ffmpegav_stop_audio_in_capture_wrapper(); + Log.i(TAG, "T8: ffmpeg stop audio capture: done"); + } + catch(Exception e) {} + } + } + }; + Log.i(TAG, "ffmpeg ========= multi thread test RUN ==========="); + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t5.start(); + t6.start(); + t7.start(); + t8.start(); + try + { + Thread.sleep(100000); + } + catch(Exception e) + { + } + Log.i(TAG, "ffmpeg ========= multi thread test STOP =========="); + mult_thr_test_finish = true; + ffmpegav_stop_video_in_capture(); + ffmpegav_stop_audio_in_capture(); + try + { + t1.join(); + t2.join(); + t3.join(); + t4.join(); + t5.join(); + t6.join(); + t7.join(); + t8.join(); + } + catch(Exception e) + { + } + ffmpegav_stop_audio_in_capture_wrapper(); + ffmpegav_stop_video_in_capture(); + ffmpegav_close_audio_in_device_wrapper(); + ffmpegav_close_video_in_device(); + Log.i(TAG, "ffmpeg ========= multi thread test OK ============"); } public static String bytesToHex(byte[] bytes, int start, int len) diff --git a/src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt b/src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt index 28e92cc2..f89ebbdb 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt @@ -23,6 +23,7 @@ import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.material.icons.filled.ContentCopy import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -49,11 +50,14 @@ import com.zoffcc.applications.trifa.MainActivity.Companion.libavutil_version import com.zoffcc.applications.trifa.MainActivity.Companion.libopus_version import com.zoffcc.applications.trifa.MainActivity.Companion.libvpx_version import com.zoffcc.applications.trifa.MainActivity.Companion.libsodium_version +import com.zoffcc.applications.trifa.MainActivity.Companion.tox_group_get_number_groups import com.zoffcc.applications.trifa.MainActivity.Companion.tox_version_major import com.zoffcc.applications.trifa.MainActivity.Companion.tox_version_minor import com.zoffcc.applications.trifa.MainActivity.Companion.tox_version_patch import com.zoffcc.applications.trifa.MainActivity.Companion.x264_version +import com.zoffcc.applications.trifa.TrifaToxService.Companion.orma import com.zoffcc.applications.trifa_material.trifa_material.BuildConfig +import globalstore import org.briarproject.briar.desktop.utils.InternationalizationUtils.i18n import org.sqlite.SQLiteJDBCLoader @@ -111,6 +115,7 @@ private fun GeneralInfo() { // format date // val commitTime = Instant.ofEpochMilli(BuildData.GIT_TIME).atZone(ZoneId.systemDefault()).toLocalDateTime() + val global_store by globalstore.stateFlow.collectAsState() // rows displayed in table val lines = buildList { // add(Entry(i18n("about.copyright"), Strings.APP_AUTHORS)) @@ -129,6 +134,39 @@ private fun GeneralInfo() { add(Entry(i18n("about.git_commit_date"), BuildConfig.GIT_COMMIT_DATE)) add(Entry(i18n("about.git_commit_msg"), BuildConfig.GIT_COMMIT_MSG)) add(Entry(i18n("about.website"), "https://github.com/Zoxcore/trifa_material", true)) + if (global_store.ormaRunning) + { + try + { + add(Entry(i18n("about.number_of_friend_messages"), orma!!.selectFromMessage().count().toString())) + } catch (_: Exception) + { + } + try + { + add(Entry(i18n("about.number_of_group_messages"), orma!!.selectFromGroupMessage().count().toString())) + } catch (_: Exception) + { + } + try + { + add(Entry(i18n("about.number_of_friends"), orma!!.selectFromFriendList().count().toString())) + } catch (_: Exception) + { + } + } + + try + { + if (global_store.toxRunning) + { + // add(Entry(i18n("about.number_of_groups"), orma!!.selectFromGroupDB().count().toString())) + add(Entry(i18n("about.number_of_groups"), tox_group_get_number_groups().toString())) + } + } catch (_: Exception) + { + } + try {