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, which encapsulates:
- Writer filters:
- Decoder filters:
- Parser filters:
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).
- Binary: /lib/dll/mmedia/stream_reader.so
- Source: tdk_install_dir/src/lib/mmedia/filters/readers/stream_reader/
A streamer filter that reads a file-based stream.
- Binary: /lib/dll/mmedia/fildes_streamer.so
- Source: tdk_install_dir/src/lib/mmedia/streamers/fildes_reader/
A streamer filter that reads an HTTP-based stream.
- Binary: /lib/dll/mmedia/http_streamer.so
- Source: tdk_install_dir/src/lib/mmedia/streamers/http_streamer/
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.
- Binary: /lib/dll/mmedia/cdda_reader.so
- Source: tdk_install_dir/src/lib/mmedia/streamers/cdda_reader/
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.
- Binary: /lib/dll/mmedia/audio_writer.so
- Source: tdk_install_dir/src/lib/mmedia/filters/writers/audio_writer/
A raw file writer filter that reads from a channel stream,
and dumps it out to an output stream, most likely a file.
- Binary: /lib/dll/mmedia/rawfile_writer.so
- Source: tdk_install_dir/src/lib/mmedia/filters/writers/rawfile_writer/
A WAV format file writer filter that writes uncompressed PCM audio data to a WAV file.
- Binary: /lib/dll/mmedia/wavfile_writer.so
- Source: tdk_install_dir/src/lib/mmedia/filters/writers/wavfile_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.
- Binary: /lib/dll/mmedia/window_writer.so
- Source: tdk_install_dir/src/lib/mmedia/filters/writers/window_writer/
- Dependencies: Photon
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.
- Binary: /lib/dll/mmedia/ogg_decoder.so
- Source: tdk_install_dir/src/lib/mmedia/filters/decoders/ogg_decoder/
- Dependencies: Loads the vorbis and ogg libraries (tdk_install_dir/src/lib/mmedia/codecs/).
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.
- Binary: /lib/dll/mmedia/oggi_decoder.so
- Source: tdk_install_dir/src/lib/mmedia/filters/decoders/oggi_decoder/
- Dependencies: Loads the Tremor and Ogg libraries
An MPEG1 SYSTEM (ISO/IEC 11172-1) stream decoder (video and audio) and MPEG1 VIDEO (ISO/IEC 11172-2) stream decoder (video only).
- Binary: /lib/dll/mmedia/ff_mpegv_decoder.so
- Source: tdk_install_dir/src/lib/mmedia/filters/decoders/ff_mpegv_decoder/
- Dependencies: Loads the LGPL ffmpeg open-source project library libavcodec.so (see ffmpeg.sourceforge.net).
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).
|
This decoder is shipped with the Multimedia TDK only. |
- Binary: /lib/dll/mmedia/xing_mpega_decoder.so
- Source: tdk_install_dir/src/lib/mmedia/filters/decoders/xing_mpega_decoder/
- Dependencies: Loads the xing_audio library.
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);
}
- Binary: /lib/dll/mmedia/wma9_decoder.so (provided in a separate priority support patch to the TDK)
- Source: not provided
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.
- Binary: /lib/dll/mmedia/aif_parser.so
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/aif_parser/
A parser filter for the AU audio format with support for these compression codes:
- MULAW_8 -- 8 bit mu-law G.711
- ALAW_8 -- 8 bit A-law G.711
- LINEAR_8 -- 8 bit fixed-point samples
- LINEAR_16 -- 16 bit fixed-point samples
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.
- Binary: /lib/dll/mmedia/au_parser.so
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/au_parser/
A parser filter for the AVI format.
|
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.
- Binary: /lib/dll/mmedia/avi_parser.so
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/avi_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.
- Binary: /lib/dll/mmedia/iff_parser.so
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/iff_parser/
A parser filter for the MIDI audio format.
|
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.
- Binary: /lib/dll/mmedia/midi_parser.so
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/midi_parser/
|
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.
- Binary: /lib/dll/mmedia/mpega_parser.so
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/mpega_parser/
|
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.
- Binary: /lib/dll/mmedia/mpegs_parser.so
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/mpegs_parser/
|
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.
- Binary: /lib/dll/mmedia/mpegv_parser
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/mpegv_parser/
A parser filter for the WAV audio format with support for:
- WAVE_FORMAT_PCM -- 8 and 16 bits PCM samples
- WAVE_FORMAT_ADPCM -- Microsoft adaptive differential pulse
code modulation format
- WAVE_ITU_ALAW -- ITU G.711 standard A-law compression format
- WAVE_ITU_MULAW -- ITU G.711 standard mu-law compression format
- WAVE_IMA_ADPCM -- Interactive Multimedia Association ADPCM format
- WAVE_GSM610 -- European GSM 06.10 standard
format 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.
- Binary: /lib/dll/mmedia/wav_parser
- Source: tdk_install_dir/src/lib/mmedia/filters/parsers/wav_parser/