Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

QuickTime for Java

From Wikipedia, the free encyclopedia
Software library for multimedia processing

QuickTime for Java orQTJ is asoftware library that allows software written in theJava programming language to providemultimedia functionality, by making calls into the nativeQuickTime library. In practice, it allows Java applications onMac OS,Mac OS X andMicrosoft Windows to support the capture, editing, playback, and export of many differentmedia formats andcodecs.

QTJ has been deprecated by Apple.[1]

History

[edit]

Owen W. Linzmayer, inApple Confidential 2.0, traced QuickTime for Java's genesis back toKaleida Labs, a spin-off company created byApple Computer andIBM, noting that it and some Unicode text classes were the only Mac software salvaged from the four-year, $150 million disaster.[2] Ported to the Mac OS, it was developed under the code-name "Biscotti", and first released as a public beta in 1999.[citation needed] Later versions were installed by default with Mac OS and Mac OS X, and were an optional part of the QuickTime install for Windows.

QTJ 6.1

[edit]

In 2003, Apple issued a Java 1.4.1 implementation that broke any QTJ applications that tried to run under 1.4.1 on Mac OS X. The underlying problem was Apple's move fromCarbon toCocoa for theirAWT implementation, and the removal of a Java-to-native library called "JDirect" that QTJ relied on. QTJ applications could still run under Java 1.3.1, but apps that did not specify the version of Java they required, or that needed 1.4 features, were rendered unusable.

Later in 2003, Apple released a new version of QTJ that dealt with the incompatibilities, by offering a compatible but scaled-down version of the GUI classes. This 6.1 version of QTJ also radically changed the API, so that instead of having developers create GUI components and associateMovies or other renderable objects with them, the developers now needed to start with theMovie and request a suitable component from a factory. The new version also neglected to provide a component to show a visual preview of the input from a capture device, such as awebcam orcamcorder.[3]

Design

[edit]

QTJ lays anobject-oriented API on top of the native C-based QuickTime library. It does this by associating commonstructs and the functions that work with them into classes. For example, theMovie struct is the basis of the classquicktime.std.movies.Movie, with functions likeNewMovieFromFile andGetMovieTrackCount becoming the instance methodsfromFile() andgetTrackCount() respectively. The result is more like a genuine object-oriented API than other C-to-Java adaptations (such asJOGL, which dumps the OpenGLheader files into classes with thousands of static methods).[4]

The Cocoa-basedQTKit is a similar attempt to put an object-oriented layer atop the procedural QuickTime library, usingObjective-C.

Apple's use of the top-levelpackage namequicktime violates the Java Language's Specification convention that packages use a reverse-domain-name scheme, such ascom.apple.quicktime. However, as Apple owns the "QuickTime" trademark, there is no realistic chance of anamespace collision, the prevention of which is the purpose of the package naming convention.

QTJ is not a Java implementation of QuickTime. It is a Javawrapper around native QuickTime calls. For this reason, it can only run on systems that have the QuickTime libraries installed, namely the classic Mac OS (which is no longer supported), Mac OS X, and Windows.

Features

[edit]

QTJ offers access to most of the native QuickTime library, including

  • Playback
  • Editing
  • Capture
  • Graphic import and export
  • Movie import and export
  • Sample-level access

As a wrapper around QuickTime, QTJ also inherits support for a vast collection of media formats and codecs, includingMPEG-1,MPEG-4,H.264,AAC,Sorenson Video,Flash,3GPP,WAV,AIFF, and more. Since QuickTime itself can be extended, QTJ can pick up support for formats such asDivX andOgg Vorbis through the use of third-party QuickTimecomponents.

Code Example

[edit]

The following example shows an AWT file-selection dialog and then tries to import and play the selected media file.

importjava.io.File;importjava.awt.*;importquicktime.*;importquicktime.std.movies.Movie;importquicktime.app.view.QTFactory;importquicktime.io.*;publicclassTrivialQTJPlayerextendsFrame{publicstaticvoidmain(String[]args){try{QTSession.open();Framef=newTrivialQTJPlayer();f.pack();f.setVisible(true);}catch(Exceptione){e.printStackTrace();}}publicTrivialQTJPlayer()throwsQTException{FileDialogfd=newFileDialog(this,"TrivialJMFPlayer",FileDialog.LOAD);fd.setVisible(true);Filef=newFile(fd.getDirectory(),fd.getFile());OpenMovieFileomf=OpenMovieFile.asRead(newQTFile(f));Moviem=Movie.fromFile(omf);Componentc=QTFactory.makeQTComponent(m).asComponent();add(c);m.start();}}

Most of the code in this example involves itself with setting up the GUI. The only calls to QTJ are the calls toOpenMovieFile.asRead() andMovie.fromFile(), which create a QuickTime movie from the specified file, and the calls to create an AWT component from theQTFactory. This example puts the movie into the frame and immediately starts playing it; if a control bar (aka a "scrubber") were desired, you would create aMovieController from theMovie and then create a component from the controller, rather than from the movie.

Status and Outlook

[edit]

QTJ's acceptance is limited by its nature as a wrapper around Apple's proprietary QuickTime library. It does not exist for any platform other than Mac and Windows, and cannot until and unless Apple ports QuickTime to another platform, such as Linux.

Currently most of QTJ is broken on recent Windows-running computers. Windows machines that use the no-execute (NX) page-protection security feature of recent CPUs cannot run even the demos without changing the configuration. This can be easily verified by a developer via a test-run of one of the demos coming with QTJ. An "execution protection violation" is reported and the program is aborted by Windows. This renders QTJ unsuitable for end-user application development due to the necessary complicated configuration of the NX feature.

Following the 2003 release of QTJ 6.1, Apple has made few updates to QTJ, mostly fixing bugs. Notably, QuickTime 7 was the first version of QuickTime not to be accompanied or followed by a QTJ release that wrapped the new native API's. QuickTime 7's new API's, such as those for working with metadata and with frame-reordering codecs, are not available to QTJ programmers. Apple has also not offered new classes to provide the capture preview functionality that was present in versions of QTJ prior to 6.1. Indeed, QTJ is dependent on some native API's that Apple no longer recommends, most notablyQuickDraw.

See also

[edit]

External links

[edit]

References

[edit]
  1. ^"QTJava will be depreciated next year". Archived fromthe original on 2009-10-05. Retrieved2010-05-04.
  2. ^Owen W. Linzmayer,Apple Confidential 2.0
  3. ^The Return of the Blue Q
  4. ^Chris Adamson,QuickTime for Java: A Developer's Notebook
Java desktop
APIs
Deprecated APIs
Open-source
Retrieved from "https://en.wikipedia.org/w/index.php?title=QuickTime_for_Java&oldid=1301639013"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp