mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Merge pull request #190 from tmciver-basis/master
Changes to case creation logic and fix for possible frame capture concurrency bug.
This commit is contained in:
commit
7a0d420897
@ -201,7 +201,7 @@ public class Case {
|
|||||||
* @param caseNumber the case number
|
* @param caseNumber the case number
|
||||||
* @param examiner the examiner for this case
|
* @param examiner the examiner for this case
|
||||||
*/
|
*/
|
||||||
static void create(String caseDir, String caseName, String caseNumber, String examiner) throws CaseActionException {
|
public static void create(String caseDir, String caseName, String caseNumber, String examiner) throws CaseActionException {
|
||||||
logger.log(Level.INFO, "Creating new case.\ncaseDir: {0}\ncaseName: {1}", new Object[]{caseDir, caseName});
|
logger.log(Level.INFO, "Creating new case.\ncaseDir: {0}\ncaseName: {1}", new Object[]{caseDir, caseName});
|
||||||
|
|
||||||
String configFilePath = caseDir + File.separator + caseName + CASE_DOT_EXTENSION;
|
String configFilePath = caseDir + File.separator + caseName + CASE_DOT_EXTENSION;
|
||||||
@ -903,8 +903,6 @@ public class Case {
|
|||||||
} else {
|
} else {
|
||||||
// close all top components
|
// close all top components
|
||||||
CoreComponentControl.closeCoreWindows();
|
CoreComponentControl.closeCoreWindows();
|
||||||
// prompt user to add an image
|
|
||||||
Case.runAddImageAction();
|
|
||||||
}
|
}
|
||||||
} else { // case is closed
|
} else { // case is closed
|
||||||
// close all top components first
|
// close all top components first
|
||||||
|
@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.casemodule;
|
|||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Dialog;
|
import java.awt.Dialog;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -87,7 +88,9 @@ public final class NewCaseWizardAction extends CallableSystemAction {
|
|||||||
|
|
||||||
// if the finish button is pressed (not cancelled)
|
// if the finish button is pressed (not cancelled)
|
||||||
if (finished) {
|
if (finished) {
|
||||||
// nothing to do, the Add Image dialog will pop up on its own because we've just opened a case with no images
|
// now start the 'Add Image' wizard
|
||||||
|
AddImageAction addImageAction = SystemAction.get(AddImageAction.class);
|
||||||
|
addImageAction.actionPerformed(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if Cancel button is pressed
|
// if Cancel button is pressed
|
||||||
|
@ -72,7 +72,7 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt
|
|||||||
private static final Logger logger = Logger.getLogger(MediaViewVideoPanel.class.getName());
|
private static final Logger logger = Logger.getLogger(MediaViewVideoPanel.class.getName());
|
||||||
private boolean gstInited;
|
private boolean gstInited;
|
||||||
private static final long MIN_FRAME_INTERVAL_MILLIS = 500;
|
private static final long MIN_FRAME_INTERVAL_MILLIS = 500;
|
||||||
private static final long FRAME_CAPTURE_TIMEOUT_MILLIS = 100;
|
private static final long FRAME_CAPTURE_TIMEOUT_MILLIS = 1000;
|
||||||
private static final String MEDIA_PLAYER_ERROR_STRING = "The media player cannot process this file.";
|
private static final String MEDIA_PLAYER_ERROR_STRING = "The media player cannot process this file.";
|
||||||
//playback
|
//playback
|
||||||
private long durationMillis = 0;
|
private long durationMillis = 0;
|
||||||
@ -384,7 +384,7 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt
|
|||||||
try {
|
try {
|
||||||
lock.wait(FRAME_CAPTURE_TIMEOUT_MILLIS);
|
lock.wait(FRAME_CAPTURE_TIMEOUT_MILLIS);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.log(Level.INFO, "Timeout occurred while waiting for frame capture.", e);
|
logger.log(Level.INFO, "InterruptedException occurred while waiting for frame capture.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Image image = rgbListener.getImage();
|
Image image = rgbListener.getImage();
|
||||||
@ -419,17 +419,19 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void rgbFrame(boolean bln, int w, int h, IntBuffer rgbPixels) {
|
public void rgbFrame(boolean bln, int w, int h, IntBuffer rgbPixels) {
|
||||||
bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
synchronized (waiter) {
|
||||||
bi.setRGB(0, 0, w, h, rgbPixels.array(), 0, w);
|
bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
||||||
synchronized(waiter) {
|
bi.setRGB(0, 0, w, h, rgbPixels.array(), 0, w);
|
||||||
waiter.notify();
|
waiter.notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Image getImage() {
|
public Image getImage() {
|
||||||
Image image = bi;
|
synchronized (waiter) {
|
||||||
bi = null;
|
Image image = bi;
|
||||||
return image;
|
bi = null;
|
||||||
|
return image;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ public class IngestManager {
|
|||||||
* @param modules modules to execute on every image
|
* @param modules modules to execute on every image
|
||||||
* @param images images to execute modules on
|
* @param images images to execute modules on
|
||||||
*/
|
*/
|
||||||
void execute(final List<IngestModuleAbstract> modules, final List<Image> images) {
|
public void execute(final List<IngestModuleAbstract> modules, final List<Image> images) {
|
||||||
logger.log(Level.INFO, "Will enqueue number of images: " + images.size() + " to " + modules.size() + " modules.");
|
logger.log(Level.INFO, "Will enqueue number of images: " + images.size() + " to " + modules.size() + " modules.");
|
||||||
|
|
||||||
if (!isIngestRunning() && ui != null) {
|
if (!isIngestRunning() && ui != null) {
|
||||||
@ -256,7 +256,7 @@ public class IngestManager {
|
|||||||
* @param modules modules to execute on the image
|
* @param modules modules to execute on the image
|
||||||
* @param image image to execute modules on
|
* @param image image to execute modules on
|
||||||
*/
|
*/
|
||||||
void execute(final List<IngestModuleAbstract> modules, final Image image) {
|
public void execute(final List<IngestModuleAbstract> modules, final Image image) {
|
||||||
List<Image> images = new ArrayList<Image>();
|
List<Image> images = new ArrayList<Image>();
|
||||||
images.add(image);
|
images.add(image);
|
||||||
logger.log(Level.INFO, "Will enqueue image: " + image.getName());
|
logger.log(Level.INFO, "Will enqueue image: " + image.getName());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user