Search in sources :

Example 1 with VideoRedundancyResult

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

the class VideoResultSummary method populateSummary.

private void populateSummary(AROTraceData trace) {
    for (AbstractBestPracticeResult bpResult : trace.getBestPracticeResults()) {
        if (bpResult.getClass().getName().contains("AROServiceImpl")) {
            continue;
        }
        BestPracticeType bpType = bpResult.getBestPracticeType();
        switch(bpType) {
            case VIDEO_STALL:
                VideoStallResult result = (VideoStallResult) bpResult;
                stalls = result.getStallResult();
                break;
            case NETWORK_COMPARISON:
                VideoNetworkComparisonResult ntkResult = (VideoNetworkComparisonResult) bpResult;
                ntkComparison = ntkResult.getAvgKbps();
                break;
            case TCP_CONNECTION:
                VideoTcpConnectionResult tcpResult = (VideoTcpConnectionResult) bpResult;
                tcpConnection = tcpResult.getTcpConnections();
                break;
            case BUFFER_OCCUPANCY:
                BufferOccupancyResult bufferResult = (BufferOccupancyResult) bpResult;
                bufferOccupancy = bufferResult.getMaxBuffer();
                populateBufferResult(bufferResult);
                break;
            case CHUNK_SIZE:
                VideoChunkSizeResult segmentSizeResult = (VideoChunkSizeResult) bpResult;
                segmentSize = segmentSizeResult.getSegmentSize();
                segmentCount = segmentSizeResult.getSegmentCount();
                break;
            case CHUNK_PACING:
                VideoChunkPacingResult segmentPacingResult = (VideoChunkPacingResult) bpResult;
                segmentPacing = segmentPacingResult.getChunkPacing();
                break;
            case VIDEO_REDUNDANCY:
                VideoRedundancyResult redundancyResult = (VideoRedundancyResult) bpResult;
                duplicate = redundancyResult.getCountDuplicate();
                redundancy = redundancyResult.getRedundantPercentage();
                break;
            case STARTUP_DELAY:
                VideoStartUpDelayResult startupDelayResult = (VideoStartUpDelayResult) bpResult;
                startUpDelay = startupDelayResult.getStartUpDelay();
                break;
            case VIDEO_CONCURRENT_SESSION:
                VideoConcurrentSessionResult concurrentSessionResult = (VideoConcurrentSessionResult) bpResult;
                concurrentSessions = concurrentSessionResult.getMaxConcurrentSessionCount();
                break;
            default:
                break;
        }
    }
    List<Session> allSessions = trace.getAnalyzerResult().getSessionlist();
    Map<InetAddress, List<Session>> ipSessionsMap = new HashMap<InetAddress, List<Session>>();
    for (Session session : allSessions) {
        InetAddress ipAddress = session.getRemoteIP();
        if (ipSessionsMap.containsKey(ipAddress)) {
            ipSessionsMap.get(ipAddress).add(session);
        } else {
            List<Session> sess = new ArrayList<Session>();
            sess.add(session);
            ipSessionsMap.put(ipAddress, sess);
        }
    }
    ipAddress = ipSessionsMap.keySet().size();
    ipSessions = allSessions.size();
    StreamingVideoData streamingVideoData;
    if ((streamingVideoData = trace.getAnalyzerResult().getStreamingVideoData()) == null) {
        return;
    }
    Collection<VideoStream> selectedVideoStreams = streamingVideoData.getVideoStreams();
    movieMBytes = calculateMBytes(selectedVideoStreams, false);
    totalMBytes = calculateMBytes(selectedVideoStreams, true);
    if (trace.getAnalyzerResult().getStreamingVideoData().getStreamingVideoCompiled().getChunkPlayTimeList().isEmpty()) {
        startupDelayStatus = false;
    } else {
        startupDelayStatus = true;
    }
}
Also used : VideoRedundancyResult(com.att.aro.core.bestpractice.pojo.VideoRedundancyResult) HashMap(java.util.HashMap) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) VideoNetworkComparisonResult(com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult) ArrayList(java.util.ArrayList) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) BestPracticeType(com.att.aro.core.bestpractice.pojo.BestPracticeType) VideoStallResult(com.att.aro.core.bestpractice.pojo.VideoStallResult) VideoConcurrentSessionResult(com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult) StreamingVideoData(com.att.aro.core.videoanalysis.pojo.StreamingVideoData) VideoTcpConnectionResult(com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult) BufferOccupancyResult(com.att.aro.core.bestpractice.pojo.BufferOccupancyResult) ArrayList(java.util.ArrayList) List(java.util.List) VideoChunkPacingResult(com.att.aro.core.bestpractice.pojo.VideoChunkPacingResult) VideoChunkSizeResult(com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult) VideoStartUpDelayResult(com.att.aro.core.bestpractice.pojo.VideoStartUpDelayResult) InetAddress(java.net.InetAddress) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 2 with VideoRedundancyResult

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

