Platform SDK: TAPI

MSP Architecture

In TAPI architecture, all TSPs are run in the context of Tapisrv.exe, which is implemented as a service process within SVCHOST. TAPI applications live in their own process. TAPI applications load Tapi3.dll and any needed MSPs into their own process, and the TAPI DLL communicates with Tapisrv.exe through a private RPC interface. The following diagram illustrates the interaction of these components.

A Media Service Provider (MSP) provides media streaming using the abstractions of Terminals, Streams, and SubStreams.

A Terminal is a sink or source for a media stream. It may be a physical object, such as a speaker or a microphone, or it may be an abstraction of a device, such as a video window. The Terminal Object exposes the ITTerminal interface. The class of terminal is described by the Terminal Class GUID. An MSP may define its own terminal classes.

Streams divide the media of a call based on the media type or type, the stream's direction, and the destination address of the media. For example, an incoming audio stream from a modem is a stream object, an outgoing video stream to an IP address and port is a stream object, the video streams coming from a IP multicast group are also considered as one stream object. The Stream object is represented by the ITStreamControl interface.

SubStreams allow finer control over the media. For example, in the IP multicast case, the incoming video stream object might represent several people. The application will most likely want each participant to have a separate renderer. The incoming video stream can be divided into several substreams, one for each person. One substream would correspond to one person, and can be configured and controlled separately. The SubStream object is represented by the ITSubStreamControl interface.

When an application is setting up a call, it must specify the type of media required. On an outgoing call, it simply tells TAPI when the call is created. For example:

pAddress->CreateCall( 
  pszDestAddress, 
  lAddressType,
  TAPIMEDIATYPE_AUDIO | TAPIMEDIATYPE_VIDEO, 
  &pCall 
);

In this case, the application is creating an outgoing audio-video call.

The media types passed in indicate the media that the application is interested in over the lifetime of the call. For example, the application may specify audio and video when creating the call, but select only audio terminals at the beginning. The MSP will start streaming only audio, but will not reject a local or remote video request made later in the lifetime of the call.

When the application then calls ITBasicCallControl::Connect, TAPI 3.0 calls TSPI_lineMakeCall in the TSP. After a call is established, the MSP and TSP can communicate as necessary.

When a call is disconnecting, it is up to the MSP and TSP to communicate about tearing down the call. Tapi3.dll will call TSPI_lineDrop if the application calls Disconnect.