QuickTime For Java
   HOME

TheInfoList



OR:

QuickTime for Java or QTJ is a
software library In computing, a library is a collection of resources that can be leveraged during software development to implement a computer program. Commonly, a library consists of executable code such as compiled functions and classes, or a library can ...
that allows software written in the
Java programming language Java is a high-level, general-purpose, memory-safe, object-oriented programming language. It is intended to let programmers ''write once, run anywhere'' ( WORA), meaning that compiled Java code can run on all platforms that support Jav ...
to provide
multimedia Multimedia is a form of communication that uses a combination of different content forms, such as Text (literary theory), writing, Sound, audio, images, animations, or video, into a single presentation. T ...
functionality, by making calls into the native
QuickTime QuickTime (or QuickTime Player) is an extensible multimedia architecture created by Apple, which supports playing, streaming, encoding, and transcoding a variety of digital media formats. The term ''QuickTime'' also refers to the QuickTime Pla ...
library. In practice, it allows Java applications on
Mac OS Mac operating systems were developed by Apple Inc. in a succession of two major series. In 1984, Apple debuted the operating system that is now known as the classic Mac OS with its release of the original Macintosh System Software. The system ...
,
Mac OS X macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
and
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
to support the capture, editing, playback, and export of many different
media formats Media may refer to: Communication * Means of communication, tools and channels used to deliver information or data ** Advertising media, various media, content, buying and placement for advertising ** Interactive media, media that is int ...
and
codec A codec is a computer hardware or software component that encodes or decodes a data stream or signal. ''Codec'' is a portmanteau of coder/decoder. In electronic communications, an endec is a device that acts as both an encoder and a decoder o ...
s. QTJ has been deprecated by Apple.


History

Owen W. Linzmayer, in ''Apple Confidential 2.0'', traced QuickTime for Java's genesis back to Kaleida Labs, a spin-off company created by
Apple Computer Apple Inc. is an American multinational corporation and technology company headquartered in Cupertino, California, in Silicon Valley. It is best known for its consumer electronics, software, and services. Founded in 1976 as Apple Computer Co ...
and
IBM International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
, noting that it and some Unicode text classes were the only Mac software salvaged from the four-year, $150 million disaster. Ported to the Mac OS, it was developed under the code-name "Biscotti", and first released as a public beta in 1999. 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

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 from
Carbon Carbon () is a chemical element; it has chemical symbol, symbol C and atomic number 6. It is nonmetallic and tetravalence, tetravalent—meaning that its atoms are able to form up to four covalent bonds due to its valence shell exhibiting 4 ...
to
Cocoa Cocoa may refer to: Chocolate * Chocolate * ''Theobroma cacao'', the cocoa tree * Cocoa bean, seed of ''Theobroma cacao'' * Chocolate liquor, or cocoa liquor, pure, liquid chocolate extracted from the cocoa bean, including both cocoa butter and ...
for their AWT 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 associate Movies or other renderable objects with them, the developers now needed to start with the Movie 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 a
webcam A webcam is a video camera which is designed to record or stream to a computer or computer network. They are primarily used in Videotelephony, video telephony, live streaming and social media, and Closed-circuit television, security. Webcams can b ...
or
camcorder A camcorder is a self-contained portable electronic device with video and recording as its primary function. It is typically equipped with an articulating screen mounted on the left side, a belt to facilitate holding on the right side, hot-sw ...
.


Design

