decord/beta/source/utils/ProtoUtils.tsx

35 lines
1 KiB
TypeScript
Raw Normal View History

2026-10-07 22:43:51 +00:00
// Module ID: 1234
// Function ID: 1235
// Name: ProtoUtils
2026-10-07 22:43:51 +00:00
// Dependencies: [1198, 2]
// Exports: b64ToProto, protoToB64
2026-10-07 22:43:51 +00:00
// Module 1234 (ProtoUtils)
import _mod1198 from "module_1198" /* 1198 */;
import size from "module_2" /* 2 */;
const BINARY_READ_OPTIONS = {
2026-10-01 14:13:23 +00:00
readerFactory(buf) {
2026-10-07 22:43:51 +00:00
const BinaryReader = _mod1198.BinaryReader;
const textDecoder = new TextDecoder("utf-8");
2026-10-01 14:13:23 +00:00
const binaryReader = new BinaryReader(buf, textDecoder);
return binaryReader;
}
};
const result = size.fileFinishedImporting("utils/ProtoUtils.tsx");
export { BINARY_READ_OPTIONS };
export const b64ToProto = function b64ToProto(fromBinary, actionData) {
let fromBinaryResult = null;
if (null != actionData) {
2026-10-01 14:13:23 +00:00
fromBinary = fromBinary.fromBinary;
2026-10-07 22:43:51 +00:00
const obj = _mod1198;
2026-10-01 14:13:23 +00:00
fromBinaryResult = fromBinary(obj.base64decode(actionData), obj);
}
return fromBinaryResult;
};
export const protoToB64 = function protoToB64(toBinary, favoriteGifs) {
2026-10-07 22:43:51 +00:00
const obj = _mod1198;
2026-10-01 14:13:23 +00:00
return obj.base64encode(toBinary.toBinary(favoriteGifs));
};