use of com.att.aro.core.videoanalysis.pojo.VideoUsagePrefs.DUPLICATE_HANDLING in project VideoOptimzer by attdevsupport.
the class PlotHelperAbstract method filterSegmentByVideoPref.
public List<VideoEvent> filterSegmentByVideoPref(StreamingVideoData videoData) {
this.streamingVideoData = videoData;
Map<VideoEvent, VideoStream> veManifestList = new HashMap<>();
chunkDownload = new ArrayList<>();
List<VideoEvent> allSegments = new ArrayList<>();
streamingVideoData.getStreamingVideoCompiled().getDeleteChunkList().clear();
DUPLICATE_HANDLING segmentFilterChoice = videoPrefManager.getVideoUsagePreference().getDuplicateHandling();
for (VideoStream videoStream : streamingVideoData.getVideoStreamMap().values()) {
// don't count if no videos with manifest, or only one video
if (videoStream != null && videoStream.isSelected() && !videoStream.getVideoEventMap().isEmpty()) {
for (VideoEvent videoEvent : videoStream.getVideoEventMap().values()) {
if (!(videoEvent.getSegmentID() == 0 && videoStream.getManifest().getVideoFormat().equals(VideoFormat.MPEG4)) && (!chunkDownload.contains(videoEvent))) {
switch(segmentFilterChoice) {
case FIRST:
filterByFirst(chunkDownload, videoEvent);
break;
case LAST:
filterByLast(chunkDownload, videoEvent);
break;
case HIGHEST:
filterByHighest(chunkDownload, videoEvent);
break;
default:
}
veManifestList.put(videoEvent, videoStream);
chunkDownload.add(videoEvent);
allSegments.add(videoEvent);
}
}
}
}
if (segmentFilterChoice == DUPLICATE_HANDLING.FIRST || segmentFilterChoice == DUPLICATE_HANDLING.LAST) {
for (VideoEvent ve : streamingVideoData.getStreamingVideoCompiled().getDeleteChunkList()) {
veManifestList.keySet().remove(ve);
chunkDownload.remove(ve);
}
}
streamingVideoData.getStreamingVideoCompiled().setAllSegments(allSegments);
return chunkDownload;
}
use of com.att.aro.core.videoanalysis.pojo.VideoUsagePrefs.DUPLICATE_HANDLING in project VideoOptimzer by attdevsupport.
the class VideoPreferencesPanel method getVideoPrefencesPanel.
private Component getVideoPrefencesPanel() {
stallTriggerTimeEdit = new JTextField(String.format("%.3f", videoUsagePrefs.getStallTriggerTime()), 5);
maxBufferEdit = new JTextField(String.format("%.2f", videoUsagePrefs.getMaxBuffer()), 5);
stallPausePointEdit = new JTextField(String.format("%.4f", videoUsagePrefs.getStallPausePoint()), 5);
stallRecoveryEdit = new JTextField(String.format("%.4f", videoUsagePrefs.getStallRecovery()), 5);
targetedStartupDelayEdit = new JTextField(String.format("%.2f", videoUsagePrefs.getStartupDelay()), 5);
nearStallEdit = new JTextField(String.format("%.4f", videoUsagePrefs.getNearStall()), 5);
stallTriggerTimeEdit.setInputVerifier(getNumericInputVerifier(MAX_STALLTRIGGERTIME, 0.01, 3));
stallTriggerTimeEdit.addKeyListener(getKeyListener(stallTriggerTimeEdit));
maxBufferEdit.setInputVerifier(getNumericInputVerifier(MAX_BUFFER, 0, 2));
maxBufferEdit.addKeyListener(getKeyListener(maxBufferEdit));
stallPausePointEdit.setInputVerifier(getNumericInputVerifier(MAX_STALLRECOVERY, 0, 4));
stallPausePointEdit.addKeyListener(getKeyListener(stallPausePointEdit));
stallRecoveryEdit.setInputVerifier(getNumericInputVerifier(MAX_STALLRECOVERY, 0, 4));
stallRecoveryEdit.addKeyListener(getKeyListener(stallRecoveryEdit));
targetedStartupDelayEdit.setInputVerifier(getNumericInputVerifier(MAX_TARGETEDSTARTUPDELAY, 0, 2));
targetedStartupDelayEdit.addKeyListener(getKeyListener(targetedStartupDelayEdit));
NumericInputVerifier numericInputVerifier = getNumericInputVerifier(MAX_NEARSTALL, 0.01, 4);
nearStallEdit.setInputVerifier(numericInputVerifier);
nearStallEdit.addKeyListener(getKeyListener(nearStallEdit));
startupDelayReminder = new JCheckBox();
duplicateHandlingEditCombo = new JComboBox<>();
for (DUPLICATE_HANDLING item : DUPLICATE_HANDLING.values()) {
duplicateHandlingEditCombo.addItem(item);
}
duplicateHandlingEditCombo.setSelectedItem(videoUsagePrefs.getDuplicateHandling());
idx = 0;
GridBagLayout gridBagLayout = new GridBagLayout();
JPanel panel = new JPanel(gridBagLayout);
panel.setAlignmentX(CENTER_ALIGNMENT);
panel.setBorder(new RoundedBorder(new Insets(10, 10, 10, 10), null));
addVideoPreference(panel);
addDefaultButton(panel, 2, numericInputVerifier);
return panel;
}
Aggregations