Merge branch 'develop' of github.com:sleuthkit/autopsy into 6081-Use-Helper-For-Artifact-Creation

This commit is contained in:
U-BASIS\dsmyda 2020-03-15 14:09:41 -04:00
commit b4087ed9ff
4 changed files with 602 additions and 500 deletions

View File

@ -39,7 +39,7 @@ public class CentralRepoDbUpgrader13To14 implements CentralRepoDbUpgrader {
try (Statement statement = connection.createStatement();) { try (Statement statement = connection.createStatement();) {
CentralRepoPlatforms selectedPlatform = CentralRepoPlatforms.getSelectedPlatform(); CentralRepoPlatforms selectedPlatform = CentralRepoDbManager.getSavedDbChoice().getDbPlatform();
// Create account_types and accounts tables which are referred by X_instances tables // Create account_types and accounts tables which are referred by X_instances tables
statement.execute(RdbmsCentralRepoFactory.getCreateAccountTypesTableStatement(selectedPlatform)); statement.execute(RdbmsCentralRepoFactory.getCreateAccountTypesTableStatement(selectedPlatform));

View File

@ -241,7 +241,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
progressSlider.addChangeListener(new ChangeListener() { progressSlider.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (progressSlider.getValueIsAdjusting()) { if (progressSlider.getValueIsAdjusting() && gstPlayBin != null) {
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS); long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
double relativePosition = progressSlider.getValue() * 1.0 / PROGRESS_SLIDER_SIZE; double relativePosition = progressSlider.getValue() * 1.0 / PROGRESS_SLIDER_SIZE;
long newStartTime = (long) (relativePosition * duration); long newStartTime = (long) (relativePosition * duration);
@ -264,20 +264,23 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
//Manage the video while the user is performing actions on the track. //Manage the video while the user is performing actions on the track.
progressSlider.addMouseListener(new MouseListener() { progressSlider.addMouseListener(new MouseListener() {
private State previousState = State.NULL; private State previousState = State.NULL;
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
previousState = gstPlayBin.getState(); if (gstPlayBin != null) {
gstPlayBin.pause(); previousState = gstPlayBin.getState();
gstPlayBin.pause();
}
} }
@Override @Override
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
if(previousState.equals(State.PLAYING)) { if (previousState.equals(State.PLAYING) && gstPlayBin != null) {
gstPlayBin.play(); gstPlayBin.play();
} }
previousState = State.NULL; previousState = State.NULL;
} }
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
} }
@ -289,11 +292,11 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
@Override @Override
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
} }
}); });
//Manage the audio level when the user is adjusting the volume slider //Manage the audio level when the user is adjusting the volume slider
audioSlider.addChangeListener((ChangeEvent event) -> { audioSlider.addChangeListener((ChangeEvent event) -> {
if (audioSlider.getValueIsAdjusting()) { if (audioSlider.getValueIsAdjusting() && gstPlayBin != null) {
double audioPercent = (audioSlider.getValue() * 2.0) / 100.0; double audioPercent = (audioSlider.getValue() * 2.0) / 100.0;
gstPlayBin.setVolume(audioPercent); gstPlayBin.setVolume(audioPercent);
} }
@ -327,11 +330,13 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
endOfStreamListener = new Bus.EOS() { endOfStreamListener = new Bus.EOS() {
@Override @Override
public void endOfStream(GstObject go) { public void endOfStream(GstObject go) {
gstPlayBin.seek(ClockTime.ZERO); if (gstPlayBin != null) {
/** gstPlayBin.seek(ClockTime.ZERO);
* Keep the video from automatically playing /**
*/ * Keep the video from automatically playing
Gst.getExecutor().submit(() -> gstPlayBin.pause()); */
Gst.getExecutor().submit(() -> gstPlayBin.pause());
}
} }
}; };
} }
@ -556,10 +561,12 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
//Video is ready for playback. Create new components //Video is ready for playback. Create new components
gstPlayBin = new PlayBin("VideoPlayer", tempFile.toURI()); gstPlayBin = new PlayBin("VideoPlayer", tempFile.toURI());
//Configure event handling //Configure event handling
Bus playBinBus = gstPlayBin.getBus(); if (gstPlayBin != null) {
playBinBus.connect(endOfStreamListener); Bus playBinBus = gstPlayBin.getBus();
playBinBus.connect(stateChangeListener); playBinBus.connect(endOfStreamListener);
playBinBus.connect(errorListener); playBinBus.connect(stateChangeListener);
playBinBus.connect(errorListener);
}
if (this.isCancelled()) { if (this.isCancelled()) {
return; return;
@ -570,15 +577,16 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
videoPanel.setLayout(new BoxLayout(videoPanel, BoxLayout.Y_AXIS)); videoPanel.setLayout(new BoxLayout(videoPanel, BoxLayout.Y_AXIS));
videoPanel.add(fxPanel); videoPanel.add(fxPanel);
fxAppSink = new JavaFxAppSink("JavaFxAppSink", fxPanel); fxAppSink = new JavaFxAppSink("JavaFxAppSink", fxPanel);
gstPlayBin.setVideoSink(fxAppSink); if (gstPlayBin != null) {
gstPlayBin.setVideoSink(fxAppSink);
}
if (this.isCancelled()) { if (this.isCancelled()) {
return; return;
} }
if (gstPlayBin != null) {
gstPlayBin.setVolume((audioSlider.getValue() * 2.0) / 100.0); gstPlayBin.setVolume((audioSlider.getValue() * 2.0) / 100.0);
gstPlayBin.pause(); gstPlayBin.pause();
}
timer.start(); timer.start();
enableComponents(true); enableComponents(true);
} catch (CancellationException ex) { } catch (CancellationException ex) {
@ -598,7 +606,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (!progressSlider.getValueIsAdjusting()) { if (!progressSlider.getValueIsAdjusting() && gstPlayBin != null) {
sliderLock.acquireUninterruptibly(); sliderLock.acquireUninterruptibly();
long position = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS); long position = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS); long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
@ -635,13 +643,13 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
* thumb at the given width and height. It also paints the track blue as * thumb at the given width and height. It also paints the track blue as
* the thumb progresses. * the thumb progresses.
* *
* @param slider JSlider component * @param slider JSlider component
* @param thumbDimension * @param thumbDimension
*/ */
public CircularJSliderUI(JSlider slider, Dimension thumbDimension) { public CircularJSliderUI(JSlider slider, Dimension thumbDimension) {
super(slider); super(slider);
this.thumbDimension = thumbDimension; this.thumbDimension = thumbDimension;
//Configure track and thumb colors. //Configure track and thumb colors.
Color lightBlue = new Color(0, 130, 255); Color lightBlue = new Color(0, 130, 255);
thumbColor = lightBlue; thumbColor = lightBlue;
@ -655,8 +663,8 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
} }
/** /**
* Modifies the View to be an oval rather than the underlying * Modifies the View to be an oval rather than the underlying rectangle
* rectangle Controller. * Controller.
*/ */
@Override @Override
public void paintThumb(Graphics graphic) { public void paintThumb(Graphics graphic) {
@ -705,12 +713,13 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
@Override @Override
protected TrackListener createTrackListener(JSlider slider) { protected TrackListener createTrackListener(JSlider slider) {
/** /**
* This track listener will force the thumb to be snapped to the mouse * This track listener will force the thumb to be snapped to the
* location. This makes grabbing and dragging the JSlider much easier. * mouse location. This makes grabbing and dragging the JSlider much
* Using the default track listener, the user would have to click * easier. Using the default track listener, the user would have to
* exactly on the slider thumb to drag it. Now the thumb positions * click exactly on the slider thumb to drag it. Now the thumb
* itself under the mouse so that it can always be dragged. * positions itself under the mouse so that it can always be
*/ * dragged.
*/
return new TrackListener() { return new TrackListener() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
@ -982,87 +991,95 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void rewindButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rewindButtonActionPerformed private void rewindButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rewindButtonActionPerformed
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS); if (gstPlayBin != null) {
//Skip 30 seconds.
long rewindDelta = TimeUnit.NANOSECONDS.convert(SKIP_IN_SECONDS, TimeUnit.SECONDS);
//Ensure new video position is within bounds
long newTime = Math.max(currentTime - rewindDelta, 0);
double playBackRate = getPlayBackRate();
gstPlayBin.seek(playBackRate,
Format.TIME,
//FLUSH - flushes the pipeline
//ACCURATE - video will seek exactly to the position requested
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
//Set the start position to newTime
SeekType.SET, newTime,
//Do nothing for the end position
SeekType.NONE, -1);
}//GEN-LAST:event_rewindButtonActionPerformed
private void fastForwardButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fastForwardButtonActionPerformed
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
//Skip 30 seconds.
long fastForwardDelta = TimeUnit.NANOSECONDS.convert(SKIP_IN_SECONDS, TimeUnit.SECONDS);
//Don't allow skipping within 2 seconds of video ending. Skipping right to
//the end causes undefined behavior for some gstreamer plugins.
long twoSecondsInNano = TimeUnit.NANOSECONDS.convert(2, TimeUnit.SECONDS);
if((duration - currentTime) <= twoSecondsInNano) {
return;
}
long newTime;
if (currentTime + fastForwardDelta >= duration) {
//If there are less than 30 seconds left, only fast forward to the midpoint.
newTime = currentTime + (duration - currentTime)/2;
} else {
newTime = currentTime + fastForwardDelta;
}
double playBackRate = getPlayBackRate();
gstPlayBin.seek(playBackRate,
Format.TIME,
//FLUSH - flushes the pipeline
//ACCURATE - video will seek exactly to the position requested
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
//Set the start position to newTime
SeekType.SET, newTime,
//Do nothing for the end position
SeekType.NONE, -1);
}//GEN-LAST:event_fastForwardButtonActionPerformed
private void playButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playButtonActionPerformed
if (gstPlayBin.isPlaying()) {
gstPlayBin.pause();
} else {
double playBackRate = getPlayBackRate();
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS); long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
//Set playback rate before play. //Skip 30 seconds.
long rewindDelta = TimeUnit.NANOSECONDS.convert(SKIP_IN_SECONDS, TimeUnit.SECONDS);
//Ensure new video position is within bounds
long newTime = Math.max(currentTime - rewindDelta, 0);
double playBackRate = getPlayBackRate();
gstPlayBin.seek(playBackRate, gstPlayBin.seek(playBackRate,
Format.TIME, Format.TIME,
//FLUSH - flushes the pipeline //FLUSH - flushes the pipeline
//ACCURATE - video will seek exactly to the position requested //ACCURATE - video will seek exactly to the position requested
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE), EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
//Set the start position to newTime //Set the start position to newTime
SeekType.SET, currentTime, SeekType.SET, newTime,
//Do nothing for the end position //Do nothing for the end position
SeekType.NONE, -1); SeekType.NONE, -1);
gstPlayBin.play(); }
}//GEN-LAST:event_rewindButtonActionPerformed
private void fastForwardButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fastForwardButtonActionPerformed
if (gstPlayBin != null) {
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
//Skip 30 seconds.
long fastForwardDelta = TimeUnit.NANOSECONDS.convert(SKIP_IN_SECONDS, TimeUnit.SECONDS);
//Don't allow skipping within 2 seconds of video ending. Skipping right to
//the end causes undefined behavior for some gstreamer plugins.
long twoSecondsInNano = TimeUnit.NANOSECONDS.convert(2, TimeUnit.SECONDS);
if ((duration - currentTime) <= twoSecondsInNano) {
return;
}
long newTime;
if (currentTime + fastForwardDelta >= duration) {
//If there are less than 30 seconds left, only fast forward to the midpoint.
newTime = currentTime + (duration - currentTime) / 2;
} else {
newTime = currentTime + fastForwardDelta;
}
double playBackRate = getPlayBackRate();
gstPlayBin.seek(playBackRate,
Format.TIME,
//FLUSH - flushes the pipeline
//ACCURATE - video will seek exactly to the position requested
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
//Set the start position to newTime
SeekType.SET, newTime,
//Do nothing for the end position
SeekType.NONE, -1);
}
}//GEN-LAST:event_fastForwardButtonActionPerformed
private void playButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playButtonActionPerformed
if (gstPlayBin != null) {
if (gstPlayBin.isPlaying()) {
gstPlayBin.pause();
} else {
double playBackRate = getPlayBackRate();
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
//Set playback rate before play.
gstPlayBin.seek(playBackRate,
Format.TIME,
//FLUSH - flushes the pipeline
//ACCURATE - video will seek exactly to the position requested
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
//Set the start position to newTime
SeekType.SET, currentTime,
//Do nothing for the end position
SeekType.NONE, -1);
gstPlayBin.play();
}
} }
}//GEN-LAST:event_playButtonActionPerformed }//GEN-LAST:event_playButtonActionPerformed
private void playBackSpeedComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playBackSpeedComboBoxActionPerformed private void playBackSpeedComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playBackSpeedComboBoxActionPerformed
double playBackRate = getPlayBackRate(); if (gstPlayBin != null) {
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS); double playBackRate = getPlayBackRate();
gstPlayBin.seek(playBackRate, long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
Format.TIME, gstPlayBin.seek(playBackRate,
//FLUSH - flushes the pipeline Format.TIME,
//ACCURATE - video will seek exactly to the position requested //FLUSH - flushes the pipeline
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE), //ACCURATE - video will seek exactly to the position requested
//Set the position to the currentTime, we are only adjusting the EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
//playback rate. //Set the position to the currentTime, we are only adjusting the
SeekType.SET, currentTime, //playback rate.
SeekType.NONE, 0); SeekType.SET, currentTime,
SeekType.NONE, 0);
}
}//GEN-LAST:event_playBackSpeedComboBoxActionPerformed }//GEN-LAST:event_playBackSpeedComboBoxActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables

View File

@ -78,9 +78,6 @@ BlackboardArtifactNode.createSheet.taggedItem.description=Result or associated f
BlackboardArtifactNode.createSheet.tags.displayName=Tags BlackboardArtifactNode.createSheet.tags.displayName=Tags
# {0} - artifactDisplayName # {0} - artifactDisplayName
BlackboardArtifactNode.displayName.artifact={0} Artifact BlackboardArtifactNode.displayName.artifact={0} Artifact
BlackboardArtifactNode.getAction.errorTitle=Error getting actions
BlackboardArtifactNode.getAction.linkedFileMessage=There was a problem getting actions for the selected result. The 'View File in Timeline' action will not be available.
BlackboardArtifactNode.getAction.resultErrorMessage=There was a problem getting actions for the selected result. The 'View Result in Timeline' action will not be available.
BlackboardArtifactTagNode.createSheet.userName.text=User Name BlackboardArtifactTagNode.createSheet.userName.text=User Name
BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result BlackboardArtifactTagNode.viewSourceArtifact.text=View Source Result
Category.five=CAT-5: Non-pertinent Category.five=CAT-5: Non-pertinent