mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
5369 resolve merge conflicts
This commit is contained in:
commit
a6421fe1ad
@ -336,17 +336,18 @@ class FileSearch {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the video thumbnails for a specified AbstractFile.
|
||||
* Get the video thumbnails for a file which exists in a
|
||||
* VideoThumbnailsWrapper and update the VideoThumbnailsWrapper to include
|
||||
* them.
|
||||
*
|
||||
* @param file Video file to generate thumbnails for.
|
||||
* @param thumbnailWrapper the object which contains the file to generate
|
||||
* thumbnails for.
|
||||
*
|
||||
* @return An object containing the list of video thumbnails, an array of
|
||||
* their timestamps, and the AbstractFile they were generated for.
|
||||
*/
|
||||
@NbBundle.Messages({"# {0} - file name",
|
||||
"FileSearch.genVideoThumb.progress.text=extracting temporary file {0}"})
|
||||
static VideoThumbnailsWrapper getVideoThumbnails(ResultFile resultFile) {
|
||||
AbstractFile file = resultFile.getFirstInstance();
|
||||
static void getVideoThumbnails(VideoThumbnailsWrapper thumbnailWrapper) {
|
||||
AbstractFile file = thumbnailWrapper.getResultFile().getFirstInstance();
|
||||
//Currently this method always creates the thumbnails
|
||||
java.io.File tempFile;
|
||||
try {
|
||||
@ -358,7 +359,8 @@ class FileSearch {
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
return new VideoThumbnailsWrapper(createDefaultThumbnailList(), framePositions, resultFile);
|
||||
thumbnailWrapper.setThumbnails(createDefaultThumbnailList(), framePositions);
|
||||
return;
|
||||
}
|
||||
if (tempFile.exists() == false || tempFile.length() < file.getSize()) {
|
||||
ProgressHandle progress = ProgressHandle.createHandle(Bundle.FileSearch_genVideoThumb_progress_text(file.getName()));
|
||||
@ -371,7 +373,8 @@ class FileSearch {
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
return new VideoThumbnailsWrapper(createDefaultThumbnailList(), framePositions, resultFile);
|
||||
thumbnailWrapper.setThumbnails(createDefaultThumbnailList(), framePositions);
|
||||
return;
|
||||
}
|
||||
ContentUtils.writeToFile(file, tempFile, progress, null, true);
|
||||
} catch (IOException ex) {
|
||||
@ -391,7 +394,8 @@ class FileSearch {
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
return new VideoThumbnailsWrapper(createDefaultThumbnailList(), framePositions, resultFile);
|
||||
thumbnailWrapper.setThumbnails(createDefaultThumbnailList(), framePositions);
|
||||
return;
|
||||
}
|
||||
double fps = videoFile.get(5); // gets frame per second
|
||||
double totalFrames = videoFile.get(7); // gets total frames
|
||||
@ -402,7 +406,8 @@ class FileSearch {
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
return new VideoThumbnailsWrapper(createDefaultThumbnailList(), framePositions, resultFile);
|
||||
thumbnailWrapper.setThumbnails(createDefaultThumbnailList(), framePositions);
|
||||
return;
|
||||
}
|
||||
if (Thread.interrupted()) {
|
||||
int[] framePositions = new int[]{
|
||||
@ -410,7 +415,8 @@ class FileSearch {
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
return new VideoThumbnailsWrapper(createDefaultThumbnailList(), framePositions, resultFile);
|
||||
thumbnailWrapper.setThumbnails(createDefaultThumbnailList(), framePositions);
|
||||
return;
|
||||
}
|
||||
|
||||
double duration = 1000 * (totalFrames / fps); //total milliseconds
|
||||
@ -465,11 +471,12 @@ class FileSearch {
|
||||
|
||||
bufferedImage.getRaster().setDataElements(0, 0, matrixColumns, matrixRows, data);
|
||||
if (Thread.interrupted()) {
|
||||
return new VideoThumbnailsWrapper(videoThumbnails, framePositions, resultFile);
|
||||
thumbnailWrapper.setThumbnails(videoThumbnails, framePositions);
|
||||
return;
|
||||
}
|
||||
videoThumbnails.add(ScalrWrapper.resizeFast(bufferedImage, ImageUtils.ICON_SIZE_LARGE));
|
||||
}
|
||||
return new VideoThumbnailsWrapper(videoThumbnails, framePositions, resultFile);
|
||||
thumbnailWrapper.setThumbnails(videoThumbnails, framePositions);
|
||||
} finally {
|
||||
videoFile.release(); // close the file}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.filequery;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import java.awt.Component;
|
||||
import java.awt.Image;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@ -500,24 +501,22 @@ public class ResultsPanel extends javax.swing.JPanel {
|
||||
|
||||
private class VideoThumbnailWorker extends SwingWorker<Void, Void> {
|
||||
|
||||
private final ResultFile file;
|
||||
private VideoThumbnailsWrapper thumbnailWrapper;
|
||||
private final VideoThumbnailsWrapper thumbnailWrapper;
|
||||
|
||||
VideoThumbnailWorker(ResultFile file) {
|
||||
this.file = file;
|
||||
thumbnailWrapper = new VideoThumbnailsWrapper(new ArrayList<Image>(), new int[4], file);
|
||||
videoThumbnailViewer.addRow(thumbnailWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground() throws Exception {
|
||||
thumbnailWrapper = FileSearch.getVideoThumbnails(file);
|
||||
FileSearch.getVideoThumbnails(thumbnailWrapper);
|
||||
videoThumbnailViewer.repaint();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
if (!isCancelled()) {
|
||||
videoThumbnailViewer.addRow(thumbnailWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ import java.util.List;
|
||||
*/
|
||||
final class VideoThumbnailsWrapper {
|
||||
|
||||
private final List<Image> thumbnails;
|
||||
private List<Image> thumbnails;
|
||||
private final ResultFile resultFile;
|
||||
private final int[] timeStamps;
|
||||
private int[] timeStamps;
|
||||
|
||||
/**
|
||||
* Construct a new VideoThumbnailsWrapper.
|
||||
@ -79,4 +79,9 @@ final class VideoThumbnailsWrapper {
|
||||
return Collections.unmodifiableList(thumbnails);
|
||||
}
|
||||
|
||||
void setThumbnails(List<Image> videoThumbnails, int[] framePositions) {
|
||||
this.thumbnails = videoThumbnails;
|
||||
this.timeStamps = framePositions;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user