[Previous] [Contents] [Index] [Next]

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

Multimedia Filter Reference

This chapter provides reference information about the filters provided with the Multimedia library. The source and binary for each filter is available in the Multimedia TDK, while most binaries are also shipped with QNX Neutrino. There are some exceptions: the Xing MPEG audio decoder, MPEG audio parser, MPEG video parser, and MPEG system parser filter binaries are available only in the TDK.

Note that in some instances, filters use libraries that require special licensing, or are distributed under an open-source license.

This reference covers these filters:

Reader filter

The Multimedia library simplifies reading multimedia data by using a generic stream reader filter. It encapsulates three stream readers, a file reader, HTTP reader, and CD reader (listed below).

File reader

A streamer filter that reads a file-based stream.

HTTP reader

A streamer filter that reads an HTTP-based stream.

CDDA reader

A streamer filter that reads the audio CDDA format. It implements these resources:

TracksCount
int32_t value containing the number of tracks a media stream contains. Read-only.
Tracks
int32_t value containing the number of the current track. Read / write.
CDDA_MILLISECONDS
int32_t value containing the amount of read-ahead buffer the CDDA reader is using, in milliseconds. This value can be between 300 milliseconds and 1 minute. Read / write.
Error
string value containing an error message. Read-only.
Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.
MM_CDDA_THREAD_PRIO_INC
int32_t value containing the CDDA reader's thread priority increment. Read / write. Default 2.

This resource affects how the reader thread's priority is incremented from the main application thread's priority, and can be adjusted to fine-tune performance. By default this resource is 2, which means, for example, if the application thread has a priority of 10, the CDDA reader thread has a priority of 12.

This resource needs to be set before MmStart() is called and the reader thread is created.

MM_CDDA_BUFFER_SIZE
uint32_t value containing the amount of read-ahead buffer the CDDA reader is using, in bytes (1 sector = 2352 bytes). This resource sets the same thing as CDDA_MILLISECONDS, but allows you to specify the buffer size in bytes instead of milliseconds. Read / write.

This resource needs to be set before MmStart() is called.

MM_CDDA_START_PERCENT
uint32_t value containing the percent of the input buffer that needs to be filled before playing begins. Read / write.

This resource needs to be set before MmStart() is called.

MM_CDDA_NSECTORS_READ
uint32_t value containing the number of sectors to access on each read (1 sector = 2352 bytes). Read / write.

The default value is 16 sectors.

MM_CDDA_NSECTORS_WRITE
uint32_t value containing the size of the buffer output, in sectors. The default is 1 sector (meaning 2352 bytes). Read/write.

This resource needs to be set before the filter's output channel is linked to the next filter in the graph with MmAttachChannel(). If you set this resource to a value larger than the default cdda buffer size (16 sectors, equivalent to 37632 bytes), the MM_CDDA_BUFFER_SIZE resource needs to be adjusted before setting this resource.

MM_CDDA_REFILL_LOW_MARK
uint32_t value containing the available space, in bytes, needed in the buffer to initiate a refill. Read/write.

Writer filters

Audio writer

