[Previous] [Contents] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

Multimedia Component Overview

This section contains the following topics:

Multimedia Components List

The multimedia package contains the following components:

Media Support Binaries

extproc.so and libextproc.so
Extproc group
libmedia.so
Common media library

Media Configuration files

/etc/config/media/mpregistry
Media player registry file
$HOME/.ph/mpsettings
Plugin settings file
libasound.so
Audio drivers and programmer interface library

Photon Media Utilities

mixer
Photon audio mixer
phplay
Photon media player
phrecord
Photon sound recorder
realplayer
RealPlayer for playing realtime audio, video and multimedia

Photon Media Player plugins

audiocd.so
Audio CD Player
mpegaudio
MPEG Audio Player
mpegsystem
MPEG Audio/Video Player
mpegvideo
MPEG Video Player
soundfile.so
Sound file Player

Command-line Media Plugins and Launchers

These plugins (typically identified with the _noph suffix) don't require Photon and are launched from the command line.

audiocd_noph.so
Play an audio CD
mpegaudio_noph.so
Play MPEG audio without Photon
soundfile_noph.so
Play a sound file without Photon
This plugin: Is launched by this command:
audiocd_noph.so playAudioCd
mpegaudio_noph.so plaympegaudio_noph
soundfile_noph.so playsound_noph

Voyager Plugin Variants

flashplayer
Macromedia Flash 4 animation plugin
mpegaudioplugin
MPEG audio player plugin
mpegsystemplugin
MPEG audio/video player
mpegvideoplugin
MPEG video player plugin
soundplugin
Sound file player plugin

Design Principles

The Multimedia Components were developed to:

The basic design principles for the plugins are:

The Photon Media Player phplay is a thin GUI application that:

The Voyager plugins use the Netscape plugin interface as defined for Voyager Browser. The phplay plugins use the media API as defined in the <Mv.h> header file.


Note: This API is NOT Photon-dependent.

The phplay plugins are DLLs with four entry points:

MvInit()
Initialize the plugin and prepare it to receive commands. The plugins also return capabilities information to the media player to allow it to adjust as needed to handle the plugin.
command()
Submit commands to the plugin (e.g. start, play, and stop).
get_item()
Allow the media player to get the plugin playlist (e.g. Audiocd.so returns the number of tracks).
terminate()
Tell the plugin to exit all threads and terminate all operations. This is the last chance for the plugin to clean-up any allocated memory.

To allow the plugins to generate events in the media player, the media player sets a callback pointer.

Directories

The media components are located in the following directories:

/lib/dll
audiocd_noph.so,
mpegaudio_noph.so,
soundfile_noph.so
/usr/lib
libextproc.so,
libmedia.so
/usr/photon/bin
mixer,
mpegaudio,
mpegsystem,
mpegvideo,
phplay,
phrecord
/usr/photon/dll
audiocd.so,
extproc.so,
soundfile.so
/usr/photon/plugins
flashplayer,
mpegaudioplugin,
mpegsystemplugin,
mpegvideoplugin,
soundplugin

Support Binaries

Here's how the binaries relate to one another.

Extproc group

The Extproc group consists of the following libraries:

These components are symbolic links to extproc.so:

In order to load the MPEG audio, MPEG video, and the MPEG system, you need to put them in separately linked executables. The media player loads extproc.so which executes a binary dynamically linked to libextproc.so. The main() for the binary is in libextproc.so.


Note: To eliminate the need for the Extproc group, future QNX components will use position-independent modules. The Soundfile plugin (soundfile.so) and the Audio CD player (audiocd.so) don't use the Extproc Group.

Common media library (libmedia.so)

The common media library DLL, libmedia.so, provides developers a common interface to the media player registry file and the plugin settings file.

The header files that describe the multimedia API are:

</usr/include/photon/Mv.h>
APIs for media plugins.
</usr/include/photon/MvReg.h>
API calls associated with the registry.

