diff --git a/mobile/lib/utils/exif_util.dart b/mobile/lib/utils/exif_util.dart index 5459cd543f..1febb9bb0c 100644 --- a/mobile/lib/utils/exif_util.dart +++ b/mobile/lib/utils/exif_util.dart @@ -10,6 +10,7 @@ import "package:ffmpeg_kit_flutter_min/media_information_session.dart"; import "package:flutter/foundation.dart"; import 'package:intl/intl.dart'; import 'package:logging/logging.dart'; +import "package:motion_photos/src/xmp_extractor.dart"; import "package:photos/models/ffmpeg/ffprobe_props.dart"; import 'package:photos/models/file/file.dart'; import "package:photos/models/location/location.dart"; @@ -56,6 +57,32 @@ Future?> getExifFromSourceFile(File originFile) async { } } +Future getVideoPropsAsyncV2(File originalFile) async { + return Computer.shared().compute( + getVideoPropsComputer, + param: {"file": originalFile}, + taskName: "getVideoPropsAsyncV2", + ); +} + +Future getVideoPropsComputer(Map args) { + final File originalFile = args["file"]; + return getVideoPropsAsync(originalFile); +} + +Future> getXmp(File file) async { + return Computer.shared().compute( + _getXMPComputer, + param: {"file": file}, + taskName: "getXMPAsync", + ); +} + +Map _getXMPComputer(Map args) { + final File originalFile = args["file"] as File; + return XMPExtractor().extract(originalFile.readAsBytesSync()); +} + Future getVideoPropsAsync(File originalFile) async { try { final stopwatch = Stopwatch()..start();