use of com.att.aro.core.bestpractice.pojo.VideoResolutionQualityResult in project VideoOptimzer by attdevsupport.
the class VideoResolutionQualityImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
resultType = null;
conditionalMessage = "";
result = new VideoResolutionQualityResult();
init(result);
resultType = presetResultsByDevice(tracedata.getTraceresult());
if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
bpResultType = BPResultType.CONFIG_REQUIRED;
result.setResultExcelText(bpResultType.getDescription());
selectedManifestCount = streamingVideoData.getSelectedManifestCount();
validSegmentCount = streamingVideoData.getValidSegmentCount();
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) {
scanManifestsForHeight(videoStreamCollection);
bpResultType = BPResultType.SELF_TEST;
if (overSizeCount == 0) {
if (maxHeightUsed == 0) {
if (validSegmentCount == 0 || selectedManifestCount == 0) {
result.setResultText(textResultsNoData);
bpResultType = BPResultType.CONFIG_REQUIRED;
} else {
result.setResultText(textResultsResolutionData);
bpResultType = BPResultType.SELF_TEST;
}
} else {
result.setResultText(textResultsNone);
bpResultType = BPResultType.PASS;
}
} else {
// at least one oversize
if (noDPIflag) {
resultType = decideResultType(BPResultType.SELF_TEST);
}
if (overSizeCount == 1) {
result.setResultText(textResultsSingle + conditionalMessage);
bpResultType = decideResultType(BPResultType.SELF_TEST);
} else if (overSizeCount > 1) {
result.setResultText(MessageFormat.format(textResultsMultiple + conditionalMessage, overSizeCount));
bpResultType = decideResultType(BPResultType.FAIL);
}
}
switch(bpResultType) {
case PASS:
case SELF_TEST:
case CONFIG_REQUIRED:
case NO_DATA:
result.setResultExcelText(bpResultType.getDescription());
break;
case FAIL:
case WARNING:
result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), overSizeCount));
break;
default:
break;
}
result.setOverSizeCount(overSizeCount);
result.setMaxHeight(maxHeightUsed);
}
} else {
result.setResultText(noData);
bpResultType = BPResultType.NO_DATA;
result.setResultExcelText(bpResultType.getDescription());
}
result.setResultType(bpResultType);
return result;
}
use of com.att.aro.core.bestpractice.pojo.VideoResolutionQualityResult 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;
}
Aggregations