Package quicktime.util

Source Code of quicktime.util.QTPointer

/*     */ package quicktime.util;
/*     */
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTNullPointerException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.sound.SoundComponentData;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.std.image.GraphicsExporter;
/*     */
/*     */ public class QTPointer extends QTPointerRef
/*     */   implements Cloneable
/*     */ {
/*     */   public static QTPointerRef fromGraphicsExporter(GraphicsExporter paramGraphicsExporter)
/*     */     throws StdQTException
/*     */   {
/*  32 */     int[] arrayOfInt1 = { 0 };
/*  33 */     int[] arrayOfInt2 = new int[1];
/*  34 */     int i = GraphicsExportGetInputPtr(QTObject.ID(paramGraphicsExporter), arrayOfInt2, arrayOfInt1);
/*  35 */     StdQTException.checkError(i);
/*  36 */     return new QTPointerRef(arrayOfInt2[0], arrayOfInt1[0], paramGraphicsExporter);
/*     */   }
/*     */
/*     */   public static QTPointer fromSCData(SoundComponentData paramSoundComponentData)
/*     */   {
/*  45 */     if (getIntFromArray(paramSoundComponentData.getBytes(), 20) == 0)
/*  46 */       throw new QTNullPointerException("SCD buffer is not set");
/*  47 */     return new QTPointer(getIntFromArray(paramSoundComponentData.getBytes(), 20), paramSoundComponentData.getSampleSize() / 8 * paramSoundComponentData.getSampleCount(), paramSoundComponentData);
/*     */   }
/*     */
/*     */   public static QTPointer fromEncodedImage(EncodedImage paramEncodedImage)
/*     */     throws QTException
/*     */   {
/*  58 */     if ((paramEncodedImage instanceof ByteEncodedImage))
/*  59 */       return new QTPointer(((ByteEncodedImage)paramEncodedImage).getBytes());
/*  60 */     if ((paramEncodedImage instanceof IntEncodedImage)) {
/*  61 */       QTPointer localQTPointer = new QTPointer(paramEncodedImage.getSize(), false);
/*  62 */       int[] arrayOfInt = ((IntEncodedImage)paramEncodedImage).getInts();
/*  63 */       localQTPointer.copyFromArray(0, arrayOfInt, 0, arrayOfInt.length);
/*  64 */       return localQTPointer;
/*  65 */     }if ((paramEncodedImage instanceof RawEncodedImage)) {
/*  66 */       return (RawEncodedImage)paramEncodedImage;
/*     */     }
/*  68 */     return null;
/*     */   }
/*     */
/*     */   public QTPointer(int paramInt, boolean paramBoolean)
/*     */     throws QTException
/*     */   {
/*  77 */     super(paramInt, paramBoolean);
/*     */   }
/*     */
/*     */   public QTPointer(byte[] paramArrayOfByte)
/*     */     throws QTException
/*     */   {
/*  85 */     super(paramArrayOfByte.length, false);
/*  86 */     setBytesAt(0, paramArrayOfByte.length, paramArrayOfByte, 0);
/*     */   }
/*     */
/*     */   public QTPointer(QTHandleRef paramQTHandleRef, int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 100 */     super(paramInt2 + paramInt1 > paramQTHandleRef.getSize() ? paramQTHandleRef.getSize() - paramInt1 : paramInt2, false);
/*     */
/* 104 */     int i = getSize();
/*     */
/* 107 */     QTUtils.checkQTObjectSizeAndOffset(paramQTHandleRef, paramInt1, i, this);
/*     */
/* 109 */     int j = paramQTHandleRef.lockAndDeref(paramInt1);
/*     */
/* 111 */     BlockMove(j + 0, _ID() + 0, i);
/* 112 */     if (!paramQTHandleRef.isLocked()) paramQTHandleRef.unlock();
/*     */   }
/*     */
/*     */   public QTPointer(QTPointerRef paramQTPointerRef1, QTPointerRef paramQTPointerRef2)
/*     */     throws QTException
/*     */   {
/* 122 */     super(paramQTPointerRef1.getSize() + paramQTPointerRef2.getSize(), false);
/*     */
/* 125 */     if (paramQTPointerRef2.getSize() > 2147483647 - paramQTPointerRef1.getSize())
/*     */     {
/*     */       try {
/* 128 */         disposeQTObject(); } catch (QTException localQTException1) {
/*     */       }
/* 130 */       throw new ArrayIndexOutOfBoundsException();
/*     */     }
/*     */
/* 134 */     if (_ID() > 2147483647 - paramQTPointerRef1.getSize())
/*     */     {
/*     */       try {
/* 137 */         disposeQTObject(); } catch (QTException localQTException2) {
/*     */       }
/* 139 */       throw new ArrayIndexOutOfBoundsException();
/*     */     }
/*     */
/* 142 */     BlockMove(QTObject.ID(paramQTPointerRef1) + 0, _ID() + 0, paramQTPointerRef1.getSize());
/* 143 */     BlockMove(QTObject.ID(paramQTPointerRef2) + 0, _ID() + paramQTPointerRef1.getSize(), paramQTPointerRef2.getSize());
/*     */   }
/*     */
/*     */   QTPointer(int paramInt1, int paramInt2, Object paramObject) {
/* 147 */     super(paramInt1, paramInt2, paramObject);
/*     */   }
/*     */
/*     */   public Object clone()
/*     */   {
/* 152 */     return new QTPointer(makeAndCopyPtr(0, getSize()), getSize(), null);
/*     */   }
/*     */
/*     */   public void setSize(int paramInt)
/*     */     throws UtilException
/*     */   {
/* 165 */     if ((paramInt < 0) || (_ID() > 2147483647 - getSize())) {
/* 166 */       throw new ArrayIndexOutOfBoundsException();
/*     */     }
/* 168 */     SetPtrSize(_ID(), paramInt);
/* 169 */     UtilException.checkError(MemError());
/*     */   }
/*     */
/*     */   public void concatenate(QTPointerRef paramQTPointerRef)
/*     */     throws UtilException
/*     */   {
/* 175 */     int i = getSize();
/*     */
/* 178 */     if (i > 2147483647 - paramQTPointerRef.getSize()) {
/* 179 */       throw new ArrayIndexOutOfBoundsException();
/*     */     }
/* 181 */     setSize(getSize() + paramQTPointerRef.getSize());
/*     */
/* 184 */     if (_ID() > 2147483647 - i) {
/* 185 */       throw new ArrayIndexOutOfBoundsException();
/*     */     }
/* 187 */     BlockMove(QTObject.ID(paramQTPointerRef) + 0, _ID() + i, paramQTPointerRef.getSize());
/*     */   }
/*     */
/*     */   private static native int GraphicsExportGetInputPtr(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*     */
/*     */   private static native void BlockMove(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native void SetPtrSize(int paramInt1, int paramInt2);
/*     */
/*     */   private static native short MemError();
/*     */
/*     */   private static native int getIntFromArray(byte[] paramArrayOfByte, int paramInt);
/*     */
/*     */   private static native int getIntFromArray(int[] paramArrayOfInt, int paramInt);
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name:     quicktime.util.QTPointer
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.util.QTPointer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.