Search in sources :

Example 6 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class VideoTcpConnectionImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    BPResultType bpResultType = BPResultType.SELF_TEST;
    VideoTcpConnectionResult result = new VideoTcpConnectionResult();
    int sessionCount = 0;
    init(result);
    if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
        selectedCount = streamingVideoData.getSelectedManifestCount();
        invalidCount = streamingVideoData.getInvalidManifestCount();
        if (selectedCount == 0) {
            if (invalidCount == videoStreamCollection.size()) {
                result.setResultText(invalidStreamsFound);
            } else if (invalidCount > 0) {
                result.setResultText(noStreamsSelectedMixed);
            } else {
                result.setResultText(noStreamsSelected);
            }
            bpResultType = BPResultType.CONFIG_REQUIRED;
            result.setResultExcelText(bpResultType.getDescription());
            result.setSelfTest(false);
        } else if (selectedCount > 1) {
            bpResultType = BPResultType.CONFIG_REQUIRED;
            result.setResultText(multipleStreamsSelected);
            result.setResultExcelText(bpResultType.getDescription());
            result.setSelfTest(false);
        } else {
            ArrayList<Session> uniqVideoSessions = new ArrayList<>();
            ArrayList<Session> uniqAudioSessions = new ArrayList<>();
            for (VideoStream videoStream : videoStreamCollection.values()) {
                if (videoStream.isSelected() && !videoStream.getVideoEventMap().isEmpty()) {
                    for (VideoEvent videoEvent : videoStream.getVideoEventMap().values()) {
                        if (!uniqVideoSessions.contains(videoEvent.getSession())) {
                            uniqVideoSessions.add(videoEvent.getSession());
                        }
                    }
                    for (VideoEvent videoEvent : videoStream.getAudioSegmentEventList().values()) {
                        if (!uniqAudioSessions.contains(videoEvent.getSession())) {
                            uniqAudioSessions.add(videoEvent.getSession());
                        }
                    }
                }
            }
            sessionCount = uniqVideoSessions.size() > uniqAudioSessions.size() ? uniqVideoSessions.size() : uniqAudioSessions.size();
            bpResultType = BPResultType.SELF_TEST;
            result.setResultText(MessageFormat.format(textResults, ApplicationConfig.getInstance().getAppShortName(), sessionCount, sessionCount == 1 ? "" : "s"));
            result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), sessionCount));
            result.setTcpConnections(sessionCount);
            result.setSelfTest(true);
        }
    } else {
        result.setSelfTest(false);
        result.setResultText(noData);
        bpResultType = BPResultType.NO_DATA;
        result.setResultExcelText(bpResultType.getDescription());
    }
    result.setResultType(bpResultType);
    return result;
}
Also used : BPResultType(com.att.aro.core.bestpractice.pojo.BPResultType) ArrayList(java.util.ArrayList) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) VideoTcpConnectionResult(com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult)

Example 7 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class AbstractBufferOccupancyCalculator method runInit.

/**
 * @param streamingVideoData seems to be
 * 	streamingVideoData.getStreamingVideoCompiled().getChunksBySegmentID()
 * or
 *  Collections.sort(filteredSegments, new VideoEventComparator(SortSelection.SEGMENT_ID));
 * @param segmentCollection
 */
protected void runInit(StreamingVideoData streamingVideoData, List<VideoEvent> segmentCollection) {
    if (!CollectionUtils.isEmpty(segmentCollection)) {
        for (VideoStream videoStream : streamingVideoData.getVideoStreamMap().values()) {
            if (videoStream.isSelected()) {
                chunkPlaying = firstChunk = segmentCollection.get(0);
                chunkPlayStartTime = firstChunk.getPlayTime();
                chunkPlayEndTime = firstChunk.getPlayTimeEnd();
                startPoint = firstChunk.getDLTimeStamp();
                setStreamingVideoData(streamingVideoData);
                break;
            }
        }
    }
}
Also used : VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream)

Example 8 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class PlotHelperAbstract method videoEventListBySegment.

