use of com.att.aro.core.packetanalysis.pojo.AbstractTraceResult in project VideoOptimzer by attdevsupport.
the class HtmlReportImpl method getTraceRows.
private String getTraceRows(PacketAnalyzerResult analyzerResults) {
StringBuilder sbuilder = new StringBuilder(180);
AbstractTraceResult traceResults = analyzerResults.getTraceresult();
if (traceResults != null) {
sbuilder.append(tableLIne() + "<th>Date</th><td>" + traceResults.getTraceDateTime() + tableChange() + System.getProperty(lineSeperator()));
// if it is from rooted collector and load from trace trace folder
TraceResultType traceType = traceResults.getTraceResultType();
if (TraceResultType.TRACE_DIRECTORY.equals(traceType)) {
TraceDirectoryResult traceDirResult = (TraceDirectoryResult) traceResults;
sbuilder.append(tableLIne());
sbuilder.append("<th>Device Make/Model</th>");
if (traceDirResult.getDeviceMake() != null && traceDirResult.getDeviceModel() != null) {
sbuilder.append("<td>" + traceDirResult.getDeviceMake() + " / " + traceDirResult.getDeviceModel() + "</td>");
} else {
sbuilder.append("<p>Not Available</p>");
}
sbuilder.append("</tr>");
sbuilder.append(System.getProperty(lineSeperator()));
sbuilder.append(tableLIne());
sbuilder.append("<th>Platform Version</th>");
if (traceDirResult.getOsType() != null && traceDirResult.getOsVersion() != null) {
sbuilder.append("<td>" + traceDirResult.getOsType() + " / " + traceDirResult.getOsVersion() + "</td>");
} else {
sbuilder.append("<p>Not Available</p>");
}
sbuilder.append("</tr>");
sbuilder.append(System.getProperty(lineSeperator()));
// Append display resolution
String displayResolutionValue = String.format("%s (Width: %s, Height: %s)", traceDirResult.getCollectOptions().getOrientation(), String.valueOf(traceDirResult.getDeviceScreenSizeX()), String.valueOf(traceDirResult.getDeviceScreenSizeY()));
sbuilder.append(tableLIne());
sbuilder.append("<th>Display Resolution</th>");
sbuilder.append("<td>" + displayResolutionValue + "</td>");
sbuilder.append("</tr>");
sbuilder.append(System.getProperty(lineSeperator()));
}
}
return sbuilder.toString();
}
use of com.att.aro.core.packetanalysis.pojo.AbstractTraceResult in project VideoOptimzer by attdevsupport.
the class MetadataPanel method refresh.
/**
* This method is called to check when VO refreshes(Traceload/Open VO) Based
* on the flow load the values or empty text
*/
@Override
public void refresh(AROTraceData model) {
PacketAnalyzerResult analyzerResults = model.getAnalyzerResult();
AbstractTraceResult traceResults = analyzerResults.getTraceresult();
if (traceResults != null) {
if (traceResults.getTraceResultType() == TraceResultType.TRACE_DIRECTORY && metaDataHelper != null) {
try {
loadMetadataPanel(((TraceDirectoryResult) traceResults).getMetaData());
} catch (Exception e) {
clearDirResults();
}
} else {
clearDirResults();
}
}
}
use of com.att.aro.core.packetanalysis.pojo.AbstractTraceResult in project VideoOptimzer by attdevsupport.
the class BestPracticeResultsListener method getTraceRows.
private List<List<Object>> getTraceRows() {
List<List<Object>> dataRows = new ArrayList<>();
AbstractTraceResult traceResults = traceData.getAnalyzerResult().getTraceresult();
if (traceResults != null) {
dataRows.add(Arrays.asList(getFontStyledColumn("Trace Date"), traceResults.getTraceDateTime().toString()));
Path path = Paths.get(traceResults.getTraceDirectory());
Path fileName = path.getFileName();
Path directoryPath = path.getParent();
dataRows.add(Arrays.asList(getFontStyledColumn("Trace Name"), fileName == null ? "" : fileName.toString()));
dataRows.add(Arrays.asList(getFontStyledColumn("Trace Path"), directoryPath == null ? "" : directoryPath.toString()));
// If it is from rooted collector and load from trace folder
boolean isSecureTrace = false;
if (TraceResultType.TRACE_DIRECTORY.equals(traceResults.getTraceResultType())) {
TraceDirectoryResult traceDirResult = (TraceDirectoryResult) traceResults;
isSecureTrace = traceDirResult.isSecureTrace();
String deviceModelInfo = traceDirResult.getDeviceMake() != null && traceDirResult.getDeviceModel() != null ? traceDirResult.getDeviceMake() + " / " + traceDirResult.getDeviceModel() : "Not Available";
dataRows.add(Arrays.asList(getFontStyledColumn("Device Make/Model"), deviceModelInfo));
String deviceOSInfo = traceDirResult.getOsType() != null && traceDirResult.getOsVersion() != null ? traceDirResult.getOsType() + " / " + traceDirResult.getOsVersion() : "Android";
dataRows.add(Arrays.asList(getFontStyledColumn("Device OS"), deviceOSInfo));
String displayResolutionValue = MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.displayResolutionValue"), traceDirResult.getCollectOptions().getOrientation(), String.valueOf(traceDirResult.getDeviceScreenSizeX()), String.valueOf(traceDirResult.getDeviceScreenSizeY()));
dataRows.add(Arrays.asList(getFontStyledColumn("Display Resolution"), displayResolutionValue));
dataRows.add(Arrays.asList(getFontStyledColumn("Network Type(s)"), traceDirResult.getNetworkTypesList()));
}
dataRows.add(Arrays.asList(getFontStyledColumn("Secure Trace"), isSecureTrace ? "Yes" : "No"));
}
addTimeRangeAnalysisAndStatisticRows(dataRows);
dataRows.addAll(getBPSummaryRows());
dataRows.addAll(getBpRows());
return dataRows;
}
use of com.att.aro.core.packetanalysis.pojo.AbstractTraceResult in project VideoOptimzer by attdevsupport.
the class StartupDelayDialog method loadVideoData.
private void loadVideoData(IVideoPlayer videoPlayer, Dimension computerScreenSize) throws Exception {
deviceVideoDuration = videoPlayer.getDuration();
initialDeviceVideoOffset = videoPlayer.getVideoOffset();
playerMediaTime = videoPlayer.getMediaTime();
AbstractTraceResult traceResult = parentPanel.getTraceData().getAnalyzerResult().getTraceresult();
traceFolder = traceResult.getTraceDirectory();
String temp = ((TraceDirectoryResult) parentPanel.getTraceData().getAnalyzerResult().getTraceresult()).getDeviceDetail().getScreenSize();
String[] deviceScreenSize = stringParse.parse(temp, "(\\d+)\\*(\\d+)");
setDeviceScreenDimension(new Dimension(StringParse.stringToDouble(deviceScreenSize[0], 800).intValue(), StringParse.stringToDouble(deviceScreenSize[1], 600).intValue()));
String movVideoPath = traceResult.getTraceDirectory() + Util.FILE_SEPARATOR + resourceBundle.getString("video.videoDisplayFile");
String mp4VideoPath = traceResult.getTraceDirectory() + Util.FILE_SEPARATOR + resourceBundle.getString("video.videoFileOnDevice");
deviceVideoPath = new File(mp4VideoPath).exists() ? mp4VideoPath : movVideoPath;
String cmd = String.format("%s -i \"%s\" %s", Util.getFFPROBE(), deviceVideoPath, " -v quiet -show_entries stream=height,width,nb_frames,duration,codec_name");
String results = externalProcessRunner.executeCmd(cmd, true, true);
results = results.replaceAll("[\n\r]", " ").replaceAll(" ", " ").replaceAll("] ", "]").replaceAll(" \\[", "\\[");
if (!results.contains("STREAM")) {
throw new Exception("Error executing ffprobe <" + cmd + ">" + results);
}
String streamSection;
String fieldString = "[STREAM]";
String delimiter = "\\[/STREAM\\]";
results = results.replaceAll(fieldString + " ", fieldString).replaceAll(" " + delimiter, delimiter);
while (StringUtils.isNotEmpty(streamSection = StringParse.findLabeledDataFromString(fieldString, delimiter, results))) {
results = results.substring(fieldString.length() * 2 + 1 + streamSection.length());
String[] dimension = stringParse.parse(streamSection, " width=(\\d+) height=(\\d+) ");
Double height = 0D;
Double width = height;
if (dimension != null && dimension.length > 1) {
width = StringParse.stringToDouble(dimension[0], 0);
height = StringParse.stringToDouble(dimension[1], 0);
if (height == 0 || width == 0) {
continue;
}
} else {
continue;
}
deviceVideoWidth = width.intValue();
deviceVideoHeight = height.intValue();
frameImagePanelWidth = (int) computerScreenSize.getWidth() / 4;
if (height < width) {
orientation = Orientation.LANDSCAPE;
deviceVideoRatio = height / width;
} else {
orientation = Orientation.PORTRAIT;
deviceVideoRatio = width / height;
}
fWidth = frameImagePanelWidth / 2;
fHeight = (int) ((double) frameImagePanelWidth / deviceVideoRatio) / 2;
thumbnailHeight = fHeight / 2;
deviceVideoNbFrames = StringParse.findLabeledDoubleFromString("nb_frames=", streamSection);
Double duration = StringParse.findLabeledDoubleFromString("duration=", streamSection);
if (duration != null) {
deviceVideoDuration = duration;
}
}
Log.info("videoDuration :" + deviceVideoDuration);
Log.info("videoOffset :" + initialDeviceVideoOffset);
Log.info("mediaTime :" + playerMediaTime);
Log.info(String.format("h:w = %d:%d", deviceVideoHeight, deviceVideoWidth));
Log.info("duration:" + deviceVideoDuration);
Log.info("nb_frames:" + deviceVideoNbFrames);
}
use of com.att.aro.core.packetanalysis.pojo.AbstractTraceResult in project VideoOptimzer by attdevsupport.
the class HtmlReportImpl method getTableHeader.
private String getTableHeader(PacketAnalyzerResult analyzerResults) {
AbstractTraceResult traceResults = analyzerResults.getTraceresult();
StringBuilder sbuilder = new StringBuilder(150);
sbuilder.append(tableLIne() + "<th>File</th><th>" + traceResults.getTraceDirectory() + "</th></tr>");
sbuilder.append(System.getProperty(lineSeperator()));
return sbuilder.toString();
}
Aggregations