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();) {
CentralRepoPlatforms selectedPlatform = CentralRepoPlatforms.getSelectedPlatform();
CentralRepoPlatforms selectedPlatform = CentralRepoDbManager.getSavedDbChoice().getDbPlatform();
// Create account_types and accounts tables which are referred by X_instances tables
statement.execute(RdbmsCentralRepoFactory.getCreateAccountTypesTableStatement(selectedPlatform));

View File

@ -241,7 +241,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
progressSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (progressSlider.getValueIsAdjusting()) {
if (progressSlider.getValueIsAdjusting() && gstPlayBin != null) {
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
double relativePosition = progressSlider.getValue() * 1.0 / PROGRESS_SLIDER_SIZE;
long newStartTime = (long) (relativePosition * duration);
@ -267,17 +267,20 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
@Override
public void mousePressed(MouseEvent e) {
if (gstPlayBin != null) {
previousState = gstPlayBin.getState();
gstPlayBin.pause();
}
}
@Override
public void mouseReleased(MouseEvent e) {
if(previousState.equals(State.PLAYING)) {
if (previousState.equals(State.PLAYING) && gstPlayBin != null) {
gstPlayBin.play();
}
previousState = State.NULL;
}
@Override
public void mouseClicked(MouseEvent e) {
}
@ -293,7 +296,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
});
//Manage the audio level when the user is adjusting the volume slider
audioSlider.addChangeListener((ChangeEvent event) -> {
if (audioSlider.getValueIsAdjusting()) {
if (audioSlider.getValueIsAdjusting() && gstPlayBin != null) {
double audioPercent = (audioSlider.getValue() * 2.0) / 100.0;
gstPlayBin.setVolume(audioPercent);
}
@ -327,12 +330,14 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
endOfStreamListener = new Bus.EOS() {
@Override
public void endOfStream(GstObject go) {
if (gstPlayBin != null) {
gstPlayBin.seek(ClockTime.ZERO);
/**
* Keep the video from automatically playing
*/
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
gstPlayBin = new PlayBin("VideoPlayer", tempFile.toURI());
//Configure event handling
if (gstPlayBin != null) {
Bus playBinBus = gstPlayBin.getBus();
playBinBus.connect(endOfStreamListener);
playBinBus.connect(stateChangeListener);
playBinBus.connect(errorListener);
}
if (this.isCancelled()) {
return;
@ -570,15 +577,16 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
videoPanel.setLayout(new BoxLayout(videoPanel, BoxLayout.Y_AXIS));
videoPanel.add(fxPanel);
fxAppSink = new JavaFxAppSink("JavaFxAppSink", fxPanel);
if (gstPlayBin != null) {
gstPlayBin.setVideoSink(fxAppSink);
}
if (this.isCancelled()) {
return;
}
if (gstPlayBin != null) {
gstPlayBin.setVolume((audioSlider.getValue() * 2.0) / 100.0);
gstPlayBin.pause();
}
timer.start();
enableComponents(true);
} catch (CancellationException ex) {
@ -598,7 +606,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
@Override
public void actionPerformed(ActionEvent e) {
if (!progressSlider.getValueIsAdjusting()) {
if (!progressSlider.getValueIsAdjusting() && gstPlayBin != null) {
sliderLock.acquireUninterruptibly();
long position = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
@ -655,8 +663,8 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
}
/**
* Modifies the View to be an oval rather than the underlying
* rectangle Controller.
* Modifies the View to be an oval rather than the underlying rectangle
* Controller.
*/
@Override
public void paintThumb(Graphics graphic) {
@ -705,11 +713,12 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
@Override
protected TrackListener createTrackListener(JSlider slider) {
/**
* This track listener will force the thumb to be snapped to the mouse
* location. This makes grabbing and dragging the JSlider much easier.
* Using the default track listener, the user would have to click
* exactly on the slider thumb to drag it. Now the thumb positions
* itself under the mouse so that it can always be dragged.
* This track listener will force the thumb to be snapped to the
* mouse location. This makes grabbing and dragging the JSlider much
* easier. Using the default track listener, the user would have to
* click exactly on the slider thumb to drag it. Now the thumb
* positions itself under the mouse so that it can always be
* dragged.
*/
return new TrackListener() {
@Override
@ -982,6 +991,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
}// </editor-fold>//GEN-END:initComponents
private void rewindButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rewindButtonActionPerformed
if (gstPlayBin != null) {
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
//Skip 30 seconds.
long rewindDelta = TimeUnit.NANOSECONDS.convert(SKIP_IN_SECONDS, TimeUnit.SECONDS);
@ -997,9 +1007,11 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
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
if (gstPlayBin != null) {
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
//Skip 30 seconds.
@ -1007,14 +1019,14 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
//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) {
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;
newTime = currentTime + (duration - currentTime) / 2;
} else {
newTime = currentTime + fastForwardDelta;
}
@ -1029,9 +1041,11 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
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 {
@ -1049,9 +1063,11 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
SeekType.NONE, -1);
gstPlayBin.play();
}
}
}//GEN-LAST:event_playButtonActionPerformed
private void playBackSpeedComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playBackSpeedComboBoxActionPerformed
if (gstPlayBin != null) {
double playBackRate = getPlayBackRate();
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
gstPlayBin.seek(playBackRate,
@ -1063,6 +1079,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
//playback rate.
SeekType.SET, currentTime,
SeekType.NONE, 0);
}
}//GEN-LAST:event_playBackSpeedComboBoxActionPerformed
// 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
# {0} - artifactDisplayName
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.viewSourceArtifact.text=View Source Result
Category.five=CAT-5: Non-pertinent