Search in sources :

Example 6 with VideoStall

use of com.att.aro.core.packetanalysis.pojo.VideoStall in project VideoOptimzer by attdevsupport.

the class BufferInSecondsPlot method isDataItemStallPoint.

public VideoEvent isDataItemStallPoint(double xDataValue, double yDataValue) {
    VideoEvent segmentToPlay = null;
    List<VideoStall> videoStallResults = bufferInSecondsCalculatorImpl.getVideoStallResult();
    if (seriesDataSets == null || seriesDataSets.isEmpty()) {
        LOG.error("ERROR: Checking data item/segment for a stall point: dataset is null or empty.");
        return segmentToPlay;
    }
    String[] dataSetArray = seriesDataSets.get(seriesDataSets.size() - 1).split(",");
    if (dataSetArray.length > 1 && dataSetArray[1] != null) {
        if (videoStallResults != null && (!videoStallResults.isEmpty())) {
            VideoStall stallPoint = videoStallResults.get(videoStallResults.size() - 1);
            double lastDataSet_YValue = Double.parseDouble(dataSetArray[1]);
            if ((stallPoint.getStallEndTimestamp() == 0 || stallPoint.getStallEndTimestamp() == stallPoint.getStallEndTimestamp()) && stallPoint.getStallEndTimestamp() == xDataValue && lastDataSet_YValue == yDataValue) {
                segmentToPlay = stallPoint.getSegmentTryingToPlay();
            }
        }
    } else {
        LOG.error("ERROR: Checking data item/segment for a stall point: dataset y-value is null");
    }
    return segmentToPlay;
}
Also used : VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) VideoStall(com.att.aro.core.packetanalysis.pojo.VideoStall)

Example 7 with VideoStall

use of com.att.aro.core.packetanalysis.pojo.VideoStall in project VideoOptimzer by attdevsupport.

the class VideoChunksPlot method populate.

