MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / VideoAdapter

Class VideoAdapter

src/org/opensourcephysics/media/core/VideoAdapter.java:68–1331  ·  view source on GitHub ↗

This provides basic implementations of all Video methods. Subclasses should provide a raw image for display--see ImageVideo or GifVideo for an example. All public methods implement Video @author Douglas Brown @version 1.0

Source from the content-addressed store, hash-verified

66 * @version 1.0
67 */
68public abstract class VideoAdapter extends OSPRuntime.Supported implements Video {
69// instance fields
70
71 protected Image rawImage; // raw image from video source
72 protected Dimension size = new Dimension(); // image pixel dimensions
73 protected Dimension displayedSize = new Dimension(); // image pixel dimensions with filters
74 protected BufferedImage bufferedImage; // offscreen buffered image copy
75 protected BufferedImage filteredImage; // filtered image
76 protected String baseDir;
77 protected int frameCount = 0;
78 protected int frameNumber = 0;
79 protected int startFrameNumber;
80 protected int endFrameNumber;
81 protected double rate = 1;
82 protected boolean playing = false;
83 protected boolean looping = false;
84 protected double minX, maxX, minY, maxY;
85 protected boolean mouseEnabled = false;
86 protected boolean visible = true;
87 protected boolean isMeasured = false;
88 protected boolean isValidMeasure = false;
89 protected boolean widthDominates = true;
90 protected boolean isValidImage = false;
91 protected boolean isValidFilteredImage = false;
92 protected ImageCoordSystem coords;
93 protected DoubleArray aspects;
94 protected HashMap<String, Object> properties = new HashMap<String, Object>();
95 protected FilterStack filterStack = new FilterStack();
96 protected DataBufferInt clearRaster;
97
98 /**
99 * startTimes in MS. Created from MediaInfo.analyzeData(JavaScript) or from
100 * Xuggle(Java); passed through XMLControl "video" in TRK/TRZ to other platforms
101 *
102 * used in:
103 *
104 * VideoAdapter.getEndTime(), .setEndTime(), .getFrameDuration()
105 *
106 * Video.getAverageFrameRate(), .getOutliers(), isValid()
107 *
108 * MovieVideo.getFrameNumberBefore(), .setFromControl(), .setStartTimes(),
109 * .finalizeLoading()
110 *
111 *
112 */
113 protected double[] startTimesMS;
114
115 /**
116 * set to false by TrackerIO.getImageBytes()
117 */
118 private boolean doNotify = true;
119
120 public void setNotify(boolean b) {
121 doNotify = b;
122 }
123
124
125 private final static Point2D.Double corner = new Point2D.Double(0, 0);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected