Chapter 1 —
Introduction

> This chapter introduces Multimedia Services for DIGITAL UNIX (MMS) and the Multimedia Services applications. This chapter also describes how these applications are launched or invoked using either the Common Desktop Environment (CDE) or UNIX command line.

Multimedia Services for DIGITAL UNIX

> > This section contains an overview of Multimedia Services for DIGITAL UNIX. Topics include:

> > - What is Multimedia Services?
> > - Applications included with Multimedia Services
> > - An Architectural Overview of DIGITAL UNIX Multimedia Services

What is Multimedia Services?

> Multimedia Services brings audio and video capabilities to DIGITAL workstations through a set of end-user applications and a software development kit. Multimedia Services provides support for built-in and optional audio/video hardware. The application interface is based on the same multimedia interface provided in Microsoft Windows NT and Windows 3.1 operating systems including Video for Windows.

Applications Included with Multimedia Services

> The Multimedia Services applications fall into two groups. The first group offers broad utility functions with both graphical and UNIX command line interfaces. The following list introduces these applications and their functions:

> - Audio Control - Adjusts input and output volumes of audio devices, selects ports, and shows available formats.
> - DECsound - Serves as a tape recorder utility for recording, editing, and playing back audio messages. DECsound can play back sample audio clips (.wav and .au files) shipped with the system.
> - AlphaVCR - Records and plays audio and video data in AVI and MPEG formats. AlphaVCR can play sample audio and video clips (.avi and .mpg files) shipped with the system.
> - Transcode- Converts AVI files to either MPEG-1 or MPEG-2 format.
> - Video Odyssey - A screen saver that plays AVI clips.

> The second group of Multimedia Services applications do not have a graphical interface, and have a more limited scope. These command line applications are run from the UNIX command line. The following list introduces these applications and their functions:

> - audiodevices - Displays audio device capabilities.
> - audioplay - Plays an audio file.
> - audiorecord - Records audio to a file.
> - audioselectports - Selects input or output ports for audio devices.
> - jpegconvert - Converts AVI files containing compressed JPEG video.

> The Multimedia Services applications are shipped with the run-time kit (MMERT240 subset) and installed during the software installation procedure in the directory /usr/bin/mme. Place /usr/bin/mme and /usr/bin/X11 in your search path to access these applications. In addition, most of these applications use the X Window System services and require that the DISPLAY environment variable be set correctly.

> The MMERTSMPLDAT240 installation subset contains sample data files which are installed in the directory /usr/examples/mme/sample_data. The files in the avi and mpeg subdirectories can be played back with the AlphaVCR application and the files in the avi subdirectory can be used by Video Odyssey. The files in the wave and sun subdirectories can be played back with the DECsound application.

> Use the -help command line switch with each application (except Audio Control) to display its associated help message. The help message lists the command line switches that can be used with that application.

Architectural Overview of the DIGITAL UNIX MMS Run-Time Environment

> This section introduces the components of the MMS Run-Time Environment. This information is provided to help you understand how MMS applications and the MMS Run-Time Environment work. Figure 1-1 shows a Client-Server model of the MMS Run-Time Environment.

> Figure 1-1 Client-Server Model for MMS Run-Time Environment

> The MMS Run-Time Environment can be divided into two portions; client and server. The client portion is synonymous with an application. Each application is a client to the multimedia server mmeserver process. The server acts as an intermediary between each client and the software and hardware multimedia resources on the system. The primary reason for this client-server architecture is to allow multiple client applications to communicate with individual hardware devices simultaneously. The client-server model is not network distributed, so clients can access only those hardware devices that reside on the same machine.

> The MMS Server

> Figure 1-2 shows a model of the MMS server and its relationship to other components.

> Figure 1-2 The MMS Server

> The server has two major components; the core server and drivers.The core server is device independent and handles requests, and data between multiple clients and the appropriate server drivers.

> The driver portion of the server contains special sub-components known as mmeserver drivers (or simply drivers) which are device-specific. Two types of server drivers exist: software and hardware server drivers. Software drivers perform software only services, such as software JPEG compression and decompression or audio ADPCM compression and decompression. These drivers run on any machine supported by MMS without special hardware. Hardware drivers communicate with hardware option devices such as the AV321 video or Microsoft Sound Board (MSB) audio options. Server hardware drivers communicate with hardware devices through kernel drivers which run in a privileged kernel mode.

> The flexibility of this model comes from the fact that the core server, and more importantly the applications, do not differentiate between software and hardware devices. Both types of devices appear identical to applications, though some features may be different from device to device. For example, an application written to use a JPEG decompression device can use software JPEG decompression or hardware JPEG decompression without change. The user need only install a hardware option card to take advantage of hardware acceleration.

> For various reasons not all drivers reside in the server. The file I/O and MPEG software compressor/decompressor drivers reside in the client library which is linked to all MMS applications. All Multimedia Services applications shipped with MMS communicate with the mmeserver; so the mmeserver must be running at all times for these MMS applications to run.

> MMS and the X Window System

> MMS applications use the X Windows System the same as any other X application. The MMS server does not directly communicate with any X libraries or the X server. All communication is separate from MMS and handled by the application. Figure 1-3 shows the relationship between the MMS server and the X Window System.

> Figure 1-3 The MMS Server and the X Window System

> The MMS Model and Performance

> When using a client-server architecture there may be some concern about the overhead of copying data or switching between the client and server processes. When using MMS all data is passed in shared memory between client and server and overhead is minimal compared with other types of operations being performed.