The four API calls that define the registry file interface are:

  1. MvPluginName() -- Return the associated plugin name based on an input filename
  2. MvRegClose() -- Close the registry file
  3. MvRegGetEntry() -- Look up which plugin goes with a specific file type
  4. MvRegOpen() -- Open the registry file

MvRegOpen(), MvRegGetEntry() and MvRegClose() are defined in <MvReg.h>, but are for internal use only by MvPluginName().

Configuration Files

The multimedia configuration files include:

Media player registry file (mpregistry)

When a file is selected within phplay, phplay tries to identify the plugin to load based on the media type. The registry file is used if the file media type can't be identified.

The media player registry file is located at:

/etc/config/media/mpregistry

Here's an example of its contents:

<This first line may redirect paths to find plugins (optional)>
#<TAB>so<TAB>file://*.extension or
    #TAB>so<TAB>MIME:(MIME_type) is the line format expected>
    soundfile.so    file://*.wav
    soundfile.so    file://*.au
    soundfile.so    file://*.aif
    soundfile.so    file://*.aiff
    soundfile.so    file://*.iff
    soundfile.so    MIME:audio/x-wav
    soundfile.so    MIME:audio/basic
    soundfile.so    MIME:audio/x-aiff
    mpegsystem.so   file://*.mpg
    mpegsystem.so   file://*.mpeg
    mpegsystem.so   MIME:video/mpeg
    mpegaudio.so    file://*.mpa
    mpegaudio.so    file://*.mp1
    mpegaudio.so    file://*.mp2
    mpegaudio.so    file://*.mp3
    mpegaudio.so    MIME:audio/mpeg
    mpegaudio.so    MIME:audio/mp3
    mpegaudio.so    MIME:audio/mp2
    mpegaudio.so    MIME:audio/mp1
    mpegaudio.so    MIME:audio/mpa
    mpegaudio.so    MIME:audio/x-mpeg
    mpegvideo.so    file://*.mpv
    mpegvideo.so    file://*.m2v
    mpegvideo.so    MIME:video/m2v
    mpegvideo.so    MIME:video/mpv
    audiocd.so      file://*/dev/cd?
    audiocd.so      file://*.cda
    audiocd.so      .cda:*
    playlist.so     file://*.pl
    soundfile.so=file=File
    audiocd.so=cd=Audio CD

Plugin settings file (mpsettings)

The mpsettings file stores your customized phplay configuration preferences. For example, you may wish to use direct digital audio for everything. Although phplay has File->Preferences, Voyager doesn't. At startup, the mpsettings file is looked for by both phplay and the Voyager plugins to obtain your user preferences.

The plugin settings file is located at:

$HOME/.ph/mpsettings

Three calls define the interface to the plugin settings file:

mpsettings example

The MvSetup_t structure is defined in <Mv.h>.

#phplay settings file
WINDOW_SIZE=CUSTOM
CUSTOM_WIDTH=362
CUSTOM_HEIGHT=552
POSITION_X=128
POSITION_Y=148
DIRECT_DIGITAL_AUDIO=OFF
PLUGIN_CREATES_VIDEO=OFF
DIRECT_OVERLAY=ON
KEEP_VIDEO_ASPECT_RATIO=ON
WINDOW_ALWAYS_ON_TOP=OFF
VIDEO_MODE=VGA
TV_SCALE1_1=ON
TV_STANDARD=NTSC
TV_OUTPUT=VIDEO
CDDB=ON
PCM_A_PLAYBACK_CARD=0
PCM_A_PLAYBACK_DEVICE=0
PCM_B_PLAYBACK_CARD=0
PCM_B_PLAYBACK_DEVICE=0
PCM_RECORD_CARD=0
PCM_RECORD_DEVICE=0
SPDIF_PLAYBACK_CARD=0
SPDIF_PLAYBACK_DEVICE=2
SPDIF_RECORD_CARD=-1
SPDIF_RECORD_DEVICE=-1
MOUNT_POINT=/fs/cd0
STREAM_TYPE=MV_STREAM

[Previous] [Contents] [Next]