This filter outputs audio to an audio card. The audio writer accepts mono or stereo information (surround sound formats aren't supported), with either 8-bit or 16-bit depth. Data is in PCM format -- see the Neutrino Audio Developer's Guide for more information on this format.

It implements these resources:

Position
int64_t value containing the position in the media stream. Read-only.
Volume
int32_t value containing the volume, from 0 to 100. Read / write.
Balance
int32_t value containing the balance, from 0 to 100 (50 is "normal"). Read / write.

Raw file writer

A raw file writer filter that reads from a channel stream, and dumps it out to an output stream, most likely a file.

WAV file writer

A WAV format file writer filter that writes uncompressed PCM audio data to a WAV file.

Window writer

A window writer filter that outputs video to a Photon window.

It implements these resources:

Position
int64_t value containing the position in the media stream. Read-only.
PtWidget_t
a pointer to the widget that the writer sends video to. Read/write.
Width
int32_t value containing the width of the video image. Read-only.
Height
int32_t value containing the height of the video image. Read-only.
DisplayArea
a pointer to a PhArea_t containing the current position and dimension of the video widget. Read/write.
ScalerEnabled
int32_t value indicating whether the hardware video overlay scaler is in use. Read-only.

Decoder filters

Ogg Vorbis decoder

A decoder filter for the Ogg Vorbis audio format. This filter requires a floating point unit (FPU) on the target platform -- if no FPU exists, the Multimedia library uses the Ogg integer decoder instead.

This filter expects a single input channel of streaming compressed audio data in Ogg Vorbis format. The output channel has a fourcc of RAWA, scale of 1, depth of 2 (16 bits), and at least 1 buffer. The number of channels and duration depends on the source data.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

Ogg Vorbis integer decoder

An integer-based decoder filter for the Ogg Vorbis audio format. This filter doesn't require an FPU on the target platform. Otherwise, it is identical to the floating-point version of the decoder.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

FF MPEG video decoder

An MPEG1 SYSTEM (ISO/IEC 11172-1) stream decoder (video and audio) and MPEG1 VIDEO (ISO/IEC 11172-2) stream decoder (video only).

Xing MPEG audio decoder

A Xing MPEG audio decoder filter with support for MPEG1 layer 1, layer 2, and layer 3 audio decoding (MP1, MP2, and MP3). It also provides non-ISO-compliant extension of the MPEG1 audio layer 3 format (MPEG 2-5). It allows very low sampling rates down to 8000 samples per second (8kHz).


Note: This decoder is shipped with the Multimedia TDK only.

Windows Media Audio decoder

A decoder filter for the WMA format. This filter requires a floating point unit on the target processor.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.
WCS_Title
wchar_t value containing the song title. Read-only.
WCS_Author
wchar_t value containing the artist and song author. Read-only.
WCS_Copyright
wchar_t value containing copyright information. Read-only.
WCS_Description
wchar_t value containing the song description. Read-only.
WCS_Rating
wchar_t value containing the stream rating. Read-only.

This is an example of how you could extract the song title resource from a graph (other WCS_* resources are similar):

{
  wchar_t **wcstr = (wchar_t**)MmGetResourceValue(graph,"WCS_Title");
  if( wcstr && wcstr[0] )
    printf(" extracting Song title: %ls\n",*wcstr);
}

Parser filters

AIFF parser

A parser filter for Apple's AIFF audio format with support for ITU G.711 ulaw, PCM8, and PCM16 compression codes.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

AU parser

A parser filter for the AU audio format with support for these compression codes:

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

AVI parser

A parser filter for the AVI format.


Note: Only the audio part of the stream is decoded/parsed, as this format requires additional licensing.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

IFF parser

A parser filter for the IFF/8SVX audio Interchange File Format with support for the PCM8_S (8 bits pcm samples) compression code.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

MIDI parser

A parser filter for the MIDI audio format.


Note: This parser requires third party sound patch files, as no patch files are shipped with the Multimedia TDK. A set of sound patch files is available in the 3rd-party repository. The set is free for non-comercial use.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

MPEG audio parser


Note: This parser is shipped with the Multimedia TDK only.

A parser filter for the MPEG1 audio format with support for the interpretation of MPEG1 layer 1, layer 2, and layer 3 (MP1, MP2, and MP3) streams.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.
IcyInfo
a string value containing any icecast embedded information
ID3
a pointer to a buffer containing an MPEG ID3 tag header, if available. It's up to the application to parse this header.

MPEG system parser


Note: This parser is shipped with the Multimedia TDK only.

A parser filter for the MPEG1 System format (audio/video).

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

MPEG video parser


Note: This parser is shipped with the Multimedia TDK only.

A parser filter for the MPEG1 video format.

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

WAV parser

A parser filter for the WAV audio format with support for:

Implemented resources:

Duration
int64_t value containing the length of the media stream. Read-only.
Position
int64_t value containing the position in the media stream. Read-only.

[Previous] [Contents] [Index] [Next]