the class VideoRedundancyImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    result = new VideoRedundancyResult();
    init(result);
    if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
        bpResultType = BPResultType.CONFIG_REQUIRED;
        result.setResultExcelText(BPResultType.CONFIG_REQUIRED.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) {
            for (VideoStream videoStream : videoStreamCollection.values()) {
                if (videoStream.isSelected()) {
                    countDuplicateChunks(videoStream);
                    break;
                }
            }
            redundantPercentage = calculateRedundantPercentage(countRedundant, countSegment);
            bpResultType = Util.checkPassFailorWarning(redundantPercentage, videoPref.getVideoUsagePreference().getSegmentRedundancyWarnVal(), videoPref.getVideoUsagePreference().getSegmentRedundancyFailVal());
            result.setResultType(bpResultType);
            // TODO: Validate the logic
            if (redundantPercentage != 0.0) {
                result.setResultText(MessageFormat.format(textResults, (String.format("%d", redundantPercentage))));
                result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), String.format("%d", redundantPercentage)));
            } else {
                result.setResultText(MessageFormat.format(textResultPass, redundantPercentage));
                result.setResultExcelText(bpResultType.getDescription());
            }
            result.setRedundantPercentage(redundantPercentage);
            result.setSegmentCount(countSegment);
            result.setRedundantCount(countRedundant);
            result.setDuplicateCount(countDuplicate);
            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 : VideoRedundancyResult(com.att.aro.core.bestpractice.pojo.VideoRedundancyResult) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream)

Example 3 with VideoRedundancyResult

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

the class VideoBestPractices method analyze.

