BeOS Media Kit plugin API review for GMPI

Version 1.0 written by Ben Loftis <bsloftis AT yahoo.com>, 2003-10-02

The BeOS Media Kit and MIDI Kit were developed as part of the BeOS API by Be, inc.


1. Cross-platform

Currently the Media Kit is only available on BeOS and derivatives (OpenBeOS). It is probably not practical to directly port it to another platform

1.1. What kinds of host applications does the Media Kit target?

The Media Kit provides a mechanism to manage audio, video and control data for a multimedia app. Users of the media kit would include DAW's, softsynths, and media players.

1.2. What are the target hardware architectures for the Media Kit host applications?

Desktop class machines.

1.3. What are the target hardware architectures for the Media Kit plugins?

Same.

1.4. Who are the target developers?

Anyone.

1.5. What kinds of plugins do people use today, and what will they want to use

Modular synth modules, realtime softsynths. There are not many "native" Media Kit effect plugins, but there is a VST wrapper that makes VST plugins compiled on BeOS appear to be MedaNodes.

2. Plugin flavors

Video in and/or out. Audio in and/or out, Control in and/or out.

3. Cross Platform

3.1 - 3.2 are already answered above.

3.4. What programming languages are to be supported?

The Media Kit is implemented in object-oriented C++.

4. Host interface

The Media Kit and MIDI Kit API's are defined in several header files and you link against a precompiled module that is supplied with BeOS. There is a tremendous support library included in BeOS including threading, GUI and realtime memory allocation chores.

5. Threading

The Media Kit and the BeOS API combine to provide extensive threading support. Nodes can be in-process or out-of-process and both are explicitly supported.

5.1. What kind of real-time guarantees are there

Realtime performance is guaranteed (assuming there is enough CPU power) with functions like "FindLatencyFor()" and "LateNoticeReceived()"

5.2. Does the host provide some kind of threading environment?

BeOS (the uber-host) runs a realtime audio thread which you can register a callback. Or a host app may implement their own realtime thread and send buffers to the audio thread.

6. Time representation

Time is represented in 3 ways: Media Time (microseconds relative to the start of a particular media file), Real Time (microseconds since the computer was booted), and Performance Time (basically defines the relationship between the other two, i.e. a "time code source").

7. Audio packaging

7.1.1 Interleaving

Interleaving is supported

7.1.2 Data-types

Arbitrary data types are supported.

7.1.3: Encodings

All media streams are raw buffers (BBuffer) with an indentifying structure (BMediaFormat) or header.

7.1.4: I/O Connections between plugins

Connections between Media nodes is a multi-step process in which the nodes "negotiate" a connection format.

7.2 In-place processing

I believe all processing is done in-place.

7.3 Silence

There is no automatic silence handling that I know of.

8. Parameters

8.1 What is a parameter

see BParameter, BParameterGroup, BParameterWeb, and BControllable. Parameters can have multiple inputs and outputs, be discrete or continuous, and have multiple channels of data. Parameters can be assigned a "Unit" string (i.e Hz, dB, etc)

8.2 Parameters and saving/restoring state

Handled by the host.

8.3 Parameter data-types

Parameter values are generally B_INT32_TYPE or B_FLOAT_TYPE but can be any other BeOS-defined type

9. Persistence

The Media Kit has no persistence features. BeOS defines a BArchivable class which could be used for this purpose.

10. Threading

Fantastic thread support. Discussed above.

11. GUI

Each BControllable object can call "StartControlPanel" which generates a generic GUI window based on it's BParameters, their types and their units. A custom GUI can be written to manipulate the BParameters more elegantly.

12. The role of MIDI

All MIDI support is defined in the MIDI Kit. Functions like "NoteOn()" are defined to make MIDI implementations easy. MIDI functionality, controls and connections are separate from the Media Kit. The plugin must make MIDI nodes available in addition to (or instead of) Parameters.

This is a weakness of the Media Kit... it should have enveloped the MIDI kit.

13. Component packaging

Media Nodes are stored as .so modules in the system.

14. Enumeration (creation, discovery, etc.)

Media Nodes can be found and enumerated by the host via calls to BMediaRoster.

15. Copy protection

The Media Kit provides no explicit support for copy protection.

16. Localization

The Media Kit provides no explicit support for localization. I believe the necessary changes would need to be made in only one place, BParameter.

17. DSP state

Things like sample rate and format can be changed basically at will. For example, the BMediaNode subclass BSoundPlayer is provied the format and samplerate as a parameter in the BufferProc callback.

18. Source code

The Media Kit is closed source and no longer in development. OpenBeOS is an open-source implementation of BeOS and it will include a binary-compatible Media Kit if and when it is completed.