mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
add progressHandle to video export for playback in Ig ; export video to same loation for IG as for FXVideoPanel
This commit is contained in:
parent
c8ac16f713
commit
210f36b642
@ -403,8 +403,7 @@ public class ImageUtils {
|
||||
com.google.common.io.Files.createParentDirs(tempFile);
|
||||
|
||||
ProgressHandle progress = ProgressHandleFactory.createHandle("extracting temporary file " + file.getName());
|
||||
progress.start();
|
||||
progress.switchToDeterminate(100);
|
||||
progress.start(100);
|
||||
try {
|
||||
ContentUtils.writeToFile(file, tempFile, progress, null, true);
|
||||
} catch (IOException ex) {
|
||||
|
@ -29,9 +29,11 @@ import javafx.embed.swing.SwingFXUtils;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.media.Media;
|
||||
import javafx.scene.media.MediaException;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.netbeans.api.progress.ProgressHandle;
|
||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.VideoUtils;
|
||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||
import org.sleuthkit.autopsy.imagegallery.ThumbnailCache;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
@ -74,9 +76,13 @@ public class VideoFile<T extends AbstractFile> extends DrawableFile<T> {
|
||||
if (media != null) {
|
||||
return media;
|
||||
}
|
||||
final File cacheFile = getCacheFile(this.getId());
|
||||
if (cacheFile.exists() == false) {
|
||||
ContentUtils.writeToFile(this.getAbstractFile(), cacheFile);
|
||||
final File cacheFile = VideoUtils.getTempVideoFile(this.getAbstractFile());
|
||||
|
||||
if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) {
|
||||
ProgressHandle progressHandle = ProgressHandleFactory.createHandle("writing temporary file to disk");
|
||||
progressHandle.start(100);
|
||||
ContentUtils.writeToFile(this.getAbstractFile(), cacheFile, progressHandle, null, true);
|
||||
progressHandle.finish();
|
||||
}
|
||||
|
||||
media = new Media(Paths.get(cacheFile.getAbsolutePath()).toUri().toString());
|
||||
@ -85,10 +91,6 @@ public class VideoFile<T extends AbstractFile> extends DrawableFile<T> {
|
||||
|
||||
}
|
||||
|
||||
private File getCacheFile(long id) {
|
||||
return new File(Case.getCurrentCase().getCacheDirectory() + File.separator + id);
|
||||
}
|
||||
|
||||
public boolean isDisplayableAsMedia() {
|
||||
try {
|
||||
Media media = getMedia();
|
||||
|
Loading…
x
Reference in New Issue
Block a user