📄 qtcallback.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Mon Jul 15 11:50:51 PDT 2002 --><TITLE>: Class QTCallBack</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/QTCallBack.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../quicktime/std/clocks/ExtremesCallBack.html"><B>PREV CLASS</B></A> <A HREF="../../../quicktime/std/clocks/RateCallBack.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="QTCallBack.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">quicktime.std.clocks</FONT><BR>Class QTCallBack</H2><PRE>java.lang.Object | +--<A HREF="../../../quicktime/QTObject.html">quicktime.QTObject</A> | +--<B>quicktime.std.clocks.QTCallBack</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../quicktime/jdirect/InterfaceLib.html">InterfaceLib</A>, <A HREF="../../../quicktime/jdirect/PrimitivesLib.html">PrimitivesLib</A>, <A HREF="../../../quicktime/jdirect/QuickTimeLib.html">QuickTimeLib</A>, <A HREF="../../../quicktime/jdirect/SharedLibrary.html">SharedLibrary</A>, com.apple.jdirect.SharedLibrary</DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../quicktime/std/clocks/ExtremesCallBack.html">ExtremesCallBack</A>, <A HREF="../../../quicktime/std/clocks/RateCallBack.html">RateCallBack</A>, <A HREF="../../../quicktime/std/clocks/TimeCallBack.html">TimeCallBack</A>, <A HREF="../../../quicktime/std/clocks/TimeJumpCallBack.html">TimeJumpCallBack</A></DD></DL><HR><DL><DT>public abstract class <B>QTCallBack</B><DT>extends <A HREF="../../../quicktime/QTObject.html">QTObject</A><DT>implements <A HREF="../../../quicktime/jdirect/QuickTimeLib.html">QuickTimeLib</A></DL><P>Provides users with a defined operation at some time record of a clock's time base. Its methods offer access to a quicktime structure and its fields. Refer to QTCallBack in QuickTime <P> When an application schedules a QTCallBack with the callMeWhen method it can cancel and reschedule the callback as required. However, after it no longer requires the services of the QTCallBack it MUST call the cancelAndCleanup method to both cancel any impending callbacks and to dispose of the native structures that are constructed to call back from QuickTime into Java. <P> There is a very important issue that must be understood by Application developers when using these or any of the call back capabilities of QuickTime in a Java environment. QuickTime native calls are dispatched through a single gateway/lock and run to their completion. <P> A callback from QuickTime into Java is invoked through the Java application calling a native QuickTime function - in the case of the QTCallBack call back these callbacks are invoked through a direct or indirect call of the QuickTime MoviesTask function. <P> When the MoviesTask function invokes a callback and calls into Java this occurs in the same thread of execution. Any other native QuickTime calls originating from another thread are queued until the MoviesTask call is completed (including any callbacks that do not spawn their own threads). There exists a potential thread deadlock issue that can arise with the use of callbacks due to this underlying <i>modus operandi</i> that an applications developer may cause and must deal with. This is not a bug but is a feature of the current implementation. <P> For Example: Thread 1 calls MoviesTask (Movie.task or Movie.taskAll) which invokes a callback on say a QTDrawer object which has a synchronized redraw call. The callback's action is to redraw this QTDrawer object (which will make a native call to QuickTime to draw). <P> In Thread 2 awt issues a paint call which goes through to the QTDrawer's synchronized redraw call. This redraw call goes through to a native QuickTime call which halts waiting for the currently executing MoviesTask call to complete in Thread 1. <P> However we have a deadlock - Thread 1 is unable to complete and halts at the QTDrawer's redraw call because Thread 2 already has the synchronization lock for the QTDrawer object. However, thread 2 is unable to continue because Thread 1 has the native QuickTime lock. <P> One alternative is to have the callback that redraws the QTDrawer spawn another thread and redraw the QTDrawer in this spawn thread. Once the thread is spawned the callback can then complete and in the above scenario Thread 1 can finish the MoviesTask and Thread 2 would then be able to continue and the QTDrawer would redraw itself. <P> Many of the Callback methods in QuickTime are required to execute in place, in that QuickTime requires a result code in order to proceed. These callbacks should provide meaningful feedback when their execute method returns. The Subclasses of the QTCallBack however can execute asynchronously; QuickTime does not require a result code in order to proceed. This is also true of any of the execute methods with no return value.<P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> float</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#rateWhenCalled">rateWhenCalled</A></B></CODE><BR> This variable is set by the dispatch mechanism when the callback is invoked by QuickTime.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#timeWhenCalledMsecs">timeWhenCalledMsecs</A></B></CODE><BR> This variable is set by the dispatch mechanism when the callback is invoked by QuickTime.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> quicktime.std.clocks.CBRunner</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#upp">upp</A></B></CODE><BR> </TD></TR></TABLE> <A NAME="fields_inherited_from_class_quicktime.jdirect.QuickTimeLib"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface quicktime.jdirect.<A HREF="../../../quicktime/jdirect/QuickTimeLib.html">QuickTimeLib</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../quicktime/jdirect/QuickTimeLib.html#JDirect_MacOSX">JDirect_MacOSX</A>, <A HREF="../../../quicktime/jdirect/QuickTimeLib.html#libraryInstance">libraryInstance</A>, <A HREF="../../../quicktime/jdirect/QuickTimeLib.html#name">name</A></CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#callMeWhen()">callMeWhen</A></B>()</CODE><BR> Registers the callback.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#cancel()">cancel</A></B>()</CODE><BR> Cancel a callback event before it executes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#cancelAndCleanup()">cancelAndCleanup</A></B>()</CODE><BR> Cancel a callback event before it executes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#execute()">execute</A></B>()</CODE><BR> This method is called when the callback is executed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../quicktime/std/clocks/TimeBase.html">TimeBase</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#getTimeBase()">getTimeBase</A></B>()</CODE><BR> Retrieve the time base of a callback event.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../quicktime/std/clocks/QTCallBack.html#getType()">getType</A></B>()</CODE><BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -