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:
adam 2013-05-09 14:16:32 -07:00
commit 7a0d420897
4 changed files with 19 additions and 16 deletions

View File

@ -201,7 +201,7 @@ public class Case {
* @param caseNumber the case number
* @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});
String configFilePath = caseDir + File.separator + caseName + CASE_DOT_EXTENSION;
@ -220,7 +220,7 @@ public class Case {
}
Case newCase = new Case(caseName, caseNumber, examiner, configFilePath, xmlcm, db);
changeCase(newCase);
}
@ -254,7 +254,7 @@ public class Case {
checkImagesExist(db);
Case openedCase = new Case(caseName, caseNumber, examiner, configFilePath, xmlcm, db);
changeCase(openedCase);
} catch (Exception ex) {
@ -903,8 +903,6 @@ public class Case {
} else {
// close all top components
CoreComponentControl.closeCoreWindows();
// prompt user to add an image
Case.runAddImageAction();
}
} else { // case is closed
// close all top components first

View File

@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.casemodule;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.event.ActionListener;
import java.io.File;
import java.text.MessageFormat;
import java.util.logging.Level;
@ -87,7 +88,9 @@ public final class NewCaseWizardAction extends CallableSystemAction {
// if the finish button is pressed (not cancelled)
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

View File

@ -72,7 +72,7 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt
private static final Logger logger = Logger.getLogger(MediaViewVideoPanel.class.getName());
private boolean gstInited;
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.";
//playback
private long durationMillis = 0;
@ -384,7 +384,7 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt
try {
lock.wait(FRAME_CAPTURE_TIMEOUT_MILLIS);
} 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();
@ -419,17 +419,19 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt
@Override
public void rgbFrame(boolean bln, int w, int h, IntBuffer rgbPixels) {
bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
bi.setRGB(0, 0, w, h, rgbPixels.array(), 0, w);
synchronized(waiter) {
synchronized (waiter) {
bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
bi.setRGB(0, 0, w, h, rgbPixels.array(), 0, w);
waiter.notify();
}
}
public Image getImage() {
Image image = bi;
bi = null;
return image;
synchronized (waiter) {
Image image = bi;
bi = null;
return image;
}
}
}

View File

@ -229,7 +229,7 @@ public class IngestManager {
* @param modules modules to execute on every image
* @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.");
if (!isIngestRunning() && ui != null) {
@ -256,7 +256,7 @@ public class IngestManager {
* @param modules modules to execute on the image
* @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>();
images.add(image);
logger.log(Level.INFO, "Will enqueue image: " + image.getName());