Methods Summary |
---|
public java.awt.Component | getControlComponent()
return null;
|
public static javax.media.Track | getMasterTrack(javax.media.Track[] tracks)
Track master = null;
Format f;
float rate = Format.NOT_SPECIFIED;
for (int i = 0; i < tracks.length; i++) {
if (tracks[i] == null || ((f = tracks[i].getFormat()) == null))
continue;
if (!(f instanceof VideoFormat))
continue;
master = tracks[i];
if ((rate = ((VideoFormat)f).getFrameRate()) != Format.NOT_SPECIFIED &&
rate != 0f) {
return master;
}
}
if (master != null &&
master.mapTimeToFrame(new Time(0)) != FramePositioningControl.FRAME_UNKNOWN)
return master;
else
return null;
|
public java.lang.Object | getOwner()
if (owner == null)
return this;
else
return owner;
|
public javax.media.Time | mapFrameToTime(int frameNumber)Converts the given frame number to the corresponding media time.
return master.mapFrameToTime(frameNumber);
|
public int | mapTimeToFrame(javax.media.Time mediaTime)Converts the given media time to the corresponding frame number.
The frame returned is the nearest frame that has a media time
less than or equal to the given media time.
return master.mapTimeToFrame(mediaTime);
|
public int | seek(int frameNumber)Seek to a given video frame.
Time seekTo = master.mapFrameToTime(frameNumber);
if (seekTo != null && seekTo != FramePositioningControl.TIME_UNKNOWN) {
player.setMediaTime(seekTo);
return master.mapTimeToFrame(seekTo);
} else {
// Can't do any thing if mapFrameToTime fails.
return FramePositioningControl.FRAME_UNKNOWN;
}
|
public void | setOwner(java.lang.Object newOwner)
owner = newOwner;
|
public int | skip(int framesToSkip)Skip a given number of frames from the current position.
if (frameStep != -1) {
// Use interframe duration.
long t = player.getMediaNanoseconds() + (framesToSkip * frameStep);
player.setMediaTime(new Time(t));
return framesToSkip;
} else {
int currentFrame = master.mapTimeToFrame(player.getMediaTime());
if (currentFrame != 0 &&
currentFrame != FramePositioningControl.FRAME_UNKNOWN) {
int newFrame = seek(currentFrame+framesToSkip);
return newFrame - currentFrame;
} else {
// Ran out of options.
return FramePositioningControl.FRAME_UNKNOWN;
}
}
|