Windows 98 contains several components to enhance your multimedia experience, whether you are creating, displaying, or simply playing titles. The multimedia features of Windows 98 include Microsoft DirectX®, the Media Control Interface (MCI), AutoPlay, and improved support for multimedia files and devices.
Microsoft DirectX is a set of application programming interfaces (APIs) that allow applications to gain access directly to a system’s multimedia hardware. The DirectX APIs included in Windows 98 can be broken down into the following components:
The Media Control Interface (MCI) provides applications created for Windows 98 with device-independent capabilities for controlling such media devices as audio hardware, videodisc players, and animation players. This interface works with MCI device drivers to interpret and run such MCI commands as pause, play, and stop.
MCI provides a set of core commands for a broad range of media devices. For example, MCI uses the same command to begin playback of a waveform-audio file, a videodisc track, and an animation sequence. It also provides extended commands for using particular device types with unique capabilities, such as a frame-based time format used in animation. For more information about MCI drivers and commands, see the Microsoft Windows 98 Device Development Kit.
A device type identifies a class of MCI devices that respond to a common set of commands. Table 12.1 lists the currently defined MCI device types.
Table 12.1 MCI device types
Device type | Description |
---|---|
animation | Animation device |
cdaudio | Compact disc (CD) audio player |
dat | Digital audio tape player |
digitalvideo | Digital video in a window (not graphics device interface [GDI]–based) |
other | Undefined MCI device |
overlay | Overlay device (analog video in a window) |
scanner | Image scanner |
sequencer | MIDI sequencer |
vcr | Videocassette recorder or player |
videodisc | Videodisc player |
waveaudio | Audio device that plays digitized waveform-audio files |
A multimedia file is usually maintained in one of the formats described in Table 12.2.
Table 12.2 Multimedia file formats
Format | Corresponding file name extension |
---|---|
Video for Windows | .avi |
Waveform-audio | .wav |
Moving Picture (MPEG) | .mpg |
Quick Time for Windows | .mov |
Musical Instrument Digital Interface (MIDI) | .mid |
Multimedia files are stored on a compact disc, a local hard disk drive, a network file server, or another storage medium. The amount of data that the storage medium can continuously supply to the file system for streaming formats constrains the playback quality.
A multimedia data stream (such as an AVI file) generally contains multiple components, such as digital-video data, audio data, text, and perhaps other data (such as hot spot information, additional audio tracks, and so on). As multimedia information is read from the CD-ROM drive, the multimedia subsystem determines what the data stream contains and then separates and routes the data accordingly.
To provide the best possible performance from double-speed and faster CD-ROM drives, Windows 98 includes the 32-bit CD-ROM file system (CDFS) for reading files from CD-ROM drives quickly and efficiently. For more information about CDFS, see Chapter 26, "Performance Tuning," and Chapter 28, "Windows 98 Architecture."
CDFS replaces most Windows version 3.1 MSCDEX drivers.
Built-in support for common multimedia authoring devices makes it easy to set up a computer for step capture, a process in which a user captures digital-video data one frame at a time; the data is usually compressed later. This is a slow process, but it results in the highest possible quality of digital video.
To play the contents of a videotape on a computer, you must connect the video and audio outputs from the VCR to the video-capture or overlay and to the audio inputs of the computer. You might also need to install an MCI digital-video device driver.
WDM audio class architecture performs all audio processing in kernel mode. Any number of filters can be connected into the filter graph to manipulate audio/video streams. WDM also provides a more complete architecture than was possible earlier. Code common to all audio hardware on a given bus is now part of the operating system, making for faster development with more consistent results.
WDM audio supports the following features for games under Windows 98:
WDM audio supports the following features for CD and DVD media playback under Windows 98:
Windows 98 contains support for technologies that require data to be moved in real time. Digital audio, video, and scanner/camera support may contain data streams that can overwhelm the PCI bus. The Streaming Class Driver (file name Stream.sys) was written to address this issue.
WDM Streaming is directly based on the DirectShow model of user mode filters. In the context of WDM Streaming, a filter represents a kernel-mode driver. The Streaming Class Driver takes the API calls that normally communicate back and forth from the user level (ring 3) to the kernel level (ring 0) and pushes them down so they occur mostly at the kernel level. This allows data streams to be passed through the operating system and to move at a faster pace, because CPU cycles are not used to pass the information back and forth between the user mode and kernel levels.
Typically, time-sensitive applications are divided into several tasks.
Figure 12.1 shows the typical path that a data stream follows. The data stream (for instance, an MPEG-2 data stream with audio) is passed to the first filter to decompress the video stream. Then the entire stream is handed back to the device driver in kernel mode. When the audio portion of the data stream needs to be decoded, the entire data stream is passed back up to the user level. These transitions are CPU-intensive and are not the most efficient way to pass the data stream, because each transition carries the extra load to switch between the two levels, and the data may have to go through various validation stages.
Figure 12.1 Typical data stream path in a non-WDM case
WDM Streaming enables more efficient data streaming, as shown in Figure 12.2. In this example, almost all data streaming takes place in kernel mode. The filter modules executing in user mode apply controls only to the kernel-mode device drivers/hardware. For example, in the case of an audio data stream, a user-mode filter can apply a loudness control to the kernel-mode driver/hardware renderer.
Note
Kernel streaming (KS) filters are not necessarily bound to any piece of hardware.
Figure 12.2 WDM data stream path
Additionally, a stream may be produced and consumed entirely in kernel mode, with only mechanisms exposed to the user-mode client, as shown in Figure 12.3. In this case, a source filter reading a file, for example, or picking up data off a 1394 bus passes it through some hardware-based codec and on through the remaining filters. If the filters in between reside on the same physical hardware, they may negotiate a faster transfer mechanism, or interface, which avoids memory copies and may avoid use of the host CPU in their communication.
Figure 12.3 Data stream produced and consumed in kernel mode
DVD places full-length motion pictures on digital disc-sized media. DVD hardware and software are specifically tailored to read multiple digitally stored data streams concurrently. DVD is not computer-only media; many DVD players (which are similar to laser disc players) on the market are designed to feed the images directly to a television. DVD has two major compression technologies, MPEG-2 and Dolby Digital (sometimes referred to as AC-3), which are used to store video and audio on a disc. This allows more than two hours of better-than-laser-disc video and better-than-CD audio to be stored on a single disc, opening up new possibilities for content providers. Such possibilities include the ability to have different screen formats (for instance, letterbox, pan and scan, and so on), different soundtracks, different languages, and different ratings (such as both R and PG versions of a movie) all on the same disc.
DVD requires a special drive as well as a decoder (a hardware decoder card, a software decoder, or a combination of the two). DVD drives use a laser with a shorter wavelength than that used on standard CD-ROM drives, which allows it to read data stored in smaller areas on the media. Standard CD-ROM drives cannot read DVD discs. However, DVD drives can read standard CD-ROM data and audio CDs.
Full-motion video is stored on DVD in the MPEG-2 format. Because high rates of transfer are necessary to read and display full-screen, real-time data, most of the decoding is done at the hardware level, so your DVD system must have a decoder.
The current capacity of a DVD disc starts at 4.7 billion bytes. Vendors have developed technology to make both sides of the media readable and to layer data on each side (for example, a gold layer of data can be placed above a silver layer). Lower laser power is used to read the top layer, and increased laser power allows the bottom layer to be read. Combining these two options increases the total possible capacity of a single DVD disc to 17 billion bytes.
A DVD drive has many uses. Although it was specifically designed to handle the challenges that come with displaying full-motion video, its massive storage capacity allows it to perform in other ways, including the following:
DVD technology includes several software components: MPEG-2, AC-3 (audio streaming), Subpicture, two class drivers (a ROM class driver and WDM), UDF file system, DirectShow, DirectDraw, and a copyright-protection encryption key.
MPEG-2 is a type of video compression that saves space by saving only the data that changes on the screen. So rather than storing a 640 x 480 x 12 (12-bit color depth) for each frame, only those pixels that change are encoded.
AC-3 is a type of audio stream developed by Dolby Labs. It allows up to five separate audio channels (left and right front, left and right rear, and center) and a subwoofer channel.
DVD discs contain a third data stream called Subpicture. The Subpicture stream delivers the subtitles and any other movie add-on data, such as director’s comments, that can be displayed while playing the movie.
DVD-ROM drives use a specific command set referred to as the Mt. Fuji specification. The Windows 98 implementation of this command set is provided using the class driver/minidriver architecture conforming to WDM. A class driver is used to provide support for the full Mt. Fuji specification, while the manufacturer of the DVD drive provides a device-specific minidriver that handles device-specific functions. This allows both Windows 98 and Windows NT version 5.0 to read DVD disc data sectors.
Issues with playing a full-length movie include the fact that data is moved in a different way. Data is usually thought of as being read from the media, loaded into memory, and then used. With multimedia applications, the process is slightly different. Because a full-length movie requires that a large amount of data be moved while playing the movie—the data must be read sequentially, displayed, and cleared by the time the next frame is ready to be displayed. The Streaming Class driver was introduced to address this real-time need. For more information about this driver, see "WDM Streaming Class Driver" earlier in this chapter as well as Chapter 30, "Hardware Management."
Data on a DVD disc is stored using a file system called Universal Disc Format (UDF). Support for this file system is implemented using installable file system architecture of Windows 98.
DirectShow (formerly known as ActiveMovie) provides support for a DVD Navigator/Splitter, proxy filters for video and audio streams, a video mixer, a video renderer, and an audio renderer. DVD movies have the equivalent of channels for the various data streams necessary for a full-length movie. Data streams consist of not only the MPEG portion but also digital audio, which may have Dolby surround sound and close captioning information. For a single video image, DVD can provide up to 8 languages/sound tracks and 32 subtitle tracks, and supports up to 9 angles and 8 ratings. DirectShow 2.0 provides support for keeping track of these various data streams and passing them to the proper codec.
Decoded video can become quite large. An MPEG-2 stream starts out at a rate of around 5–10 megabits per second (Mbps). After the stream is decoded, it can easily exceed 100 Mbps. The processing of this amount of information in a continuous stream could overwhelm the PCI bus. So most of the decoding of the information has been moved back to the hardware level by using dedicated MPEG decoder cards. Support for these decoder cards is built in to DirectX 5.0, with DirectDraw’s support for Video Port Extensions (VPEs). Video Port Extensions allow the MPEG stream to be written directly to the frame buffer memory of the Video Card from the MPEG decoder card. Data transfer occurs through a special cable that connects the video card and the decoder card at the hardware level. DirectDraw 5.0 allows the data stream to be moved through the hardware layer while keeping track of such things as synchronization.
Copyright protection for DVD is provided by encrypting key sectors on a disc and then decrypting those sectors before decoding them. Microsoft provides support for both software and hardware decrypters using a software module that enables authentication between the decoders and the DVD-ROM drives in a computer.
As part of the Copyright Protection scheme used for DVD, the DVD Consortium has set up six worldwide regions. Discs are playable on DVD devices in some or all of the regions according to regional codes set by the creators of the content. Microsoft provides software that responds to the regionalization codes as required by the DVD Consortium and as part of the decryption licenses.
DVD hardware and software requirements are described in the following sections.
A DVD-ready system must meet the specifications listed in the PC 97 Hardware Design Guide. These requirements are described in Table 12.3.
Table 12.3 DVD hardware requirements
Hardware | Required | Recommended |
---|---|---|
Processor | P120 (or equivalent) with 256-KB cache | P166 (or equivalent) with 256-KB cache; MMX enabled |
RAM | 16 MB | 32 MB |
Graphics display | 800 x 600 x 16 bpp with Video Port Extensions (VPEs) | 1024 x 786 x 16 bpp; 2-D accelerator |
Decoder | Supported Decoder Card | Supported Decoder Card; NTSC / PAL TV Output |
The following decoder cards and DVD drives are directly supported in Windows 98:
Windows 98 ships with a DVD player named Dvdplay.exe. Dvdplay.exe is a stand-alone executable and has no program-specific DLLs associated with it. Like most applets shipped with Windows, DVDPlay has only basic functionality and may be replaced by a third-party application. If you have a supported decoder, DVD Player can be installed and uninstalled from the Control Panel using the Add/Remove Programs option.
Note
When the DVD Player is launched, it searches all local drives in alphabetical order, starting with C, looking for a folder called Video_TS. When this folder is located, the data file within it is loaded, and video streaming begins. If this folder exists on a drive that comes before the DVD drive, the player will try to play the data in the first folder it finds. This is also an issue with systems that have multiple DVD drives.
The basic DVD program is shown in Figure 12.4. It contains, from left to right, buttons for choosing a channel; VCR style controls for controlling playback; and menu navigation buttons for using the on-screen menu choices.
Figure 12.4 Basic DVD player