public List<VideoEvent> videoEventListBySegment(StreamingVideoData streamingVideoData) {
    this.streamingVideoData = streamingVideoData;
    // new ArrayList<>();
    List<VideoEvent> chunksBySegmentID = streamingVideoData.getStreamingVideoCompiled().getChunksBySegmentID();
    chunksBySegmentID.clear();
    for (VideoStream videoStream : streamingVideoData.getVideoStreamMap().values()) {
        if (videoStream.isSelected() && !videoStream.getVideoEventsBySegment().isEmpty()) {
            for (VideoEvent videoEvent : videoStream.getVideoEventsBySegment()) {
                if (videoEvent.isNormalSegment()) {
                    chunksBySegmentID.add(videoEvent);
                }
            }
        }
    }
    for (VideoEvent ve : streamingVideoData.getStreamingVideoCompiled().getDeleteChunkList()) {
        chunksBySegmentID.remove(ve);
    }
    Collections.sort(chunksBySegmentID, new VideoEventComparator(SortSelection.SEGMENT_ID));
    return chunksBySegmentID;
}
Also used : VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) VideoEventComparator(com.att.aro.core.videoanalysis.impl.VideoEventComparator)

Example 9 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class GraphPanel method refresh.

// In 4.1.1, the method name is resetChart(TraceData.Analysis analysis)
public void refresh(AROTraceData aroTraceData) {
    getSaveGraphButton().setEnabled(aroTraceData != null);
    if (combinedPlot != null) {
        setGraphView(combinedPlot.getDomainCrosshairValue(), true);
    } else {
        setGraphView(0, true);
    }
    setTraceData(aroTraceData);
    if (aroTraceData != null) {
        setAllPackets(aroTraceData.getAnalyzerResult().getTraceresult().getAllpackets());
        setTraceDuration(aroTraceData.getAnalyzerResult().getTraceresult().getTraceDuration());
        // list
        setAllTcpSessions(aroTraceData.getAnalyzerResult().getSessionlist().size());
    // length
    } else {
        setAllPackets(new LinkedList<PacketInfo>());
        setTraceDuration(0);
        setAllTcpSessions(0);
    }
    if (aroTraceData != null && aroTraceData.getAnalyzerResult().getFilter() != null && aroTraceData.getAnalyzerResult().getFilter().getTimeRange() != null) {
        if (aroTraceData.getAnalyzerResult().getSessionlist().size() > 0 && aroTraceData.getAnalyzerResult().getFilter().getTimeRange().getBeginTime() < aroTraceData.getAnalyzerResult().getFilter().getTimeRange().getEndTime()) {
            getAxis().setRange(new Range(aroTraceData.getAnalyzerResult().getFilter().getTimeRange().getBeginTime(), aroTraceData.getAnalyzerResult().getFilter().getTimeRange().getEndTime()));
        } else {
            getAxis().setRange(new Range(-0.01, 0));
        }
    } else {
        if (getEndTime() > 0) {
            if (aroTraceData != null) {
                getAxis().setRange(new Range(getStartTime(), getEndTime()));
            }
            // Reset times
            setStartTime(0.0);
            setEndTime(0.0);
        } else {
            getAxis().setRange(new Range(-0.01, aroTraceData != null ? aroTraceData.getAnalyzerResult().getTraceresult().getTraceDuration() : DEFAULT_TIMELINE));
        }
    }
    if (aroTraceData != null && aroTraceData.getAnalyzerResult().getSessionlist().size() > 0) {
        for (Map.Entry<ChartPlotOptions, GraphPanelPlotLabels> entry : getSubplotMap().entrySet()) {
            switch(entry.getKey()) {
                case THROUGHPUT:
                    if (throughput == null) {
                        throughput = new ThroughputPlot();
                    }
                    throughput.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case BURSTS:
                    if (burstPlot == null) {
                        burstPlot = new BurstPlot();
                    }
                    // burstPlot = new BurstPlot();
                    burstPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case RRC:
                    if (rrcPlot == null) {
                        rrcPlot = new RrcPlot();
                    }
                    rrcPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case USER_INPUT:
                    if (eventPlot == null) {
                        eventPlot = new UserEventPlot();
                    }
                    eventPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case DL_PACKETS:
                    if (dlPlot == null) {
                        dlPlot = new DLPacketPlot();
                    }
                    dlPlot.populate(entry.getValue().getPlot(), aroTraceData, true);
                    break;
                case UL_PACKETS:
                    if (upPlot == null) {
                        upPlot = new DLPacketPlot();
                    }
                    upPlot.populate(entry.getValue().getPlot(), aroTraceData, false);
                    break;
                case ALARM:
                    if (alarmPlot == null) {
                        alarmPlot = new AlarmPlot();
                    }
                    alarmPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case GPS:
                    if (gpsPlot == null) {
                        gpsPlot = new GpsPlot();
                    }
                    gpsPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case RADIO:
                    if (radioPlot == null) {
                        radioPlot = new RadioPlot();
                    }
                    radioPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case CPU:
                    if (cpuPlot == null) {
                        cpuPlot = new CpuPlot();
                    }
                    cpuPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case SCREEN:
                    if (ssPlot == null) {
                        ssPlot = new ScreenStatePlot();
                    }
                    ssPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case BATTERY:
                    if (bPlot == null) {
                        bPlot = new BatteryPlot();
                    }
                    bPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case TEMPERATURE:
                    if (tPlot == null) {
                        tPlot = new TemperaturePlot();
                    }
                    tPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case BLUETOOTH:
                    if (bluetoothPlot == null) {
                        bluetoothPlot = new BluetoothPlot();
                    }
                    bluetoothPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case WIFI:
                    if (wPlot == null) {
                        wPlot = new WifiPlot();
                    }
                    wPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case CAMERA:
                    if (cPlot == null) {
                        cPlot = new CameraPlot();
                    }
                    cPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case NETWORK_TYPE:
                    if (ntPlot == null) {
                        ntPlot = new NetworkTypePlot();
                    }
                    ntPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case WAKELOCK:
                    if (wlPlot == null) {
                        wlPlot = new WakeLockPlot();
                    }
                    wlPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case ATTENUATION:
                    if (attnrPlot == null) {
                        attnrPlot = new AttenuatorPlot();
                    }
                    attnrPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case SPEED_THROTTLE:
                    if (stPlot == null) {
                        stPlot = new SpeedThrottlePlot();
                    }
                    stPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case VIDEO_CHUNKS:
                    if (vcPlot == null) {
                        vcPlot = new VideoChunksPlot();
                    }
                    XYPlot bufferOccupancyPlot = getSubplotMap().get(ChartPlotOptions.BUFFER_OCCUPANCY).getPlot();
                    XYPlot bufferTimePlot = getSubplotMap().get(ChartPlotOptions.BUFFER_TIME_OCCUPANCY).getPlot();
                    this.chunkInfo.clear();
                    vcPlot.setBufferOccupancyPlot(bufferOccupancyPlot);
                    vcPlot.setBufferTimePlot(bufferTimePlot);
                    VideoStream selectedStream = null;
                    int count = 0;
                    StreamingVideoData streamingVideoData = aroTraceData.getAnalyzerResult().getStreamingVideoData();
                    if (streamingVideoData != null) {
                        for (VideoStream videoStream : streamingVideoData.getVideoStreamMap().values()) {
                            if (videoStream != null && videoStream.isSelected()) {
                                selectedStream = videoStream;
                                count++;
                            }
                        }
                        if (count == 1 && selectedStream != null && selectedStream.getManifest().getDelay() != 0) {
                            VideoEvent firstSegment = (VideoEvent) selectedStream.getVideoEventsBySegment().toArray()[0];
                            if (selectedStream.getManifest().getVideoFormat() == VideoFormat.MPEG4) {
                                for (VideoEvent video : selectedStream.getVideoEventsBySegment()) {
                                    if (video.getSegmentID() != 0) {
                                        firstSegment = video;
                                        break;
                                    }
                                }
                            }
                            vcPlot.refreshPlot(getSubplotMap().get(ChartPlotOptions.VIDEO_CHUNKS).getPlot(), aroTraceData, selectedStream.getManifest().getDelay() + firstSegment.getEndTS(), firstSegment);
                        } else {
                            vcPlot.populate(entry.getValue().getPlot(), aroTraceData);
                        }
                    }
                    break;
                case CONNECTIONS:
                    connectionsPlot = new ConnectionsPlot();
                    connectionsPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case LATENCY:
                    if (latencyplot == null) {
                        latencyplot = new LatencyPlot();
                    }
                    latencyplot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                default:
                    break;
            }
        }
    }
    getZoomInButton().setEnabled(aroTraceData != null);
    getZoomOutButton().setEnabled(aroTraceData != null);
    getSaveGraphButton().setEnabled(aroTraceData != null);
    if (aroTraceData != null) {
        parent.getDeviceNetworkProfilePanel().refresh(aroTraceData);
    }
}
Also used : WifiPlot(com.att.aro.ui.view.diagnostictab.plot.WifiPlot) RadioPlot(com.att.aro.ui.view.diagnostictab.plot.RadioPlot) ThroughputPlot(com.att.aro.ui.view.diagnostictab.plot.ThroughputPlot) TemperaturePlot(com.att.aro.ui.view.diagnostictab.plot.TemperaturePlot) StreamingVideoData(com.att.aro.core.videoanalysis.pojo.StreamingVideoData) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) BluetoothPlot(com.att.aro.ui.view.diagnostictab.plot.BluetoothPlot) ConnectionsPlot(com.att.aro.ui.view.diagnostictab.plot.ConnectionsPlot) WakeLockPlot(com.att.aro.ui.view.diagnostictab.plot.WakeLockPlot) DLPacketPlot(com.att.aro.ui.view.diagnostictab.plot.DLPacketPlot) ScreenStatePlot(com.att.aro.ui.view.diagnostictab.plot.ScreenStatePlot) BurstPlot(com.att.aro.ui.view.diagnostictab.plot.BurstPlot) AttenuatorPlot(com.att.aro.ui.view.diagnostictab.plot.AttenuatorPlot) SpeedThrottlePlot(com.att.aro.ui.view.diagnostictab.plot.SpeedThrottlePlot) LatencyPlot(com.att.aro.ui.view.diagnostictab.plot.LatencyPlot) RrcPlot(com.att.aro.ui.view.diagnostictab.plot.RrcPlot) CameraPlot(com.att.aro.ui.view.diagnostictab.plot.CameraPlot) NetworkTypePlot(com.att.aro.ui.view.diagnostictab.plot.NetworkTypePlot) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoChunksPlot(com.att.aro.ui.view.diagnostictab.plot.VideoChunksPlot) TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) Range(org.jfree.data.Range) Point(java.awt.Point) BatteryPlot(com.att.aro.ui.view.diagnostictab.plot.BatteryPlot) XYPlot(org.jfree.chart.plot.XYPlot) CombinedDomainXYPlot(org.jfree.chart.plot.CombinedDomainXYPlot) AlarmPlot(com.att.aro.ui.view.diagnostictab.plot.AlarmPlot) GpsPlot(com.att.aro.ui.view.diagnostictab.plot.GpsPlot) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) Map(java.util.Map) EnumMap(java.util.EnumMap) TreeMap(java.util.TreeMap) UserEventPlot(com.att.aro.ui.view.diagnostictab.plot.UserEventPlot) CpuPlot(com.att.aro.ui.view.diagnostictab.plot.CpuPlot)

