use of com.att.aro.core.videoanalysis.pojo.VideoEvent in project VideoOptimzer by attdevsupport.
the class BufferOccupancyPlot method toolTipGenerator.
public XYToolTipGenerator toolTipGenerator() {
return new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
// Tooltip value
Number timestamp = dataset.getX(series, item);
Number bufferSize = dataset.getY(series, item);
VideoEvent event = videoStream.getByteToolTipDetailMap().get(item).getVideoEvent();
double segmentID = event.getSegmentID();
ContentType type = event.getContentType();
double play = event.getPlayTime();
return (MessageFormat.format(BUFFEROCCUPANCY_TOOLTIP, String.format("%s", type.toString()), String.format("%.0f", segmentID), String.format("%.2f", (double) bufferSize / (1000 * 1000)), String.format("%.3f", timestamp), String.format("%.3f", play)));
}
};
}
use of com.att.aro.core.videoanalysis.pojo.VideoEvent in project VideoOptimzer by attdevsupport.
the class StartupDelayDialog method updateSegmentSelection.
protected void updateSegmentSelection(double sTime) {
VideoEvent videoEvent;
if ((videoEvent = activeSegmentMap.get(sTime)) == null) {
Double floorKey = activeSegmentMap.floorKey(sTime);
if (floorKey != null) {
videoEvent = activeSegmentMap.get(floorKey);
setTimeJTextField(playRequestedTime, videoEvent.getPlayTime());
}
makeSegmentSelection(activeSegmentList.indexOf(videoEvent));
}
}
use of com.att.aro.core.videoanalysis.pojo.VideoEvent in project VideoOptimzer by attdevsupport.
the class VideoThroughputPlot method calculateThroughPut.
public void calculateThroughPut(SegmentOptions option) {
videoEventSeries.clear();
audioEventSeries.clear();
if (videoStream != null) {
List<Double> throughPutList = new ArrayList<Double>();
List<Double> timestampList = new ArrayList<Double>();
optionSelected = option;
double dlTimeStamp = 0.0;
if (option == SegmentOptions.DEFAULT || option == SegmentOptions.VIDEO) {
for (Entry<String, VideoEvent> videoEventEntry : videoStream.getVideoEventMap().entrySet()) {
VideoEvent videoEvent = videoEventEntry.getValue();
videoEvent.setOption(SegmentOptions.VIDEO.toString());
videoEventList.add(videoEvent);
eventList.add(videoEvent);
double throughPut = getThroughput(videoEvent);
throughPutList.add(throughPut);
dlTimeStamp = videoEvent.getDLTimeStamp();
timestampList.add(dlTimeStamp);
videoEventSeries.add(dlTimeStamp, throughPut);
}
}
if (option == SegmentOptions.DEFAULT || option == SegmentOptions.AUDIO) {
for (Entry<String, VideoEvent> videoEventEntry : videoStream.getAudioEventMap().entrySet()) {
VideoEvent audioEvent = videoEventEntry.getValue();
audioEvent.setOption(SegmentOptions.AUDIO.toString());
audioEventList.add(audioEvent);
eventList.add(audioEvent);
double throughPut = getThroughput(audioEvent);
throughPutList.add(throughPut);
dlTimeStamp = audioEvent.getDLTimeStamp();
timestampList.add(dlTimeStamp);
audioEventSeries.add(dlTimeStamp, throughPut);
}
}
if (optionSelected != SegmentOptions.AUDIO && optionSelected != SegmentOptions.VIDEO) {
if (!videoEventSeries.isEmpty() && !audioEventSeries.isEmpty()) {
isMuxed = false;
} else if (videoEventSeries.isEmpty() || audioEventSeries.isEmpty()) {
isMuxed = true;
}
}
Collections.sort(throughPutList);
minYValue = throughPutList.stream().findFirst().get();
maxYValue = throughPutList.stream().reduce((first, second) -> second).get();
minXValue = timestampList.stream().findFirst().get();
maxXValue = timestampList.stream().reduce((first, second) -> second).get();
}
}
use of com.att.aro.core.videoanalysis.pojo.VideoEvent in project VideoOptimzer by attdevsupport.
the class SegmentTablePanel method updateTitleButton.
public void updateTitleButton(AROTraceData analyzerResult) {
if (titlePanel != null) {
if (analyzerResult.getAnalyzerResult() != null) {
streamingVideoData = analyzerResult.getAnalyzerResult().getStreamingVideoData();
for (VideoStream manifest : streamingVideoData.getVideoStreamMap().values()) {
if (manifest.equals(videoStream) && ((!videoStream.getVideoEventsBySegment().isEmpty()) && ((VideoEvent) videoStream.getVideoEventsBySegment().toArray()[0]).getSegmentID() >= 0)) {
videoStream.setSelected(manifest.isSelected());
enableCheckBox.setSelected(videoStream.isSelected());
streamingVideoData.setValidatedCount(false);
break;
}
}
if (streamingVideoData.getValidatedCount()) {
streamingVideoData.scanVideoStreams();
}
}
}
}
use of com.att.aro.core.videoanalysis.pojo.VideoEvent in project VideoOptimzer by attdevsupport.
the class VideoProgressPlot method getProgress.
private double getProgress(SortedMap<String, VideoEvent> segmentMap, VideoEvent segment, boolean isVideo) {
double downloadProgress = 0.0;
double playtimeProgress = 0.0;
for (VideoEvent event : segmentMap.values()) {
double duration = event.getDuration();
downloadProgress = downloadProgress + duration;
if (event.isSelected() && event.isNormalSegment()) {
playtimeProgress = playtimeProgress + duration;
}
if (segment.equals(event)) {
break;
}
}
downloadProgressMap.put(segment, downloadProgress);
if (isVideo) {
videoPlaytimeSeries.add(segment.getPlayTime(), playtimeProgress);
} else {
audioPlaytimeSeries.add(segment.getPlayTime(), playtimeProgress);
}
timestampList.add(segment.getPlayTime());
progressList.add(downloadProgress);
return downloadProgress;
}
Aggregations