Add MP4 format sanitizer

This MP4 format "sanitizer" currently only transforms (when necessary) outgoing media on iOS, Android, or Desktop to
make it suitable for streaming playback by the recepient. In the future, it will validate and be able to either repair
or reject outbound AND inbound media, to prevent malformed media from being fed to third party or OS media players.

An generic io module was added to the libsignal rust bridge containing the InputStream trait, modeled loosely after
Java's InputStream, which calls back into the client language to perform reads or skips. This infrastructure could
potentially also be for any other future large data inputs to libsignal functions.
This commit is contained in:
Jessa
2023-03-13 13:53:06 -07:00
committed by Jordan Rose
parent d3e38b9e5c
commit 9eb3483938
45 changed files with 2010 additions and 49 deletions

View File

@@ -42,6 +42,9 @@ public enum SignalError: Error {
case badNicknameCharacter(String)
case nicknameTooShort(String)
case nicknameTooLong(String)
case ioError(String)
case invalidMediaInput(String)
case unsupportedMediaInput(String)
case callbackError(String)
case unknown(UInt32, String)
}
@@ -127,6 +130,12 @@ internal func checkError(_ error: SignalFfiErrorRef?) throws {
throw SignalError.nicknameTooShort(errStr)
case SignalErrorCodeUsernameTooLong:
throw SignalError.nicknameTooLong(errStr)
case SignalErrorCodeIoError:
throw SignalError.ioError(errStr)
case SignalErrorCodeInvalidMediaInput:
throw SignalError.invalidMediaInput(errStr)
case SignalErrorCodeUnsupportedMediaInput:
throw SignalError.unsupportedMediaInput(errStr)
case SignalErrorCodeCallbackError:
throw SignalError.callbackError(errStr)
default: