use of com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult 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;
}
}
use of com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult in project VideoOptimzer by attdevsupport.
the class VideoSegmentSizeImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
BPResultType bpResultType = BPResultType.SELF_TEST;
VideoChunkSizeResult result = new VideoChunkSizeResult();
double totalSize = 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(invalidManifestsFound);
} else if (invalidCount > 0) {
result.setResultText(noManifestsSelectedMixed);
} else {
result.setResultText(noManifestsSelected);
}
bpResultType = BPResultType.CONFIG_REQUIRED;
result.setResultExcelText(bpResultType.getDescription());
} else if (selectedCount > 1) {
bpResultType = BPResultType.CONFIG_REQUIRED;
result.setResultText(multipleManifestsSelected);
result.setResultExcelText(bpResultType.getDescription());
result.setSelfTest(false);
} else {
for (VideoStream videoStream : videoStreamCollection.values()) {
if (videoStream != null && videoStream.isSelected() && !videoStream.getVideoEventsBySegment().isEmpty()) {
for (VideoEvent videoEvent : videoStream.getVideoEventsBySegment()) {
if (!videoEvent.isNormalSegment()) {
continue;
}
count++;
totalSize += videoEvent.getSize();
}
break;
}
}
if (count != 0) {
averageSize = totalSize / count;
}
bpResultType = BPResultType.SELF_TEST;
result.setSelfTest(true);
result.setResultText(MessageFormat.format(textResults, count == 1 ? "was" : "were", count, count == 1 ? "" : "different", count == 1 ? "" : "s", (int) averageSize / 1024));
result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), count, (int) averageSize / 1024));
// Size in KB
result.setSegmentSize((int) averageSize / 1024);
result.setSegmentCount((int) count);
}
} else {
result.setResultText(noData);
bpResultType = BPResultType.NO_DATA;
result.setResultExcelText(bpResultType.getDescription());
result.setSelfTest(false);
}
result.setResultType(bpResultType);
return result;
}
use of com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult 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