Improve UX around seeing audio wave forms.

- Attempts to generate the wave form on download instead on display
- Allows multi-threaded generation of wave forms instead of serial
  executor
This commit is contained in:
Cody Henthorne
2023-02-15 09:43:16 -05:00
committed by GitHub
parent d4ce8458a4
commit 9610339f38
9 changed files with 497 additions and 337 deletions

View File

@@ -51,6 +51,7 @@ import org.thoughtcrime.securesms.crypto.ClassicDecryptingPartInputStream;
import org.thoughtcrime.securesms.crypto.ModernDecryptingPartInputStream;
import org.thoughtcrime.securesms.crypto.ModernEncryptingPartOutputStream;
import org.thoughtcrime.securesms.database.model.databaseprotos.AudioWaveFormData;
import org.thoughtcrime.securesms.jobs.GenerateAudioWaveFormJob;
import org.thoughtcrime.securesms.mms.MediaStream;
import org.thoughtcrime.securesms.mms.MmsException;
import org.thoughtcrime.securesms.mms.PartAuthority;
@@ -656,6 +657,10 @@ public class AttachmentTable extends DatabaseTable {
//noinspection ResultOfMethodCallIgnored
transferFile.delete();
}
if (placeholder != null && MediaUtil.isAudio(placeholder)) {
GenerateAudioWaveFormJob.enqueue(placeholder.getAttachmentId());
}
}
private static @Nullable String getVisualHashStringOrNull(@Nullable Attachment attachment) {