Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

QuickTime for Java

QuickTime for Java APIs have been updated to match the latest QuickTime 5 APIs, Toolbox calls, and headers.

QuickTime for Java includes the addition of a new idling mechanism for time-based callbacks, as well as other new services and classes, discussed in this section.

In this section:

Idling Mechanism Re-Worked
Support for New Services
QTDrawing Listener and Notification Services


Idling Mechanism Re-Worked

The way in which time-based callbacks work in QuickTime for Java has been re-engineered. These callbacks are now triggered off interrupts or very high priority native threads, in the case of Mac OS X and Windows, rather than as previously triggered explicitly by QuickTime for Java calls to MoviesTask, which meant that QuickTime for Java had to create idling threads in order to make the callbacks fire.

Timing callbacks are used in the QuickTime for Java compositing services, like the Compositor Class, and are used to render frames when you set the rate of the Compositor to a rate that is not equal to zero. This gives QuickTime for Java much better performance because the callbacks are delivered executing Java code much closer to when they should be. This also means that you don't have to have an idling thread running in order to have these callbacks fire in the first place. If your application is using the time callbacks themselves, you don’t have to instantiate any sort of idling mechanism, as you would have done in the past. These callbacks will just fire when the time conditions are met. This results in a much more responsive system.

Support for New Services

QuickTime for Java also provides support for a number of new QuickTime services, including

In response to requests from developers, the QTFilter and QTTransition classes now support movies, compositors as sources, as well as still images.

There are, in addition, a number of minor enhancements and bug fixes in this release.

The JavaDoc for all of these new APIs in QuickTime for Java can be perused at:

http://developer.apple.com/quicktime/qtjava

QTDrawing Listener and Notification Services

Two new classes have been added to QuickTime for Java that provide notification services for DynamicImage classes upon completion of drawing operations. For notification of drawing operations, the DrawingNotifier interface is used, and the DrawingListener interface is used to register interest in drawing complete notifications.

Several QTJ classes were modified to use the DrawingNotifier interface: MoviePlayer, MoviePresenter, QTEffectPresenter, and SWCompositor. These classes provide a method addDrawingListener() that you may call to register your class.

Once your class that implements the DrawingListener interface is registered, you will get called whenever a drawing operation occurs on the Notifier object. This is useful, for example, if you want to know when a frame has been rendered in a Movie.

To make a class that uses the DrawingListener interface, you need to do the following:

public class MyListener implements DrawingListener {
    public void drawingComplete (QTDrawable drawable) {
        // do something cool when notification is received
    }
}

And then register your class with the component:

MyListener listener = new MyListener();
    // register MyListener w/ SWCompositor
theCompositor.addDrawingListener (listener);

When you no longer want to receive drawing notifications, call removeDrawingListener() with your DrawingListener object from the component you are no longer interested in.



< Previous PageNext Page > Hide TOC


Last updated: 2001-10-01




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice