Package quicktime.std.sg

Source Code of quicktime.std.sg.SGDispatcher$SGHdl

/*     */ package quicktime.std.sg;
/*     */
/*     */ import java.security.AccessController;
/*     */ import java.security.PrivilegedAction;
/*     */ import quicktime.QTCallbackManagement;
/*     */ import quicktime.QTException;
/*     */ import quicktime.std.comp.ComponentDescription;
/*     */ import quicktime.util.QTHandleRef;
/*     */ import quicktime.util.QTPointerRef;
/*     */
/*     */ final class SGDispatcher
/*     */ {
/*     */   private String methodName;
/*     */   private String methodSig;
/*     */   private int procInfo;
/*     */   private SGDataProc cb;
/*     */   private SequenceGrabber sg;
/*     */
/*     */   SGDispatcher(SequenceGrabber paramSequenceGrabber, SGDataProc paramSGDataProc)
/*     */   {
/*  23 */     this.methodName = "callbackProc";
/*  24 */     this.methodSig = "(IIIIIISI)S";
/*  25 */     this.procInfo = 3932128;
/*  26 */     this.cb = paramSGDataProc;
/*  27 */     this.sg = paramSequenceGrabber;
/*     */   }
/*     */
/*     */   private short callbackProc(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, short paramShort, int paramInt7)
/*     */   {
/*  84 */     ComponentDescription localComponentDescription = new ComponentDescription();
/*  85 */     int i = GetComponentInfo(paramInt1, localComponentDescription.getBytes(), 0, 0, 0);
/*  86 */     if (i < 0)
/*  87 */       return (short)i;
/*     */     try
/*     */     {
/*  90 */       int j = localComponentDescription.getSubType();
/*  91 */       Object localObject = null;
/*  92 */       if (j == 1936684398) {
/*  93 */         localObject = new SGSoundChannel(paramInt1, this.sg);
/*     */       }
/*  95 */       else if (j == 1986618469) {
/*  96 */         localObject = new SGVideoChannel(paramInt1, this.sg);
/*     */       }
/*  98 */       else if (j == 1836413801) {
/*  99 */         localObject = new SGMusicChannel(paramInt1, this.sg);
/*     */       }
/* 101 */       else if (j == 1952807028) {
/* 102 */         localObject = new SGTextChannel(paramInt1, this.sg);
/*     */       }
/*     */       else {
/* 105 */         return -2005;
/*     */       }
/* 107 */       SGPtr localSGPtr = new SGPtr(paramInt2, paramInt3, this);
/*     */
/* 109 */       int k = this.cb.execute((SGChannel)localObject, localSGPtr, paramInt4 == 0 ? 0 : getIntFromPointer(paramInt4, 0), paramInt5, paramInt6, paramShort);
/*     */
/* 111 */       if (k != 0) {
/* 112 */         setIntInPointer(paramInt4, 0, k);
/*     */       }
/* 114 */       return 0;
/*     */     } catch (QTException localQTException) {
/* 116 */       return (short)localQTException.errorCode();
/*     */     }
/*     */   }
/*     */
/*     */   int ID()
/*     */   {
/* 122 */     SGDispatcher localSGDispatcher = this;
/* 123 */     AccessController.doPrivileged(new PrivilegedAction() { private final Object val$target;
/*     */
/* 125 */       public Object run() { QTCallbackManagement.registerForCallback(this.val$target, SGDispatcher.this.methodName, SGDispatcher.this.methodSig);
/* 126 */         return null;
/*     */       }
/*     */     });
/* 129 */     return hashCode();
/*     */   }
/*     */
/*     */   void cleanupMethodClosure() {
/* 133 */     SGDispatcher localSGDispatcher = this;
/* 134 */     AccessController.doPrivileged(new PrivilegedAction() { private final Object val$target;
/*     */
/* 136 */       public Object run() { QTCallbackManagement.unregisterForCallback(this.val$target);
/* 137 */         return null; }
/*     */     });
/*     */   }
/*     */
/*     */   void cleanup()
/*     */   {
/* 143 */     cleanupMethodClosure();
/*     */   }
/*     */
/*     */   private static native short GetComponentInfo(int paramInt1, byte[] paramArrayOfByte, int paramInt2, int paramInt3, int paramInt4);
/*     */
/*     */   private static native void setIntInPointer(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int getIntFromPointer(int paramInt1, int paramInt2);
/*     */
/*     */   static class SGHdl extends QTHandleRef
/*     */   {
/*     */     SGHdl(int paramInt)
/*     */     {
/* 158 */       super(null, false);
/*     */     }
/*     */   }
/*     */
/*     */   static class SGPtr extends QTPointerRef
/*     */   {
/*     */     SGPtr(int paramInt1, int paramInt2, Object paramObject)
/*     */     {
/* 152 */       super(paramInt2, paramObject);
/*     */     }
/*     */   }
/*     */ }

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

Related Classes of quicktime.std.sg.SGDispatcher$SGHdl

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.