Search in sources :

Example 21 with VideoEvent

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)));
        }
    };
}
Also used : ContentType(com.att.aro.core.videoanalysis.pojo.Manifest.ContentType) XYDataset(org.jfree.data.xy.XYDataset) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) XYToolTipGenerator(org.jfree.chart.labels.XYToolTipGenerator)

Example 22 with VideoEvent

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));
    }
}
Also used : VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent)

Example 23 with 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();
    }
}
Also used : ArrayList(java.util.ArrayList) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent)

Example 24 with VideoEvent

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();
            }
        }
    }
}
Also used : VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent)

Example 25 with VideoEvent

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;
}
Also used : VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent)

Aggregations

VideoEvent (com.att.aro.core.videoanalysis.pojo.VideoEvent)48 VideoStream (com.att.aro.core.videoanalysis.pojo.VideoStream)19 ArrayList (java.util.ArrayList)12 TreeMap (java.util.TreeMap)7 BPResultType (com.att.aro.core.bestpractice.pojo.BPResultType)5 VideoStall (com.att.aro.core.packetanalysis.pojo.VideoStall)5 StreamingVideoData (com.att.aro.core.videoanalysis.pojo.StreamingVideoData)5 HashMap (java.util.HashMap)4 List (java.util.List)4 XYDataset (org.jfree.data.xy.XYDataset)4 AbstractTraceResult (com.att.aro.core.packetanalysis.pojo.AbstractTraceResult)3 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)3 UserEvent (com.att.aro.core.peripheral.pojo.UserEvent)3 VideoStreamStartup (com.att.aro.core.peripheral.pojo.VideoStreamStartup)3 VideoStreamStartupData (com.att.aro.core.peripheral.pojo.VideoStreamStartupData)3 DUPLICATE_HANDLING (com.att.aro.core.videoanalysis.pojo.VideoUsagePrefs.DUPLICATE_HANDLING)3 Collections (java.util.Collections)3 StringUtils (org.apache.commons.lang.StringUtils)3 LogManager (org.apache.log4j.LogManager)3 Logger (org.apache.log4j.Logger)3