public java.awt.Component | getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
SampleListModel.Entry sampleListEntry = (SampleListModel.Entry) value;
value = "Sample " + (index + 1) + "@" + sampleListEntry.offset + " - " + sampleListEntry.sample.limit() + "bytes";
final SampleEntry se = sampleListEntry.se;
if (se != null && se instanceof VisualSampleEntry &&
("avc1".equals(se.getType()) || "mp4v".equals(se.getType()) || ("encv".equals(se.getType()) && ((VisualSampleEntry) se).getCompressorname().contains("AVC")))) {
try {
final int nalLengthSize = se.getBoxes(AvcConfigurationBox.class).get(0).getLengthSizeMinusOne() + 1;
ArrayList<NalWrapper> nals = getNals(sampleListEntry, nalLengthSize);
value = value + " " + nals;
} catch (IOException e) {
e.printStackTrace();
}
} else if (sampleListEntry.avcD != null) {
try {
final int nalLengthSize = sampleListEntry.avcD.lengthSizeMinusOne + 1;
ArrayList<NalWrapper> nals = getNals(sampleListEntry, nalLengthSize);
value = value + " " + nals;
} catch (IOException e) {
e.printStackTrace();
}
} else if (bruteforceAvc && se == null && sampleListEntry.trackId != failedTrackId) {
//try default nal length of 4
try {
System.out.println("No AVC SampleEntry found, trying to parse sample as AVC with default NAL length of 4bytes.");
ArrayList<NalWrapper> nals = getNals(sampleListEntry, 4);
value = value + " " + nals;
} catch (Exception e) {
failedTrackId = sampleListEntry.trackId;
System.err.println("Didn't work. Won't try again with trackId " + failedTrackId);
//e.printStackTrace();
}
}
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
return this;
|