Example 10 with VideoStream

use of com.att.aro.core.videoanalysis.pojo.VideoStream in project VideoOptimzer by attdevsupport.

the class SliderDialogBox method getSetButtonListener.

public ActionListener getSetButtonListener(final VideoChunksPlot vcPlot) {
    return new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            ComboManifest comboBoxItem = (ComboManifest) jcb.getSelectedItem();
            if (segmentChosen != null && segmentChosen.isSelected && (comboBoxItem.getVideoStream() != null)) {
                dispose();
                try {
                    LOGGER.info("startTimeField :" + startTimeField.getText());
                    setStartTime(Double.valueOf(startTimeField.getText()));
                } catch (NumberFormatException e1) {
                // covers user entered bad data, just go with getStartTime()
                }
                try {
                    if (getStartTime() >= segmentChosen.getVideoEvent().getEndTS() && segmentChosen.isSelected) {
                        ComboManifest selectedStream = (ComboManifest) jcb.getSelectedItem();
                        if (selectedStream.getVideoStream() != null) {
                            VideoStream videoStream = selectedStream.getVideoStream();
                            segmentChosen.getVideoEvent().setPlayTime(getStartTime());
                            videoStream.getManifest().setDelay(getStartTime() - segmentChosen.getVideoEvent().getEndTS());
                            videoStream.getManifest().setStartupVideoEvent(segmentChosen.getVideoEvent());
                            videoStream.getManifest().setStartupDelay(segmentChosen.getVideoEvent().getSegmentStartTime() - videoStream.getManifest().getRequestTime());
                            LOGGER.info(String.format("Segment playTime = %.03f", segmentChosen.getVideoEvent().getPlayTime()));
                            startTimeField.setText(String.format("%.03f", segmentChosen.getVideoEvent().getPlayTime()));
                            revalidate();
                            for (VideoStream stream : streamingVideoData.getVideoStreamMap().values()) {
                                if (stream.equals(videoStream)) {
                                    stream.setSelected(true);
                                } else {
                                    stream.setSelected(false);
                                }
                            }
                        } else {
                            for (VideoStream stream : streamingVideoData.getVideoStreamMap().values()) {
                                if (stream.isSelected()) {
                                    stream.getManifest().setDelay(getStartTime() - segmentChosen.getVideoEvent().getEndTS());
                                }
                            }
                        }
                        AROTraceData aroTraceData = mainFrame.getController().getTheModel();
                        streamingVideoData.scanVideoStreams();
                        IVideoBestPractices videoBestPractices = ContextAware.getAROConfigContext().getBean(IVideoBestPractices.class);
                        videoBestPractices.analyze(aroTraceData);
                        mainFrame.getDiagnosticTab().getGraphPanel().refresh(aroTraceData);
                        getGraphPanel().setTraceData(aroTraceData);
                        AROTraceData traceData = vcPlot.refreshPlot(getGraphPanel().getSubplotMap().get(ChartPlotOptions.VIDEO_CHUNKS).getPlot(), getGraphPanel().getTraceData(), getStartTime(), segmentChosen.getVideoEvent());
                        getGraphPanel().setTraceData(traceData);
                        mainFrame.getVideoTab().refresh(traceData);
                    }
                } catch (Exception ex) {
                    LOGGER.error("Error generating video chunk and buffer plots", ex);
                    MessageDialogFactory.showMessageDialog(parentPanel, "Error in drawing buffer graphs", "Failed to generate buffer plots", JOptionPane.ERROR_MESSAGE);
                }
            } else {
                showWarningMessage();
            }
        }
    };
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) IVideoBestPractices(com.att.aro.core.IVideoBestPractices) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) AROTraceData(com.att.aro.core.pojo.AROTraceData)