public AROTraceData analyze(AROTraceData traceDataresult) {
    PacketAnalyzerResult result = null;
    if (null == traceDataresult) {
        return null;
    }
    result = traceDataresult.getAnalyzerResult();
    if (result == null) {
        return null;
    }
    VideoStallResult videoStallResult = null;
    VideoStartUpDelayResult videoStartUpDelayResult = null;
    BufferOccupancyResult bufferOccupancyResult = null;
    VideoNetworkComparisonResult videoNetworkComparisonResult = null;
    VideoTcpConnectionResult videoTcpConnectionResult = null;
    VideoChunkSizeResult videoChunkSizeResult = null;
    VideoChunkPacingResult videoChunkPacingResult = null;
    VideoRedundancyResult videoRedundancyResult = null;
    VideoConcurrentSessionResult videoConcurrentSessionResult = null;
    VideoVariableBitrateResult videoVariableBitrateResult = null;
    VideoAdaptiveBitrateLadderResult videoSegmentQualityResult = null;
    VideoResolutionQualityResult videoResolutionQualityResult = null;
    AudioStreamResult videoSeparateAudioResult = null;
    List<BestPracticeType> requests = BestPracticeType.getByCategory(Category.VIDEO);
    List<AbstractBestPracticeResult> bpResults = traceDataresult.getBestPracticeResults();
    List<AbstractBestPracticeResult> videoBestPracticeResults = aroService.analyze(result, requests);
    for (AbstractBestPracticeResult videoBPResult : videoBestPracticeResults) {
        BestPracticeType bpType = videoBPResult.getBestPracticeType();
        switch(bpType) {
            case VIDEO_STALL:
                videoStallResult = (VideoStallResult) videoBPResult;
                break;
            case STARTUP_DELAY:
                videoStartUpDelayResult = (VideoStartUpDelayResult) videoBPResult;
                break;
            case BUFFER_OCCUPANCY:
                bufferOccupancyResult = (BufferOccupancyResult) videoBPResult;
                break;
            case NETWORK_COMPARISON:
                videoNetworkComparisonResult = (VideoNetworkComparisonResult) videoBPResult;
                break;
            case TCP_CONNECTION:
                videoTcpConnectionResult = (VideoTcpConnectionResult) videoBPResult;
                break;
            case CHUNK_SIZE:
                videoChunkSizeResult = (VideoChunkSizeResult) videoBPResult;
                break;
            case CHUNK_PACING:
                videoChunkPacingResult = (VideoChunkPacingResult) videoBPResult;
                break;
            case VIDEO_REDUNDANCY:
                videoRedundancyResult = (VideoRedundancyResult) videoBPResult;
                break;
            case VIDEO_CONCURRENT_SESSION:
                videoConcurrentSessionResult = (VideoConcurrentSessionResult) videoBPResult;
                break;
            case VIDEO_VARIABLE_BITRATE:
                videoVariableBitrateResult = (VideoVariableBitrateResult) videoBPResult;
                break;
            case VIDEO_RESOLUTION_QUALITY:
                videoResolutionQualityResult = (VideoResolutionQualityResult) videoBPResult;
                break;
            case VIDEO_ABR_LADDER:
                videoSegmentQualityResult = (VideoAdaptiveBitrateLadderResult) videoBPResult;
                break;
            case AUDIO_STREAM:
                videoSeparateAudioResult = (AudioStreamResult) videoBPResult;
                break;
            default:
                break;
        }
    }
    sendGAVideoBPResult(videoBestPracticeResults);
    for (AbstractBestPracticeResult bestPractice : bpResults) {
        if (bestPractice instanceof VideoStallResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoStallResult);
        } else if (bestPractice instanceof VideoStartUpDelayResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoStartUpDelayResult);
        } else if (bestPractice instanceof BufferOccupancyResult) {
            bpResults.set(bpResults.indexOf(bestPractice), bufferOccupancyResult);
        } else if (bestPractice instanceof VideoNetworkComparisonResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoNetworkComparisonResult);
        } else if (bestPractice instanceof VideoTcpConnectionResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoTcpConnectionResult);
        } else if (bestPractice instanceof VideoChunkSizeResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkSizeResult);
        } else if (bestPractice instanceof VideoChunkPacingResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkPacingResult);
        } else if (bestPractice instanceof VideoChunkPacingResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkPacingResult);
        } else if (bestPractice instanceof VideoRedundancyResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoRedundancyResult);
        } else if (bestPractice instanceof VideoConcurrentSessionResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoConcurrentSessionResult);
        } else if (bestPractice instanceof VideoVariableBitrateResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoVariableBitrateResult);
        } else if (bestPractice instanceof VideoResolutionQualityResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoResolutionQualityResult);
        } else if (bestPractice instanceof VideoAdaptiveBitrateLadderResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoSegmentQualityResult);
        } else if (bestPractice instanceof AudioStreamResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoSeparateAudioResult);
        }
    }
    traceDataresult.setBestPracticeResults(bpResults);
    return traceDataresult;
}
Also used : VideoRedundancyResult(com.att.aro.core.bestpractice.pojo.VideoRedundancyResult) VideoResolutionQualityResult(com.att.aro.core.bestpractice.pojo.VideoResolutionQualityResult) VideoNetworkComparisonResult(com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) BestPracticeType(com.att.aro.core.bestpractice.pojo.BestPracticeType) VideoStallResult(com.att.aro.core.bestpractice.pojo.VideoStallResult) VideoConcurrentSessionResult(com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult) VideoAdaptiveBitrateLadderResult(com.att.aro.core.bestpractice.pojo.VideoAdaptiveBitrateLadderResult) VideoTcpConnectionResult(com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult) VideoVariableBitrateResult(com.att.aro.core.bestpractice.pojo.VideoVariableBitrateResult) AudioStreamResult(com.att.aro.core.bestpractice.pojo.AudioStreamResult) BufferOccupancyResult(com.att.aro.core.bestpractice.pojo.BufferOccupancyResult) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) VideoChunkPacingResult(com.att.aro.core.bestpractice.pojo.VideoChunkPacingResult) VideoStartUpDelayResult(com.att.aro.core.bestpractice.pojo.VideoStartUpDelayResult) VideoChunkSizeResult(com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult)

Aggregations

VideoRedundancyResult (com.att.aro.core.bestpractice.pojo.VideoRedundancyResult)3 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)2 BestPracticeType (com.att.aro.core.bestpractice.pojo.BestPracticeType)2 BufferOccupancyResult (com.att.aro.core.bestpractice.pojo.BufferOccupancyResult)2 VideoChunkPacingResult (com.att.aro.core.bestpractice.pojo.VideoChunkPacingResult)2 VideoChunkSizeResult (com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult)2 VideoConcurrentSessionResult (com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult)2 VideoNetworkComparisonResult (com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult)2 VideoStallResult (com.att.aro.core.bestpractice.pojo.VideoStallResult)2 VideoStartUpDelayResult (com.att.aro.core.bestpractice.pojo.VideoStartUpDelayResult)2 VideoTcpConnectionResult (com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult)2 VideoStream (com.att.aro.core.videoanalysis.pojo.VideoStream)2 AudioStreamResult (com.att.aro.core.bestpractice.pojo.AudioStreamResult)1 VideoAdaptiveBitrateLadderResult (com.att.aro.core.bestpractice.pojo.VideoAdaptiveBitrateLadderResult)1 VideoResolutionQualityResult (com.att.aro.core.bestpractice.pojo.VideoResolutionQualityResult)1 VideoVariableBitrateResult (com.att.aro.core.bestpractice.pojo.VideoVariableBitrateResult)1 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 StreamingVideoData (com.att.aro.core.videoanalysis.pojo.StreamingVideoData)1 InetAddress (java.net.InetAddress)1