Search in sources :

Example 1 with VideoConcurrentSession

use of com.att.aro.core.bestpractice.pojo.VideoConcurrentSession in project VideoOptimzer by attdevsupport.

the class BPVideoConcurrentSessionTablePanel method getContentTable.

@SuppressWarnings("unchecked")
public DataTable<VideoConcurrentSession> getContentTable() {
    if (contentTable == null) {
        contentTable = new DataTable<VideoConcurrentSession>(tableModel);
        contentTable.setName(ResourceBundleHelper.getMessageString("video.concurrent.session.tableName"));
        contentTable.setAutoCreateRowSorter(true);
        contentTable.setGridColor(Color.LIGHT_GRAY);
        contentTable.setRowHeight(ROW_HEIGHT);
        contentTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) contentTable.getPopup();
        popupMenu.initialize();
    }
    return contentTable;
}
Also used : VideoConcurrentSession(com.att.aro.core.bestpractice.pojo.VideoConcurrentSession) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu)

Example 2 with VideoConcurrentSession

use of com.att.aro.core.bestpractice.pojo.VideoConcurrentSession in project VideoOptimzer by attdevsupport.

the class VideoConcurrentSessionImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    result = new VideoConcurrentSessionResult();
    init(result);
    if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
        bpResultType = BPResultType.CONFIG_REQUIRED;
        result.setResultExcelText(bpResultType.getDescription());
        selectedManifestCount = streamingVideoData.getSelectedManifestCount();
        hasSelectedManifest = (selectedManifestCount > 0);
        invalidCount = streamingVideoData.getInvalidManifestCount();
        if (selectedManifestCount == 0) {
            if (invalidCount == videoStreamCollection.size()) {
                result.setResultText(invalidManifestsFound);
            } else if (invalidCount > 0) {
                result.setResultText(noManifestsSelectedMixed);
            } else {
                result.setResultText(noManifestsSelected);
            }
        } else if (selectedManifestCount > 1) {
            result.setResultText(multipleManifestsSelected);
        } else if (hasSelectedManifest) {
            bpResultType = BPResultType.SELF_TEST;
            int maxManifestConcurrentSessions = 0;
            List<VideoConcurrentSession> manifestConcurrency = new ArrayList<VideoConcurrentSession>();
            manifestConcurrency = manifestConcurrentSessions(videoStreamCollection);
            result.setResults(manifestConcurrency);
            for (VideoConcurrentSession manifestSession : manifestConcurrency) {
                if (maxManifestConcurrentSessions < manifestSession.getConcurrentSessionCount()) {
                    maxManifestConcurrentSessions = manifestSession.getConcurrentSessionCount();
                }
            }
            result.setMaxConcurrentSessionCount(maxManifestConcurrentSessions);
            if (maxManifestConcurrentSessions > 0) {
                result.setResultText(MessageFormat.format(textResults, maxManifestConcurrentSessions));
            } else {
                result.setResultText(nonConcurrent);
            }
            result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), maxManifestConcurrentSessions));
            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 : VideoConcurrentSession(com.att.aro.core.bestpractice.pojo.VideoConcurrentSession) ArrayList(java.util.ArrayList) VideoConcurrentSessionResult(com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult)

Example 3 with VideoConcurrentSession

use of com.att.aro.core.bestpractice.pojo.VideoConcurrentSession in project VideoOptimzer by attdevsupport.

the class VideoConcurrentSessionImpl method findConcurrency.