Aggregations

VideoStream (com.att.aro.core.videoanalysis.pojo.VideoStream)33 VideoEvent (com.att.aro.core.videoanalysis.pojo.VideoEvent)19 ArrayList (java.util.ArrayList)13 BPResultType (com.att.aro.core.bestpractice.pojo.BPResultType)6 StreamingVideoData (com.att.aro.core.videoanalysis.pojo.StreamingVideoData)6 XYPair (com.att.aro.core.videoanalysis.XYPair)5 List (java.util.List)5 TreeMap (java.util.TreeMap)5 AbstractTraceResult (com.att.aro.core.packetanalysis.pojo.AbstractTraceResult)3 Session (com.att.aro.core.packetanalysis.pojo.Session)3 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)3 VideoStall (com.att.aro.core.packetanalysis.pojo.VideoStall)3 DUPLICATE_HANDLING (com.att.aro.core.videoanalysis.pojo.VideoUsagePrefs.DUPLICATE_HANDLING)3 Collections (java.util.Collections)3 HashMap (java.util.HashMap)3 StringUtils (org.apache.commons.lang.StringUtils)3 LogManager (org.apache.log4j.LogManager)3 Logger (org.apache.log4j.Logger)3 XYSeries (org.jfree.data.xy.XYSeries)3 Autowired (org.springframework.beans.factory.annotation.Autowired)3