Technical: QuickTime: Java
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

QuickTime for Java - Getting Started
There are several things that you should be aware of as you start using QuickTime for Java in your development. This page gives an overview of things you should pay attention to.


QuickTime function to QuickTime for Java method conversion

The QuickTime for Java classes are created from structures and data types that are found in the standard QuickTime C language header files. These data types provide the basic class structure of the QuickTime for Java API. Thus, the Movie data type in Movies.h becomes the Movie class. In general, the C function calls list the main data structure that they operate on as the first parameter of the function which then become the methods in this class. In line with Java conventions, all Class names are capitalized, while method names are not.

The methods of a class are created from a function. There is generally a one-to-one relationship between a native function call and a Java method.

The Java method's name is derived using the following conventions:

Native Function:
SetMovieGWorld
 
Java Method
setGWorld on the Movie class
 
Native Function:
MCSetControllerPort
 
Java Method
setPort on the MovieController class

There is JavaDoc documentation for each method. Some of the methods list the related QuickTime function call in bold. As an example:
QuickTime::EnterMovies()

Back to top


Garbage Collection and QuickTime for Java

Java has a built-in garbage collection mechanism. Therefore, QuickTime for Java classes do their own memory management. There are no explicit dispose calls in the QuickTime for Java API. These calls are called by the objects themselves when they are garbage collected. The quicktime.util.QTUtils.reclaimMemory() will run the garbage collector explicitly and can be used to ensure an immediate recovery of memory that is no longer referenced.

Back to top


Exceptions and Error Handling

If a Java method detects an error from a native call, it will throw an exception. The class of the exception that is thrown depends on the package in which the calling class resides. See the JavaDoc documentation for more information.

Back to top


Threads and QuickTime in Java

Java is a multi-threaded environment. However, the method calls that map a QuickTime function to a Java method do not provide any implicit synchronization support. If you share any QuickTime object between threads, you are responsible for dealing with any synchronization issues that may arise. The Java language provides easy services to let you do this via the

	synchronize (aJavaObject) { /*synchronized block of code*/ } 

syntax as well as synchronized method calls.

Back to top