> Data Flow in MMS

> The following is an example of how data moves through a multimedia application built on MMS. The AlphaVCR application used in the example has the capability to process JPEG and audio AVI data files, display the decompressed images on the graphics device, and play the audio through the audio device. Figure 1-4 describes the flow of data through the different components of MMS. For more information on using AlphaVCR, see the chapter on AlphaVCR.

> Figure 1-4 Data Flow in AlphaVCR

> > Legend | Description
> > 1 | AlphaVCR requests MMS library to read audio and video data from AVI file.
> > 2 | AlphaVCR sends audio and video data in a shared memory buffer to MMS server, each in a separate data stream. Depending on system configuration the video data is routed to either the AV321 hardware decompression or the Software JPEG decompression device. AlphaVCR lets the mmeserver choose the fastest device.
> > 3 | Data is decompressed and played: If AV321 is used, data is passed to AV321 device, decompressed, and passed back to host machine. If Software JPEG driver is used, host machine's CPU is used to decompress the data. Audio data is passed to audio device to be played to an external audio device such as a speaker or headset.
> > 4 | Decompressed data is passed back to AlphaVCR in shared memory buffer.
> > 5 | AlphaVCR moves decompressed data from MMS library to X library by passing shared memory pointer. No data is copied.
> > 6 | AlphaVCR sends data in the same shared memory buffer to the X server.
> > 7 | The X server passes data to be displayed on the graphics device and the images appear on the display monitor.

Multimedia Services and CDE

> > > This section describes how Multimedia Services for UNIX is used within the Common Desktop Environment (CDE). Topics include:

> > > - Common Desktop Environment (CDE)
> > > - The CDE Multimedia Program Group
> > > - Launching MMS Applications from within the CDE Desktop
> > > - CDE Multimedia Data Files and Icons

Common Desktop Environment (CDE)

> The Common Desktop Environment (CDE) provides a desktop framework for using applications with data objects. The CDE integration subset for Multimedia Services (MMERTCDE240) allows access to Multimedia Services applications in the Multimedia Services Run-Time subset through the CDE File and Application Managers. This subset creates a program group within the CDE Application Manager for applications in the Multimedia Services Run-Time subset. The top-level display in the CDE Application Manager contains the multimedia program group. Clicking on this icon opens the Multimedia Services program group.

> Multimedia Services installed under CDE recognizes multimedia objects, file types such as AVI and WAVE, and launches the applications when you either double-click on a multimedia object or when you drag a multimedia object and drop it onto an application icon.

The CDE Multimedia Program Group

> The Multimedia program group contains icons associated with the Multimedia Services applications. When you double click one of the Multimedia Services icons you immediately launch its associated application (for example, AlphaVCR, Audio Control, DECsound, or Video Odyssey). Figure 1-5 shows the CDE Multimedia Program Group icons.

> Figure 1-5 Multimedia Program Group Icons

> For convenience of access and launch you can install the MMS application icons in the CDE control panel Personal Applications Pop-up menu. The following step-by-step procedure tells how to do this:

Step-By-Step

I nstalling MMS Icons in the Menu Bar
Task/Location | Action | Result
CDE program bar (bottom of the screen) | Click on the Personal Applications up arrow. | The Personal Application Pop-up menu is displayed
Multimedia Program Group | Drag the MMS application icon you want to install onto the Install Icon icon. | The icon is included in the pop-up menu. Anytime you want to launch the application, display the pop-up menu and click on the application icon

Launching MMS Applications from within the CDE Desktop

> There are several methods of launching MMS applications from within the CDE desktop. The following step-by-step procedures describe how to launch an application from within the MMS program group:

Step-by-Step

Launching MMS Applications from the CDE Application Manager
Task/Location | Action | Result
CDE Application Manager | Double click on the Multimedia Icon. | The MMS icons are displayed: AlphaVCR, DECsound, Audio Control, Video Odyssey, and MultimediaServices.html.

Launching MMS specific applications
File Manager | Double click, or drag and drop on its associated application, files with any of the following file extensions: .avi .au .html .mp2 .mpa .mpg .wav | File Manager launches the application associated with the file extension.

CDE Multimedia Data Files and Icons

> Under CDE multimedia files are associated with certain applications. When you double click on a file icon you launch the application associated with that file. When you drag a file icon over and drop it onto the application icon you also launch that application.

> For example, when you click on a file with an .avi or .mpg extension you will launch the AlphaVCR application and play that file. Also, when you drag that file with the .avi or .mpg extension and drop it on the AlphaVCR icon you will launch the AlphaVCR application.

> When you click on a file having a .wav, .mp2, .mpa, or .mpg extension you will launch the DECsound application and play that sound file. Also, when you drag that file with the .wav, .mp2, .mpa, or .mpg extension and drop it on the DECsound icon you will launch the DECsound application. Table 1-1 contains a list of these file extensions and their associated MMS applications.

> Table 1-1 File Extension Associations with MMS Applications

> File Extension | Application Launched
> .avi | AlphaVCR Video Odyssey
> .mpg | DECsound (audio only) AlphaVCR (audio & video)
> .mp2 .mpa .wav .au | DECsound
> .html | Netscape

> The multimedia applications which do not have CDE icons (audiodevices, audioplay, audiorecord, audioselectports, jpegconvert, and transcode) must be invoked by their command line.