+++ /dev/null
-// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
-// Jad home page: http://www.kpdus.com/jad.html
-// Decompiler options: packimports(3) fieldsfirst nonlb space
-
-package mcsClient;
-
-import java.io.IOException;
-import java.net.*;
-import java.util.LinkedList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-
-// Referenced classes of package mcsClient:
-// BitMap, SecureDatagramSocket, McsTcpConnection, LiveVideoPanel,
-// McsToolBar
-
-public final class DatagramReader
- implements Runnable {
-
- public boolean videoLostSync;
- private DatagramSocket dgSocket;
- private McsTcpConnection mcsTcpConnection;
- private LiveVideoPanel liveVideoPanel;
- private LinkedList datagramList;
- private static final boolean USE_MULTICAST = false;
- public static final int DEFAULT_DIALIN_BITRATE;
- public static final int DEFAULT_NET_BITRATE;
- private long serverTime;
- private long serverBaseTime;
- private long clientTime;
- private long clientBaseTime;
- private boolean gotBaseTime;
- private long skew;
- private long upperSkew;
- private long lowerSkew;
- private long initialBitRate;
- private long skewTime;
- private boolean gotBeginningOfFrame;
- private boolean gotInitialBitRate;
- private boolean detectedPPP;
- private int frameNumber;
- private int maxSequenceNumber;
- private int lastFrameNumber;
- private long totalFrameSize;
- private BitMap bitmap;
- private boolean initialized;
- private static int nakMessage[] = new int[4];
- private McsToolBar sliderListener;
- private int nakCount;
- private static Logger logger = Logger.getAnonymousLogger();
-
- public DatagramReader(McsTcpConnection mcstcpconnection, LiveVideoPanel livevideopanel, LinkedList linkedlist, String s, int i, boolean flag) {
- videoLostSync = false;
- serverBaseTime = 0L;
- clientTime = 0L;
- clientBaseTime = 0L;
- gotBaseTime = false;
- skew = 0L;
- upperSkew = 150L;
- lowerSkew = -10L;
- initialBitRate = 0L;
- skewTime = 225L;
- gotBeginningOfFrame = false;
- gotInitialBitRate = false;
- detectedPPP = false;
- maxSequenceNumber = 0;
- lastFrameNumber = 0;
- totalFrameSize = 0L;
- bitmap = new BitMap();
- initialized = true;
- sliderListener = null;
- nakCount = 0;
- mcsTcpConnection = mcstcpconnection;
- liveVideoPanel = livevideopanel;
- datagramList = linkedlist;
- logger.setLevel(Level.WARNING);
- String s1 = System.getProperty("mcs.debug");
- if (s1 != null && s1.equalsIgnoreCase("true"))
- logger.setLevel(Level.ALL);
- nakMessage[0] = nakMessage.length * 4;
- nakMessage[1] = 5;
- if (mcstcpconnection.getDetectedPPP() || flag) {
- detectedPPP = true;
- upperSkew = 150L;
- lowerSkew = -30L;
- skewTime = 2000L;
- }
- if (mcstcpconnection.videoEncrypted())
- dgSocket = new SecureDatagramSocket(mcstcpconnection.cipher1, mcstcpconnection.cipher2, mcstcpconnection.getLocalPort());
- else
- dgSocket = new DatagramSocket(mcstcpconnection.getLocalPort());
- dgSocket.setReceiveBufferSize(0x1f400);
- dgSocket.setSoTimeout(500);
- if (flag)
- return;
- try {
- byte abyte0[] = new byte[10];
- DatagramPacket datagrampacket = new DatagramPacket(abyte0, abyte0.length, InetAddress.getByName(s), i);
- for (int j = 0; j < 6; j++) {
- dgSocket.send(datagrampacket);
- try {
- Thread.currentThread();
- Thread.sleep(60L);
- }
- catch (InterruptedException interruptedexception) { }
- }
-
- try {
- Thread.currentThread();
- Thread.sleep(200L);
- }
- catch (InterruptedException interruptedexception1) { }
- }
- catch (Exception exception) {
- logger.severe(exception.toString());
- initialized = false;
- JOptionPane.showMessageDialog(new JFrame(), "Failed to connect. Try again.", "Remote Console Datagram Reader Initialization Error", 0);
- }
- return;
- }
-
- private void cleanupThread() {
- if (dgSocket != null) {
- dgSocket.disconnect();
- dgSocket.close();
- }
- dgSocket = null;
- mcsTcpConnection = null;
- liveVideoPanel = null;
- datagramList = null;
- initialized = false;
- }
-
- private void process() {
- int l;
- Thread thread;
- l = 0;
- boolean flag = false;
- boolean flag1 = false;
- boolean flag2 = false;
- if (!initialized)
- return;
- thread = Thread.currentThread();
- goto _L1
-_L22:
- if (nakCount >= 25) {
- logger.info("25 NAK messages sent");
- nakCount = 0;
- }
- DatagramPacket datagrampacket;
- byte abyte1[] = new byte[1500];
- datagrampacket = new DatagramPacket(abyte1, abyte1.length);
- dgSocket.receive(datagrampacket);
- goto _L2
- SocketTimeoutException sockettimeoutexception;
- sockettimeoutexception;
- goto _L1
- IOException ioexception3;
- ioexception3;
- logger.warning("Datagram Reader - error reading datagram " + ioexception3);
- return;
-_L2:
- byte abyte0[];
- int j;
- abyte0 = datagrampacket.getData();
- j = datagrampacket.getOffset();
- if (datagrampacket.getLength() >= 24) goto _L3; else goto _L1
-_L3:
- if (abyte0[j + 7] != 6) goto _L5; else goto _L4
-_L4:
- videoLostSync = true;
- gotBaseTime = false;
- logger.info("DatagramReader: video lost sync");
- goto _L1
-_L5:
- videoLostSync = false;
- frameNumber = (abyte0[j + 8] & 0xff) << 8 | abyte0[j + 9] & 0xff;
- if (gotBeginningOfFrame) goto _L7; else goto _L6
-_L6:
- if ((abyte0[j + 7] & 0xbf) != 0) goto _L8; else goto _L1
-_L8:
- gotBeginningOfFrame = true;
- lastFrameNumber = frameNumber - 1;
- l = 128;
- bitmap.clear();
- bitmap.setBit(0);
-_L7:
- int i;
- i = (abyte0[j + 10] & 0xff) << 8 | abyte0[j + 11] & 0xff;
- int i1 = (abyte0[j + 2] & 0xff) << 8 | abyte0[j + 3] & 0xff;
- totalFrameSize += i1;
- serverTime = ((long)abyte0[j + 20] & 255L) << 24 | ((long)abyte0[j + 21] & 255L) << 16 | ((long)abyte0[j + 22] & 255L) << 8 | (long)abyte0[j + 23] & 255L;
- clientTime = System.currentTimeMillis();
- if (gotBaseTime) goto _L10; else goto _L9
-_L9:
- gotBaseTime = true;
- serverBaseTime = serverTime;
- clientBaseTime = clientTime;
- totalFrameSize = 0L;
- goto _L11
-_L10:
- long l1;
- skew = clientTime - clientBaseTime - (serverTime - serverBaseTime);
- l1 = (totalFrameSize * 8L * 1000L) / ((clientTime - clientBaseTime) + 50L);
- if (l1 > 0x13880L)
- liveVideoPanel.doPartialScreenUpdates = false;
- else
- liveVideoPanel.doPartialScreenUpdates = true;
- if (skew >= lowerSkew) goto _L13; else goto _L12
-_L12:
- gotBaseTime = false;
- goto _L11
-_L13:
- if (skew <= upperSkew || clientTime - clientBaseTime <= skewTime) goto _L11; else goto _L14
-_L14:
- int ai[];
- if (!gotInitialBitRate) {
- initialBitRate = l1;
- gotInitialBitRate = true;
- if (detectedPPP) {
- if (initialBitRate < (long)DEFAULT_DIALIN_BITRATE)
- initialBitRate = DEFAULT_DIALIN_BITRATE;
- } else
- if (initialBitRate < (long)DEFAULT_NET_BITRATE)
- initialBitRate = DEFAULT_NET_BITRATE;
- if (sliderListener != null)
- sliderListener.setSliderInitialBitRate(initialBitRate);
- } else {
- if (l1 < (initialBitRate * 60L) / 100L)
- l1 = (initialBitRate * 60L) / 100L;
- if (detectedPPP && l1 > initialBitRate)
- l1 = initialBitRate;
- }
- gotBaseTime = false;
- l1 *= 75L;
- l1 /= 100L;
- ai = new int[3];
- ai[0] = ai.length * 4;
- ai[1] = 10;
- ai[2] = (int)l1;
- thread;
- if (Thread.interrupted())
- return;
- try {
- mcsTcpConnection.sendMessage(ai, false);
- }
- catch (IOException ioexception4) {
- logger.severe("Socket exception - DatagramReader exiting");
- return;
- }
-_L11:
- if (frameNumber == lastFrameNumber)
- break MISSING_BLOCK_LABEL_1033;
- if (frameNumber == lastFrameNumber + 1) goto _L16; else goto _L15
-_L15:
- nakMessage[2] = 0;
- nakMessage[3] = frameNumber;
- try {
- mcsTcpConnection.sendMessage(nakMessage, false);
- }
- catch (IOException ioexception) {
- logger.severe("Socket exception - DatagramReader exiting");
- return;
- }
- nakCount++;
- goto _L17
-_L16:
- if ((l & 0x80) != 0) goto _L19; else goto _L18
-_L18:
- nakMessage[2] = 0;
- nakMessage[3] = 0;
- thread;
- if (Thread.interrupted())
- return;
- try {
- mcsTcpConnection.sendMessage(nakMessage, false);
- }
- catch (IOException ioexception1) {
- logger.severe("Socket exception - DatagramReader exiting");
- return;
- }
- nakCount++;
- goto _L17
-_L20:
- int k;
- nakMessage[2] = k;
- nakMessage[3] = frameNumber;
- thread;
- if (Thread.interrupted())
- return;
- try {
- mcsTcpConnection.sendMessage(nakMessage, false);
- }
- catch (IOException ioexception2) {
- logger.severe("Socket exception - DatagramReader exiting");
- return;
- }
- nakCount++;
- break; /* Loop/switch isn't completed */
-_L19:
- if ((k = bitmap.findZeroBit()) <= maxSequenceNumber) goto _L20; else goto _L17
-_L17:
- lastFrameNumber = frameNumber;
- bitmap.clear();
- l = 0;
- maxSequenceNumber = 0;
- bitmap.setBit(i);
- maxSequenceNumber = i <= maxSequenceNumber ? maxSequenceNumber : i;
- l |= abyte0[j + 7];
- abyte0[j + 7] &= 0x3f;
- int j1;
- if ((j1 = datagramList.size()) < 10 || liveVideoPanel.imagesAutomaticallyPaused)
- break MISSING_BLOCK_LABEL_1147;
- thread;
- if (Thread.interrupted())
- return;
- if (liveVideoPanel.pauseVideo() != 1) {
- logger.severe("Socket exception - DatagramReader exiting");
- return;
- }
- liveVideoPanel.imagesAutomaticallyPaused = true;
- long l2 = ((long)abyte0[j] & 255L) << 24 | ((long)abyte0[j + 1] & 255L) << 16 | ((long)abyte0[j + 2] & 255L) << 8 | (long)abyte0[j + 3] & 255L;
- long l3 = ((long)abyte0[j + 12] & 255L) << 24 | ((long)abyte0[j + 13] & 255L) << 16 | ((long)abyte0[j + 14] & 255L) << 8 | (long)abyte0[j + 15] & 255L;
- long l4 = ((long)abyte0[j + 16] & 255L) << 24 | ((long)abyte0[j + 17] & 255L) << 16 | ((long)abyte0[j + 18] & 255L) << 8 | (long)abyte0[j + 19] & 255L;
- if (i >= 0 && i <= 896 && l3 >= 0L && l3 <= 0xc0000L && l4 >= 0L && l3 <= 0xc0000L) {
- if (l2 != 31L)
- synchronized (datagramList) {
- datagramList.addFirst(datagrampacket);
- datagramList.notify();
- }
- } else {
- logger.warning("Bad packet discarded. seq num: " + i + " vid ram offset: " + l3 + " vid ram count: " + l4);
- }
- goto _L1
- ArrayIndexOutOfBoundsException arrayindexoutofboundsexception;
- arrayindexoutofboundsexception;
- logger.warning(arrayindexoutofboundsexception.toString());
-_L1:
- thread;
- if (Thread.interrupted())
- return;
- if (true) goto _L22; else goto _L21
-_L21:
- }
-
- public void run() {
- process();
- cleanupThread();
- }
-
- protected void finalize() throws Throwable {
- cleanupThread();
- }
-
- public boolean initialized() {
- return initialized;
- }
-
- public void addSliderListener(McsToolBar mcstoolbar) {
- sliderListener = mcstoolbar;
- }
-
- public void setInitialBitRate(long l) {
- initialBitRate = l;
- gotInitialBitRate = true;
- int ai[] = new int[3];
- ai[0] = ai.length * 4;
- ai[1] = 10;
- ai[2] = (int)l;
- try {
- mcsTcpConnection.sendMessage(ai, true);
- }
- catch (IOException ioexception) {
- logger.severe("Socket exception - setInitialBitRate");
- return;
- }
- }
-
- static {
- DEFAULT_DIALIN_BITRATE = McsToolBar.BITRATES[2];
- DEFAULT_NET_BITRATE = McsToolBar.BITRATES[7];
- }
-}
+++ /dev/null
-// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
-// Jad home page: http://www.kpdus.com/jad.html
-// Decompiler options: packimports(3) fieldsfirst nonlb space
-
-package mcsClient;
-
-import java.awt.*;
-import java.awt.image.*;
-import java.io.*;
-import java.net.DatagramPacket;
-import java.util.LinkedList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.swing.JPanel;
-
-// Referenced classes of package mcsClient:
-// ColorPalette, Decompress, McsTargetSize, McsTcpConnection,
-// McsToolBar, LockingKeyStateManager
-
-public final class LiveVideoPanel extends JPanel
- implements Runnable {
-
- private int targetWidth;
- private int targetHeight;
- private boolean initialized;
- private McsTargetSize targetSize;
- private ColorPalette colorPalette;
- private IndexColorModel indexColorModel;
- private LinkedList datagramList;
- public static boolean PRINT_HEADER = false;
- public static boolean MEASURE_PERFORMANCE = false;
- public boolean SHOW_CURSOR;
- public static final boolean DEBUG_MOUSE = false;
- public static final int SUCCESS = 1;
- public static final int FAILURE = 2;
- boolean doPartialScreenUpdates;
- boolean interpolation;
- Graphics2D graphics2D;
- RenderingHints renderingHints;
- private final Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
- private final Cursor invisibleCursor;
- private Cursor visibleCursor;
- private Cursor currentCursor;
- private byte imageData[];
- private MemoryImageSource memoryImageSource;
- private MemoryImageSource memoryImageSource_1024_768;
- private MemoryImageSource memoryImageSource_800_600;
- private MemoryImageSource memoryImageSource_640_480;
- private MemoryImageSource memoryImageSource_640_400;
- private MemoryImageSource memoryImageSource_656_496;
- private Image image_1024_768;
- private Image image_800_600;
- private Image image_640_480;
- private Image image_640_400;
- private Image image_656_496;
- private Image image;
- private int blankImage[];
- private MemoryImageSource blankMemoryImageSource;
- private Image blank;
- private Dimension dimension_1024_768;
- private Dimension dimension_800_600;
- private Dimension dimension_640_480;
- private Dimension dimension_640_400;
- private Dimension dimension_656_496;
- private McsTcpConnection mcsTcpConnection;
- private int frameWidth;
- private int frameHeight;
- private int livePanelWait;
- private boolean livePanelSchedule;
- private McsToolBar sliderListener;
- private static int resumeMessage[] = new int[2];
- private static int pauseMessage[] = new int[2];
- boolean imagesAutomaticallyPaused;
- private LockingKeyStateManager lockingKeyStateManager;
- private static Logger logger = Logger.getAnonymousLogger();
-
- public LiveVideoPanel(McsTcpConnection mcstcpconnection, LinkedList linkedlist, McsTargetSize mcstargetsize, LockingKeyStateManager lockingkeystatemanager) {
- targetWidth = 1024;
- targetHeight = 768;
- initialized = false;
- colorPalette = new ColorPalette();
- indexColorModel = new IndexColorModel(8, colorPalette.hardwareColors.length, colorPalette.hardwareColors, 0, 0, null);
- SHOW_CURSOR = true;
- doPartialScreenUpdates = true;
- interpolation = false;
- graphics2D = null;
- renderingHints = null;
- invisibleCursor = defaultToolkit.createCustomCursor(new BufferedImage(1, 1, 2), new Point(0, 0), "");
- dimension_1024_768 = new Dimension(1024, 768);
- dimension_800_600 = new Dimension(800, 600);
- dimension_640_480 = new Dimension(640, 480);
- dimension_640_400 = new Dimension(640, 400);
- dimension_656_496 = new Dimension(656, 496);
- sliderListener = null;
- imagesAutomaticallyPaused = false;
- mcsTcpConnection = mcstcpconnection;
- datagramList = linkedlist;
- targetSize = mcstargetsize;
- lockingKeyStateManager = lockingkeystatemanager;
- imageData = new byte[targetWidth * targetHeight * 2];
- memoryImageSource_1024_768 = new MemoryImageSource(1024, 768, indexColorModel, imageData, 0, 1024);
- memoryImageSource_800_600 = new MemoryImageSource(800, 600, indexColorModel, imageData, 0, 800);
- memoryImageSource_640_480 = new MemoryImageSource(640, 480, indexColorModel, imageData, 0, 640);
- memoryImageSource_640_400 = new MemoryImageSource(640, 400, indexColorModel, imageData, 0, 640);
- memoryImageSource_656_496 = new MemoryImageSource(656, 496, indexColorModel, imageData, 0, 656);
- memoryImageSource_1024_768.setAnimated(true);
- memoryImageSource_800_600.setAnimated(true);
- memoryImageSource_640_480.setAnimated(true);
- memoryImageSource_640_400.setAnimated(true);
- memoryImageSource_656_496.setAnimated(true);
- memoryImageSource = memoryImageSource_1024_768;
- image_1024_768 = createImage(memoryImageSource_1024_768);
- image_800_600 = createImage(memoryImageSource_800_600);
- image_640_480 = createImage(memoryImageSource_640_480);
- image_640_400 = createImage(memoryImageSource_640_400);
- image_656_496 = createImage(memoryImageSource_656_496);
- image = image_1024_768;
- blankImage = new int[0xc0000];
- blankMemoryImageSource = new MemoryImageSource(1024, 768, indexColorModel, blankImage, 0, 1024);
- blank = createImage(blankMemoryImageSource);
- Cursor cursor = getCursor();
- Cursor cursor1 = cursor;
- if (!SHOW_CURSOR) {
- setCursor(invisibleCursor);
- Cursor cursor2 = invisibleCursor;
- }
- resumeMessage[0] = resumeMessage.length * 4;
- resumeMessage[1] = 8;
- pauseMessage[0] = pauseMessage.length * 4;
- pauseMessage[1] = 7;
- livePanelWait = 0;
- livePanelSchedule = true;
- logger.setLevel(Level.WARNING);
- String s = System.getProperty("mcs.debug");
- if (s != null && s.equalsIgnoreCase("true"))
- logger.setLevel(Level.ALL);
- initialized = true;
- }
-
- public void toggleVisibleCursor() {
- if (currentCursor.equals(visibleCursor)) {
- setCursor(invisibleCursor);
- currentCursor = invisibleCursor;
- } else {
- setCursor(visibleCursor);
- currentCursor = visibleCursor;
- }
- }
-
- public boolean initialized() {
- return initialized;
- }
-
- public boolean isFocusable() {
- return true;
- }
-
- public void addNotify() {
- super.addNotify();
- }
-
- public boolean isOpaque() {
- return false;
- }
-
- public void paintComponent(Graphics g) {
- super.paintComponent(g);
- Rectangle rectangle = g.getClipBounds();
- if (rectangle.x >= 0 && rectangle.x < targetWidth && rectangle.y >= 0 && rectangle.y < targetHeight)
- g.drawImage(image, 0, 0, null);
- livePanelWait = 0;
- }
-
- public void update(Graphics g) {
- super.update(g);
- }
-
- public void setInterpolation(boolean flag) {
- interpolation = flag;
- }
-
- private void cleanupThread() {
- mcsTcpConnection = null;
- datagramList = null;
- lockingKeyStateManager = null;
- initialized = false;
- }
-
- private void process() {
- float f;
- float f1;
- float f2;
- float f3;
- long l;
- int k;
- boolean flag3;
- int ai[];
- Decompress decompress;
- Thread thread;
- f = 0.0F;
- f1 = 0.0F;
- f2 = 0.0F;
- f3 = 0.0F;
- boolean flag = false;
- k = 2;
- boolean flag1 = false;
- boolean flag2 = false;
- Object obj = null;
- flag3 = false;
- Object obj1 = null;
- ai = new int[2];
- ai[0] = ai.length * 4;
- ai[1] = 16;
- setBackground(Color.white);
- setEnabled(true);
- setVisible(true);
- decompress = new Decompress(imageData);
- long l1;
- l = l1 = System.currentTimeMillis();
- graphics2D = (Graphics2D)getGraphics();
- renderingHints = graphics2D.getRenderingHints();
- logger.info("RenderingHints size = " + renderingHints.size());
- thread = Thread.currentThread();
- break MISSING_BLOCK_LABEL_1474;
-_L2:
- LinkedList linkedlist = datagramList;
- JVM INSTR monitorenter ;
- int i;
- DatagramPacket datagrampacket;
-label0:
- {
- thread;
- if (Thread.interrupted()) {
- logger.info("Terminating LiveVideoPanel");
- return;
- }
- try {
- while ((i = datagramList.size()) == 0)
- datagramList.wait();
- datagrampacket = (DatagramPacket)datagramList.removeLast();
- break label0;
- }
- catch (InterruptedException interruptedexception1) { }
- return;
- }
- Exception exception;
- exception;
- throw exception;
- if (i > 2 || !imagesAutomaticallyPaused)
- break MISSING_BLOCK_LABEL_277;
- if (resumeVideo() != 1) {
- logger.severe("Socket exception - LiveVideoPanel exiting");
- return;
- }
- imagesAutomaticallyPaused = false;
- break MISSING_BLOCK_LABEL_313;
- if (i < 6 || imagesAutomaticallyPaused)
- break MISSING_BLOCK_LABEL_313;
- if (pauseVideo() != 1) {
- logger.severe("Socket exception - LiveVideoPanel exiting");
- return;
- }
- imagesAutomaticallyPaused = true;
- DataInputStream datainputstream;
- try {
- datainputstream = new DataInputStream(new ByteArrayInputStream(datagrampacket.getData(), datagrampacket.getOffset(), datagrampacket.getLength()));
- }
- catch (NullPointerException nullpointerexception) {
- logger.severe("Data stream has been closed. LiveVideoPanel exiting.");
- return;
- }
- int i1;
- int i2;
- int j2;
- try {
- int j = datagrampacket.getLength();
- i1 = datainputstream.readInt();
- int j1 = datainputstream.readInt();
- int k1 = datainputstream.readInt();
- i2 = datainputstream.readInt();
- j2 = datainputstream.readInt();
- int k2 = datainputstream.readInt();
- if (MEASURE_PERFORMANCE) {
- f3++;
- f1 += i1;
- f += j2;
- }
- if (PRINT_HEADER) {
- System.out.println();
- System.out.println("dg length: " + i1 + ", vro: " + i2 + ", vrc: " + j2);
- }
- flag3 = false;
- if (i1 > 1458) {
- flag3 = true;
- logger.warning("Bad datagramLength = " + i1);
- }
- if (j1 != k) {
- if (j1 == 2) {
- memoryImageSource = memoryImageSource_1024_768;
- image = image_1024_768;
- logger.info("Setting to 1024 x 768");
- setPreferredSize(dimension_1024_768);
- targetWidth = 1024;
- targetHeight = 768;
- targetSize.setWidth(1024);
- targetSize.setHeight(768);
- } else
- if (j1 == 3) {
- memoryImageSource = memoryImageSource_800_600;
- image = image_800_600;
- logger.info("Setting to 800 x 600");
- setPreferredSize(dimension_800_600);
- targetWidth = 800;
- targetHeight = 600;
- targetSize.setWidth(800);
- targetSize.setHeight(600);
- } else
- if (j1 == 4) {
- memoryImageSource = memoryImageSource_640_480;
- image = image_640_480;
- logger.info("Setting to 640 x 480");
- setPreferredSize(dimension_640_480);
- targetWidth = 640;
- targetHeight = 480;
- targetSize.setWidth(640);
- targetSize.setHeight(480);
- } else
- if (j1 == 23) {
- memoryImageSource = memoryImageSource_640_400;
- image = image_640_400;
- logger.info("Setting to 640 x 400");
- setPreferredSize(dimension_640_400);
- targetWidth = 640;
- targetHeight = 400;
- targetSize.setWidth(640);
- targetSize.setHeight(400);
- } else
- if (j1 == 25) {
- memoryImageSource = memoryImageSource_656_496;
- image = image_656_496;
- logger.info("Setting to 656 x 496");
- setPreferredSize(dimension_656_496);
- targetWidth = 656;
- targetHeight = 496;
- targetSize.setWidth(656);
- targetSize.setHeight(496);
- } else {
- flag3 = true;
- logger.warning("Bad messageType = " + j1);
- }
- java.awt.Container container = getParent();
- java.awt.Container container1 = container;
- k = j1;
- }
- if (i2 < 0 || i2 > targetWidth * targetHeight) {
- flag3 = true;
- logger.warning("Bad videoRamOffset = " + i2);
- }
- if (j2 < 0 || j2 > targetWidth * targetHeight) {
- flag3 = true;
- logger.warning("Bad videoRamCount = " + j2);
- }
- }
- catch (IOException ioexception) {
- logger.warning("LiveVideoPanel: got I/O exception" + ioexception);
- break; /* Loop/switch isn't completed */
- }
- if (!flag3)
- try {
- decompress.doDecompress(datainputstream, i1 - 24, i2, j2, memoryImageSource, targetWidth, targetHeight);
- }
- catch (ArrayIndexOutOfBoundsException arrayindexoutofboundsexception) {
- logger.warning("Decompress failed - " + arrayindexoutofboundsexception.toString());
- flag3 = true;
- }
- if (i2 + j2 >= targetWidth * targetHeight)
- break; /* Loop/switch isn't completed */
- if (doPartialScreenUpdates) {
- if (!decompress.pixelsInParts)
- memoryImageSource.newPixels(0, 0, targetWidth, targetHeight, false);
- if (!flag3)
- repaint();
- }
-_L3:
- thread;
- if (!Thread.interrupted()) goto _L2; else goto _L1
-_L1:
- thread;
- if (Thread.interrupted())
- return;
- if (!decompress.pixelsInParts)
- memoryImageSource.newPixels(0, 0, targetWidth, targetHeight, false);
- if (!flag3) {
- repaint();
- try {
- livePanelWait += 2;
- Thread.currentThread();
- Thread.sleep(livePanelWait);
- }
- catch (InterruptedException interruptedexception) { }
- }
- if (MEASURE_PERFORMANCE) {
- f2++;
- long l2 = System.currentTimeMillis();
- if (l2 - l > 10000L) {
- System.out.println("Datagrams/sec = " + (f3 * 1000F) / (float)(l2 - l));
- System.out.println("Frames/sec = " + (f2 * 1000F) / (float)(l2 - l));
- System.out.println("Bit rate = " + (8F * f1) / 10F);
- f2 = 0.0F;
- f = 0.0F;
- f1 = 0.0F;
- f3 = 0.0F;
- l = l2 = System.currentTimeMillis();
- try {
- mcsTcpConnection.sendMessage(ai);
- }
- catch (IOException ioexception1) {
- logger.warning("Socket exception - LiveVideoPanel exiting");
- return;
- }
- }
- }
- thread;
- if (Thread.interrupted())
- return;
- goto _L3
- }
-
- public void run() {
- process();
- cleanupThread();
- }
-
- void setFrameSize(int i, int j) {
- frameWidth = i;
- frameHeight = j;
- }
-
- public int resumeVideo() {
- try {
- mcsTcpConnection.sendMessage(resumeMessage);
- }
- catch (IOException ioexception) {
- return 2;
- }
- return 1;
- }
-
- public int pauseVideo() {
- imagesAutomaticallyPaused = false;
- try {
- mcsTcpConnection.sendMessage(pauseMessage);
- }
- catch (IOException ioexception) {
- return 2;
- }
- return 1;
- }
-
- public void addSliderListener(McsToolBar mcstoolbar) {
- sliderListener = mcstoolbar;
- }
-
-}