@Override
public void populate(XYPlot plot, AROTraceData traceData) {
    if (traceData != null) {
        StreamingVideoData streamingVideoData = traceData.getAnalyzerResult().getStreamingVideoData();
        if (!isReDraw) {
            bufferOccupancyPlot.clearPlot(this.bufferOccupancyXYPlot);
            bufferInSecondsPlot.clearPlot(this.bufferTimeXYPlot);
            traceData.getAnalyzerResult().setBufferTimeResult(null);
            traceData.getAnalyzerResult().setBufferOccupancyResult(null);
        }
        videoChunksData.removeAllSeries();
        for (XYSeriesCollection seriesColl : startUpDelayCollection) {
            seriesColl.removeAllSeries();
        }
        startUpDelayCollection.clear();
        imgSeries = new ArrayList<BufferedImage>();
        // create the dataset...
        int index = 0;
        series = new XYSeries("Chunks");
        seriesDataSets = new TreeMap<>();
        seriesDataSets = videoChunkPlotter.populateDataSet(traceData.getAnalyzerResult().getStreamingVideoData());
        imgSeries = videoChunkPlotter.getImgSeries();
        filteredChunks = streamingVideoData.getStreamingVideoCompiled().getFilteredSegments();
        segmentsToBePlayed.clear();
        for (VideoEvent ve : streamingVideoData.getStreamingVideoCompiled().getAllSegments()) {
            segmentsToBePlayed.add(ve);
        }
        for (double timeStamp : seriesDataSets.values()) {
            series.add(timeStamp, 0);
        }
        XYSeriesCollection playTimeStartSeries = new XYSeriesCollection();
        int first = 0;
        List<VideoEvent> chunkPlayBackTimeList = new ArrayList<VideoEvent>(chunkPlayTime.keySet());
        Collections.sort(chunkPlayBackTimeList, new VideoEventComparator(SortSelection.SEGMENT_ID));
        if (CollectionUtils.isNotEmpty(chunkPlayBackTimeList)) {
            VideoEvent ve = chunkPlayBackTimeList.get(0);
            seriesStartUpDelay = new XYSeries("StartUpDelay" + (index++));
            seriesStartUpDelay.add(ve.getDLTimeStamp(), 0);
            Double playTime = chunkPlayTime.get(ve);
            if (playTime != null) {
                seriesStartUpDelay.add((double) playTime, 0);
            }
            if (first == 0) {
                StreamingVideoData videoData = traceData.getAnalyzerResult().getStreamingVideoData();
                SortedMap<Double, VideoStream> videoEventList = videoData.getVideoStreamMap();
                Double segPlayTime = chunkPlayTime.get(ve);
                if (segPlayTime != null) {
                    setDelayVideoStream((double) segPlayTime - ve.getEndTS(), videoEventList.values());
                }
            }
            playTimeStartSeries.addSeries(seriesStartUpDelay);
            startUpDelayCollection.add(playTimeStartSeries);
            first++;
        }
        for (VideoStream videoStream : streamingVideoData.getVideoStreams()) {
            if (videoStream.isSelected()) {
                for (VideoStall videoStall : videoStream.getVideoStallList()) {
                    playTimeStartSeries = new XYSeriesCollection();
                    seriesStartUpDelay = new XYSeries("StartUpDelay" + (index++));
                    seriesStartUpDelay.add(videoStall.getStallStartTimestamp(), 0);
                    seriesStartUpDelay.add(videoStall.getStallEndTimestamp(), 0);
                    playTimeStartSeries.addSeries(seriesStartUpDelay);
                    startUpDelayCollection.add(playTimeStartSeries);
                }
            }
        }
        videoChunksData.addSeries(series);
        // Startup and stalls
        VideoChunkImageRenderer renderer = new VideoChunkImageRenderer();
        XYLineAndShapeRenderer rendererDelay = new XYLineAndShapeRenderer();
        for (int idx = 0; idx < startUpDelayCollection.size(); idx++) {
            rendererDelay.setSeriesStroke(idx, new BasicStroke(2.0f));
            rendererDelay.setSeriesPaint(idx, Color.RED);
        }
        renderer.setBaseToolTipGenerator(toolTipGenerator());
        renderer.setSeriesShape(0, shape);
        plot.setRenderer(index, renderer);
        for (int i = 0; i < startUpDelayCollection.size(); i++) {
            plot.setRenderer(i, rendererDelay);
        }
    }
    isReDraw = false;
    int seriesIndex = 0;
    for (XYSeriesCollection seriesColl : startUpDelayCollection) {
        plot.setDataset(seriesIndex, seriesColl);
        seriesIndex++;
    }
    plot.setDataset(seriesIndex, videoChunksData);
}
Also used : XYSeries(org.jfree.data.xy.XYSeries) BasicStroke(java.awt.BasicStroke) XYLineAndShapeRenderer(org.jfree.chart.renderer.xy.XYLineAndShapeRenderer) ArrayList(java.util.ArrayList) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) StreamingVideoData(com.att.aro.core.videoanalysis.pojo.StreamingVideoData) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) VideoEventComparator(com.att.aro.core.videoanalysis.impl.VideoEventComparator) BufferedImage(java.awt.image.BufferedImage) XYSeriesCollection(org.jfree.data.xy.XYSeriesCollection) VideoStall(com.att.aro.core.packetanalysis.pojo.VideoStall)

Aggregations

VideoStall (com.att.aro.core.packetanalysis.pojo.VideoStall)7 VideoEvent (com.att.aro.core.videoanalysis.pojo.VideoEvent)3 ArrayList (java.util.ArrayList)2 DisplayNoneInCSSEntry (com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry)1 ForwardSecrecyEntry (com.att.aro.core.bestpractice.pojo.ForwardSecrecyEntry)1 HttpEntry (com.att.aro.core.bestpractice.pojo.HttpEntry)1 ImageCompressionEntry (com.att.aro.core.bestpractice.pojo.ImageCompressionEntry)1 ImageMdataEntry (com.att.aro.core.bestpractice.pojo.ImageMdataEntry)1 MultipleConnectionsEntry (com.att.aro.core.bestpractice.pojo.MultipleConnectionsEntry)1 SpriteImageEntry (com.att.aro.core.bestpractice.pojo.SpriteImageEntry)1 TransmissionPrivateDataEntry (com.att.aro.core.bestpractice.pojo.TransmissionPrivateDataEntry)1 UnnecessaryConnectionEntry (com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionEntry)1 UnsecureSSLVersionEntry (com.att.aro.core.bestpractice.pojo.UnsecureSSLVersionEntry)1 VideoStallResult (com.att.aro.core.bestpractice.pojo.VideoStallResult)1 CacheEntry (com.att.aro.core.packetanalysis.pojo.CacheEntry)1 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 VideoEventComparator (com.att.aro.core.videoanalysis.impl.VideoEventComparator)1 StreamingVideoData (com.att.aro.core.videoanalysis.pojo.StreamingVideoData)1 VideoStream (com.att.aro.core.videoanalysis.pojo.VideoStream)1