public Size getDisplaySize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; ClearApertureBox clef = NodeBox.findFirst(videoTrack, ClearApertureBox.class, "tapt", "clef"); if (clef != null) { return applyMatrix(videoTrack, new Size((int) clef.getWidth(), (int) clef.getHeight())); } Box box = NodeBox.findFirst(videoTrack, SampleDescriptionBox.class, "mdia", "minf", "stbl", "stsd").getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; Rational par = videoTrack.getPAR(); return applyMatrix(videoTrack, new Size((int) ((vs.getWidth() * par.getNum()) / par.getDen()), (int) vs.getHeight())); }
public Size getDisplaySize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; ClearApertureBox clef = NodeBox.findFirst(videoTrack, ClearApertureBox.class, "tapt", "clef"); if (clef != null) { return applyMatrix(videoTrack, new Size((int) clef.getWidth(), (int) clef.getHeight())); } Box box = NodeBox.findFirst(videoTrack, SampleDescriptionBox.class, "mdia", "minf", "stbl", "stsd").getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; Rational par = videoTrack.getPAR(); return applyMatrix(videoTrack, new Size((int) ((vs.getWidth() * par.getNum()) / par.getDen()), (int) vs.getHeight())); }
public Size getDisplaySize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; ClearApertureBox clef = NodeBox.findFirstPath(videoTrack, ClearApertureBox.class, Box.path("tapt.clef")); if (clef != null) { return applyMatrix(videoTrack, new Size((int) clef.getWidth(), (int) clef.getHeight())); } Box box = NodeBox.findFirstPath(videoTrack, SampleDescriptionBox.class, Box.path("mdia.minf.stbl.stsd")).getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; Rational par = videoTrack.getPAR(); return applyMatrix(videoTrack, new Size((int) ((vs.getWidth() * par.getNum()) / par.getDen()), (int) vs.getHeight())); }