QTJ lays an
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
API on top of the native C-based QuickTime library. It does this by associating common structs and the functions that work with them into classes. For example, the Movie struct is the basis of the class quicktime.std.movies.Movie, with functions like NewMovieFromFile and GetMovieTrackCount becoming the instance methods fromFile() and getTrackCount() respectively. The result is more like a genuine object-oriented API than other C-to-Java adaptations (such as
JOGL Java OpenGL (JOGL) is a wrapper library that allows OpenGL to be used in the Java programming language. It was originally developed by Kenneth Bradley Russell and Christopher John Kline, and was further developed by the Game Technology Group at Su ...
, which dumps the OpenGL
header file An include directive instructs a text file processor to replace the directive text with the content of a specified file. The act of including may be logical in nature. The processor may simply process the include file content at the location of ...
s into classes with thousands of static methods).Chris Adamson, ''QuickTime for Java: A Developer's Notebook'' The Cocoa-based QTKit is a similar attempt to put an object-oriented layer atop the procedural QuickTime library, using
Objective-C Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style message passing (messaging) to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was ...
. Apple's use of the top-level package name quicktime violates the Java Language's Specification convention that packages use a reverse-domain-name scheme, such as com.apple.quicktime. However, as Apple owns the "QuickTime" trademark, there is no realistic chance of a
namespace In computing, a namespace is a set of signs (''names'') that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified. Namespaces ...
collision, the prevention of which is the purpose of the package naming convention. QTJ is not a Java implementation of QuickTime. It is a Java ''wrapper'' 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

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, including
MPEG-1 MPEG-1 is a Technical standard, standard for lossy compression of video and Audio frequency, audio. It is designed to compress VHS-quality raw digital video and CD audio down to about 1.5 Mbit/s (26:1 and 6:1 compression ratios respectively ...
,
MPEG-4 MPEG-4 is a group of international standards for the compression of digital audio and visual data, multimedia systems, and file storage formats. It was originally introduced in late 1998 as a group of audio and video coding formats and related ...
,
H.264 Advanced Video Coding (AVC), also referred to as H.264 or MPEG-4 Part 10, is a video compression standard based on block-oriented, motion-compensated coding. It is by far the most commonly used format for the recording, compression, and d ...
,
AAC AAC may refer to: Aviation * Advanced Aircraft, a company from Carlsbad, California * Airborne aircraft carrier, a type of aircraft * Alaskan Air Command, a radar network * American Aeronautical Corporation, a company from Port Washington, New ...
, Sorenson Video,
Flash Flash, flashes, or FLASH may refer to: Arts, entertainment, and media Fictional aliases * The Flash, several DC Comics superheroes with super speed: ** Flash (Jay Garrick) ** Barry Allen ** Wally West, the first Kid Flash and third adult Flash ...
,
3GPP The 3rd Generation Partnership Project (3GPP) is an umbrella term for a number of standards organizations which develop protocols for mobile telecommunications. Its best known work is the development and maintenance of: * GSM and related 2G and ...
,
WAV Waveform Audio File Format (WAVE, or WAV due to its filename extension; pronounced or ) is an audio file format standard for storing an audio bitstream on personal computers. The format was developed and published for the first time in 1991 ...
,
AIFF AIFF may refer to: * Audio Interchange File Format * All India Football Federation, the national governing body of Association football in India Film festivals * Addis International Film Festival, Addis Ababa, Ethiopia * Alexandria Internation ...
, and more. Since QuickTime itself can be extended, QTJ can pick up support for formats such as
DivX DIVX (Digital Video Express) is a discontinued digital video format. Created in part by Circuit City, it was an unsuccessful attempt to create an alternative to video rental in the United States. The format's poor reception from consumers resu ...
and
Ogg Vorbis Vorbis is a free and open-source software project headed by the Xiph.Org Foundation. The project produces an audio coding format and software reference encoder/decoder (codec) for lossy audio compression, libvorbis. Vorbis is most common ...
through the use of third-party QuickTime ''components''.


Code Example

The following example shows an AWT file-selection dialog and then tries to import and play the selected media file. import java.io.File; import java.awt.*; import quicktime.*; import quicktime.std.movies.Movie; import quicktime.app.view.QTFactory; import quicktime.io.*; public class TrivialQTJPlayer extends Frame Most of the code in this example involves itself with setting up the GUI. The only calls to QTJ are the calls to OpenMovieFile.asRead() and Movie.fromFile(), which create a QuickTime movie from the specified file, and the calls to create an AWT component from the QTFactory. 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 a MovieController from the Movie and then create a component from the controller, rather than from the movie.


Status and Outlook

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 notably
QuickDraw QuickDraw was the 2D graphics library and associated application programming interface (API) which is a core part of classic Mac OS. It was initially written by Bill Atkinson and Andy Hertzfeld. QuickDraw still existed as part of the libraries ...
.


See also

*
Java Media Framework The Java Media Framework (JMF) is a Java library A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. ...

Xuggler
Java API for video encoding and decoding that works on Mac, Linux and Windows


External links


QuickTime for Java
at Apple Developer Connection


References

{{Java desktop
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
Java APIs