|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--mediaframe.mpeg1.MPEG1
The class "MPEG1" is the main class of the MPEG1 Applet (Java MPEG inline player).
| Field Summary | |
private java.lang.String |
address
The value of the "address" applet's parameter. |
private Player |
audio_decoder
The audio player/decoder. |
private io_tool |
audio_stream
The stream with only audio-frames. |
private boolean |
audioEnabled
The state of the audio parameter of the applet |
private boolean |
autoPlay
True if the applet should autoplay the movie. |
boolean |
buffered
True if the buffering of the movie file has been finished. |
private boolean |
clickToPlay
True if the applet should play the movie after clicking on the movie screen. |
private java.awt.image.DirectColorModel |
cm
The RGB color model for the movie screen. |
IControlPanel |
controlPanel
The control panel of the applet. |
private boolean |
correctLicense
True if the player is used with the correct license key. |
private float |
current_volume
The value of the current volume. |
private java.lang.String |
detect_location
The location of the directory where the xx.detect.speed files are placed. |
int |
detected_speed
Current internet connection bandwidth value (index for tables). |
private Element[] |
EL_ARR
The array of Elements (objects that contain movie frames). |
boolean |
feedback_agent
True if the applet should show the feedback information (speed detection, (re-)buffering). |
java.lang.String[] |
file_speeds
Parameter names for the movie files that depend from the bandwidth value. |
private java.lang.String |
filename
The name of the video file. |
private boolean |
firstAppletLoop
True if the applet starts playback. |
private boolean |
firstLoop
True if the applet should load the movie into the buffer, false if the movie already in the buffer. |
boolean |
float_controls
True if applet's control panel should be showed only after rolloving above the movie screen. |
private int |
Frame_nr
The last frame in "EL_ARR[]". |
private int |
h
The height in MPEG stream. |
private java.awt.MenuItem |
idItem
The "ID" popup menu item. |
private boolean |
initialized
True if the set_dim() method was called by video_decoder. |
private MPEG_Reader |
input_reader
The reader of the movie stream, contains both streams audio and video. |
int[] |
integer_speeds
Possible bandwidth values supported by the applet. |
private java.lang.String |
key
The license key value |
private int |
last_P_or_I
Last P or I frame. |
private boolean |
licenseVerified
True if the license is already verified. |
private boolean |
linux_platform
True, if the current os is Linux. |
private java.lang.String |
lockedInfo
The url of a web page with the description of the MEDIAFRAME LOCKED error. |
private int |
MAXELEMENT
Number of "Element"s in "EL_ARR[]". |
(package private) java.awt.Image |
mf_logo
The 'MediaFrame' ™ logo. |
MovieScreen |
movieScreen
The panel on which the movie is shown. |
private io_tool |
mpeg_stream
The stream with only video-frames. |
private boolean |
mute
The mute sound state of the player (false if sound is on). |
private java.awt.MenuItem |
muteItem
The "mute" popup menu item. |
private java.lang.String |
new_filename
The file name of the movie which is used in the mediaframe_load javascript function |
private int |
o_h
The original height in MPEG stream. |
private int |
o_w
The original width in MPEG stream. |
boolean |
playbackLoop
True if the applet should restart the playing after the playback is finished. |
boolean |
player_controls
True if applet's control panel should be showed. |
private boolean |
playing
True if the applet's state is PLAYED. |
private java.awt.MenuItem |
playItem
The "Play" popup menu item. |
(package private) java.awt.PopupMenu |
popup
The popup menu of the applet. |
private java.lang.String |
postScreen
The value of the "postScreen" applet's parameter. |
private java.lang.String |
preScreen
The value of the "preScreen" applet's parameter. |
private boolean |
readyToPlay
True if the applet is ready to play the movie's first frame. |
private boolean |
rewinded
True if the applet is rewinding the movie (tries to restart the playback from the begin after it is finished). |
private boolean |
rolloverToPlay
True if the applet should play the movie after rolloving above the movie screen. |
private java.awt.MenuItem |
saveItem
The "Save video as..." popup menu item. |
private java.lang.String |
saveScript
The name of the script for the 'Save video as...' functionality |
private boolean |
saveVideoEnabled
True if the 'Save video as...' functionality is enabled |
boolean |
show_controls
True if applet's control panel is showed (has the meaning only if float_controls = true). |
(package private) boolean |
show_mf_logo
Flag, equals true if 'MediaFrame' ™ logo is showing. |
private java.net.URL |
source_url
The URL address of the movie file. |
private java.lang.String |
target
The value of the "target" applet's parameter. |
private MPEG_video |
video_decoder
The video decoder. |
private int |
video_length
The length of the video file. |
private boolean |
video_license
True if the license is stored in the video file. |
private int |
w
The width in MPEG stream. |
private int |
window_x
The width of the applet's movie screen. |
private int |
window_y
The height of the applet's movie screen. |
| Fields inherited from class java.applet.Applet |
|
| Fields inherited from class java.awt.Panel |
|
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
MPEG1()
Constructs the applet's object. |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
This method is invoked when user selects the item of applet's popup menu. |
private long |
decrypt(long m,
long d,
long n)
Decrypts the long value using the private key D and the public key N. |
private long |
decryptBlock()
Decrypts one encrypted short value. |
void |
destroy()
Destroys the player. |
private java.lang.String |
detectConnectionSpeed()
Detects the speed of the internet connection. |
void |
endRebuffering(MPEG_Reader reader)
Ends the "rebuffering" of the player. |
boolean |
get_audio_state()
Returns the mute value of the audio player. |
int |
get_connection_speed()
Gets the current connection speed. |
int |
get_errorcode()
Returns the code of last error. |
java.lang.String |
get_filename()
Gets the filename of the video file. |
java.lang.String |
get_mf_state()
Returns the state of the player (buffering/ready/playing/paused/finished/error). |
int |
get_video_length()
Stub for method that gets the length of the movie file in milliseconds. |
int |
get_video_size()
Gets the length of the video file in bytes. |
int |
get_volume()
Gets the current volume as an interger value (between 1>10). |
int |
get_volume(java.lang.String percent)
If the percent equals '%' gets the current volume as a percent value
(between 0..100) otherwise returns the volume as an interger value (between 1>10). |
Player |
getAudioPlayer()
Gets the audio player/decoder object. |
private long |
getCRC32(java.lang.String str)
Gets the crc32 checksum of the input string. |
private java.awt.Image |
getEmbeddedImage(java.lang.String image_path)
Gets the image that embedded into applet's jar file by it's path. |
private java.awt.Image[] |
getImageFiles(java.lang.String fileName,
java.lang.String fileRange)
Gets the image files using the base filename and the fileRange parameters. |
private long |
getNextRecord(java.lang.String inputKey)
Decrypts the one encrypted long value. |
private java.io.InputStream |
getZipStream(java.io.InputStream aIs)
Opens and returns the InputStream for a zip-compressed file. |
void |
init()
Inits the applet. |
boolean |
isCorrectLicense()
Returns true if the license is correct. |
private boolean |
isCorrectLicenseKey(java.lang.String license_key)
Verifies the license (license_key parameter) of the video player. |
boolean |
isLicenseVerified()
Returns true if the license is already verified. |
boolean |
isSoundEnabled()
Gets the state of the audio player. |
void |
mediaframe_load(java.lang.String fileName)
Loads the new movie into the video player box. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse clicks on the applet's movie screen. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters the applet's movie screen area. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits the applet's movie screen area. |
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on the applet's movie screen. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released from the applet's movie screen. |
private boolean |
open_url()
Opens a movie file or a zip archive with a movie file for downloading and buffering. |
private void |
openTarget()
Opens an address url in the target ("self", "blank", "top", etc) window. |
private float |
parseVolume(java.lang.String sVolume)
Parses the volume level and returns it's float representation. |
void |
playerEnd(MPEG_video video)
Is invoked after the movie playback is finished. |
void |
playerEndBuffer(MPEG_Reader reader)
Is invoked after buffer is filled enough to start the movie playback (when the size of the buffered data equals or greater than the value specified by the "pre_buffer" applet's parameter). |
private void |
playerlooprewind()
Rewinds the player to startup state after the movie playback is finished. |
void |
playerpause()
Pauses the movie playback. |
void |
playerplay()
Starts the movie playback. |
void |
playerrewind()
Rewinds the player to the startup state. |
void |
playersetmute(boolean mute)
Enable or disable speaker of the player. |
void |
playersetvolume(java.lang.String sVolume)
Sets the volume level of the player. |
void |
playerStop()
Stops the movie playback. |
void |
printBufferingPercent(MPEG_Reader reader,
int percent)
Prints the "buffering" percent. |
void |
set_dim(int width,
int height,
int o_width,
int o_height)
This method is necessary because the scanner must have the possibility to resize the applet and (possibly) the frame once he has recognized the dimensions of the MPEG frames. |
void |
set_Pixels(int[][] Pixels,
int f_idx,
int f_type,
long pts,
int Pic_rate)
The method "set_Pixels" expects the pixel data, the type and number of the next frame in display order to change the pixel values of the next image. |
private void |
setMuteItemState(boolean mute)
Sets the "mute" menu item state to 'On' or 'Off' |
void |
start()
The method "start()" opens up the MPEG resource and produces and starts the "MPEG_Reader" thread. |
void |
startRebuffering(MPEG_Reader reader)
Starts the "rebuffering" of the player. |
void |
stop()
Stop the whole player. |
void |
update(java.awt.Graphics g)
Stub, overwrites the "update()" method of Applet (does nothing). |
private void |
wait_rewind()
Waits until the rewind action is finished. |
| Methods inherited from class java.applet.Applet |
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
addNotify |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private int h
private int w
private int o_h
private int o_w
private boolean firstAppletLoop
private java.lang.String filename
private int video_length
private int last_P_or_I
private java.awt.image.DirectColorModel cm
private int Frame_nr
private final int MAXELEMENT
private Element[] EL_ARR
Elements (objects that contain movie frames).
private boolean playing
private boolean mute
java.awt.Image mf_logo
volatile boolean show_mf_logo
java.awt.PopupMenu popup
private java.awt.MenuItem idItem
private java.awt.MenuItem playItem
private java.awt.MenuItem muteItem
private java.awt.MenuItem saveItem
public IControlPanel controlPanel
private boolean autoPlay
private boolean clickToPlay
private boolean rolloverToPlay
public boolean feedback_agent
private java.lang.String target
private java.lang.String address
private java.lang.String preScreen
private java.lang.String postScreen
public boolean player_controls
public boolean float_controls
public boolean show_controls
private boolean linux_platform
private int window_x
private int window_y
private float current_volume
private boolean firstLoop
public boolean playbackLoop
private boolean rewinded
private boolean readyToPlay
private boolean audioEnabled
private java.lang.String new_filename
private boolean correctLicense
private boolean licenseVerified
private boolean video_license
private java.net.URL source_url
private java.lang.String saveScript
private boolean saveVideoEnabled
private io_tool mpeg_stream
private io_tool audio_stream
private MPEG_Reader input_reader
private MPEG_video video_decoder
private Player audio_decoder
private java.lang.String detect_location
public MovieScreen movieScreen
private java.lang.String lockedInfo
public int detected_speed
file_speeds,
integer_speedspublic java.lang.String[] file_speeds
public final int[] integer_speeds
public boolean buffered
private boolean initialized
set_dim() method was called by video_decoder.
private java.lang.String key
| Constructor Detail |
public MPEG1()
| Method Detail |
private final java.lang.String detectConnectionSpeed()
java.lang.Exception - raises if an error occurs.public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerevent - event's data.private boolean open_url()
public void init()
init in class java.applet.Applet
private java.awt.Image[] getImageFiles(java.lang.String fileName,
java.lang.String fileRange)
fileName - the base filename.fileRange - the range of the files.
public void start()
start in class java.applet.Appletpublic void stop()
stop in class java.applet.Appletpublic java.lang.String get_filename()
public int get_video_size()
public int get_video_length()
public boolean get_audio_state()
public int get_errorcode()
public java.lang.String get_mf_state()
public void destroy()
destroy in class java.applet.Appletpublic void playerplay()
public void playerEndBuffer(MPEG_Reader reader)
reader - the MPEG_Reader object ("MPEG_Reader" thread owner).public void startRebuffering(MPEG_Reader reader)
reader - the reader thread.public void endRebuffering(MPEG_Reader reader)
reader - the reader thread.
public void printBufferingPercent(MPEG_Reader reader,
int percent)
reader - the MPEG_Reader object ("MPEG_Reader" thread owner).percent - the "buffering" percent value.public void playerpause()
public void playerStop()
public void playerEnd(MPEG_video video)
video - the MPEG_Reader object ("MPEG_Reader" thread owner).private void wait_rewind()
private void playerlooprewind()
public void playerrewind()
private void setMuteItemState(boolean mute)
mute - the mute value.public void playersetmute(boolean mute)
mute - mute value (true - disable sound, false - enable sound).public void mediaframe_load(java.lang.String fileName)
fileName - the movie file name.public int get_connection_speed()
public int get_volume()
public int get_volume(java.lang.String percent)
percent equals '%' gets the current volume as a percent value
(between 0..100) otherwise returns the volume as an interger value (between 1>10).
percent - the type of the requested value (equals '%' for the percent type).
public void playersetvolume(java.lang.String sVolume)
sVolume - the volume level.private float parseVolume(java.lang.String sVolume)
sVolume - the volume level in percent (100%..0%) or integer (10..1) form.
public boolean isSoundEnabled()
public void set_dim(int width,
int height,
int o_width,
int o_height)
width - the width in MPEG stream.height - the height in MPEG stream.o_width - the original width in MPEG stream.o_height - the original height in MPEG stream.
public void set_Pixels(int[][] Pixels,
int f_idx,
int f_type,
long pts,
int Pic_rate)
throws java.lang.InterruptedException
MovieScreen by means of the "Dispatcher".
Pixels - the array of pixels as YUV values.f_idx - the frame number in the movie.f_type - the type of the frame.pts - the time in milliseconds that this frame is to be displayed.Pic_rate - the frame rate code.
java.lang.InterruptedException - if another process interrupts this thread.public void update(java.awt.Graphics g)
update in class java.awt.Containerg - the graphics context to paint.public Player getAudioPlayer()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - the event's data.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - the event's data.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - the event's data.public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - the event's data.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - the event's data.private void openTarget()
private java.io.InputStream getZipStream(java.io.InputStream aIs)
throws java.lang.Exception
InputStream for a zip-compressed file.
aIs - the InputStream of the zip file.
InputStream of the zip-compressed file.
java.lang.Exception - if an I/O error occurs.private boolean isCorrectLicenseKey(java.lang.String license_key)
private long getNextRecord(java.lang.String inputKey)
inputKey - input key value (null if an old value should be used).
private long decryptBlock()
private long decrypt(long m,
long d,
long n)
m - the long value that must be decrypted.d - the private key D.n - the public key N.
private long getCRC32(java.lang.String str)
str - the input string.
public boolean isCorrectLicense()
public boolean isLicenseVerified()
private java.awt.Image getEmbeddedImage(java.lang.String image_path)
image_path - the path to the resource image.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||