private VideoConcurrentSession findConcurrency(ArrayList<Double> sessionStartTimes, ArrayList<Double> sessionEndTimes) {
    int maxConcurrentSessions = 0;
    VideoConcurrentSession concurrentSession = null;
    if (sessionStartTimes.size() > 0) {
        int startTimeCounter = 0;
        int endTimeCounter = 0;
        int currentOverlap = 0;
        Collections.sort(sessionStartTimes);
        Collections.sort(sessionEndTimes);
        int startTimePointer = sessionStartTimes.size();
        int endTimePointer = sessionEndTimes.size();
        while (startTimeCounter < startTimePointer && endTimeCounter < endTimePointer) {
            if (sessionStartTimes.get(startTimeCounter) < sessionEndTimes.get(endTimeCounter)) {
                Double duration = sessionEndTimes.get(endTimeCounter) - sessionStartTimes.get(startTimeCounter);
                currentOverlap++;
                startTimeCounter++;
                if (maxConcurrentSessions <= currentOverlap && currentOverlap > 1) {
                    if (concurrentSession != null) {
                        if (concurrentSession.getConcurrentSessionCount() == currentOverlap) {
                            duration = duration + concurrentSession.getConcurrencyDuration();
                        }
                        concurrentSession.setCountDuration(currentOverlap, duration);
                    } else {
                        concurrentSession = new VideoConcurrentSession(currentOverlap, duration);
                    }
                }
                if (maxConcurrentSessions < currentOverlap) {
                    maxConcurrentSessions = currentOverlap;
                }
            } else {
                currentOverlap--;
                endTimeCounter++;
            }
        }
    }
    return concurrentSession;
}
Also used : VideoConcurrentSession(com.att.aro.core.bestpractice.pojo.VideoConcurrentSession)

Example 4 with VideoConcurrentSession

use of com.att.aro.core.bestpractice.pojo.VideoConcurrentSession in project VideoOptimzer by attdevsupport.

the class VideoConcurrentSessionImpl method manifestConcurrentSessions.

public List<VideoConcurrentSession> manifestConcurrentSessions(SortedMap<Double, VideoStream> videoStreamMap) {
    List<VideoConcurrentSession> concurrentSessionList = new ArrayList<VideoConcurrentSession>();
    if (MapUtils.isNotEmpty(videoStreamCollection)) {
        for (VideoStream videoStream : videoStreamMap.values()) {
            if (videoStream.isSelected()) {
                ArrayList<Double> sessionStartTimes = new ArrayList<>();
                ArrayList<Double> sessionEndTimes = new ArrayList<>();
                ArrayList<Session> sessionList = new ArrayList<>();
                SortedMap<String, VideoEvent> videoEventList = videoStream.getVideoEventMap();
                for (VideoEvent veEntry : videoEventList.values()) {
                    Session session = veEntry.getSession();
                    if (!sessionList.contains(session)) {
                        sessionList.add(session);
                        sessionStartTimes.add(session.getSessionStartTime());
                        sessionEndTimes.add(session.getSessionEndTime());
                    }
                }
                VideoConcurrentSession videoConcurrentSession = findConcurrency(sessionStartTimes, sessionEndTimes);
                if (videoConcurrentSession != null && videoConcurrentSession.getConcurrentSessionCount() > 0) {
                    videoConcurrentSession.setVideoName(videoStream.getManifest().getVideoName());
                    concurrentSessionList.add(videoConcurrentSession);
                }
            }
        }
    }
    return concurrentSessionList;
}
Also used : VideoConcurrentSession(com.att.aro.core.bestpractice.pojo.VideoConcurrentSession) ArrayList(java.util.ArrayList) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) Session(com.att.aro.core.packetanalysis.pojo.Session) VideoConcurrentSession(com.att.aro.core.bestpractice.pojo.VideoConcurrentSession)

Aggregations

VideoConcurrentSession (com.att.aro.core.bestpractice.pojo.VideoConcurrentSession)4 ArrayList (java.util.ArrayList)2 VideoConcurrentSessionResult (com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 VideoEvent (com.att.aro.core.videoanalysis.pojo.VideoEvent)1 VideoStream (com.att.aro.core.videoanalysis.pojo.VideoStream)1 DataTablePopupMenu (com.att.aro.ui.model.DataTablePopupMenu)1