Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



How to Write a Source/Sink Plugin

Multimedia Framework (MMF) data source and data sink plugins are software abstractions for a source and sink of multimedia data. Data source and data sink plugins are ECom plugins that are intended to be used in conjunction with an MMF controller plugin. Examples of MMF source plugins include: audio input plugins for a microphone, a camera, an RTP stream, a file and a descriptor. Examples of MMF sink plugins include: audio output for a speaker, a display, an RTP stream, a file and a descriptor. The MMF provides standard source plugins for an audio input, a file and a descriptor. It is possible to develop source plugins for other sources of multimedia data provided they conform to the MDataSource API. The MMF also provides standard sink plugins for an audio output, a file and a descriptor. It is possible to develop sink plugins for other sinks of multimedia data provided they conform to the MDataSink API.

Sources and sinks are owned by the controller framework and are added to the controller, but not owned by the controller. See How to write a controller plugin for more information.

To write a MMF Source/Sink Plugin, the following needs to be done:


Resource File

For each source/sink plugin DLL one resource file (.RSS) is required to enable ECom to identify and instantiate the sources and sinks present in the DLL. The sources and sinks can be placed in one or more ECom plugin DLLs.

An example resource file for a plugin DLL containing one data source and one data sink follows:

// nnnnnnnn.RSS
#include "acmeSourceSinkPluginUIDs"
#include <mmfPluginInterfaceUIDs.hrh>
#include "RegistryInfo.rh"
RESOURCE REGISTRY_INFO theInfo
       {
       dll_uid = KAcmeFormatPluginDLLUid;
       interfaces =
               {
               INTERFACE_INFO
                      {
                      interface_uid = KMmfUidPluginInterfaceDataSource; // MDataSource
                      implementations =
                             {
                              IMPLEMENTATION_INFO
                                     {
                                     implementation_uid = KAcmeDataSourceUid;
                                     version_no = 1;
                                     display_name = "Acme data source";
                                     },
                             };
                      } ,
               INTERFACE_INFO
                      {
                      interface_uid = KMmfUidPluginInterfaceDataSink; // MDataSink
                      implementations =
                             {
                             IMPLEMENTATION_INFO
                                     {
                                     implementation_uid = KAcmeDataSinkUid ;
                                     version_no = 1;
                                     display_name = "Acme data source";
                                     },
                             };
                     }
              };
      }

Where:

The file and descriptor sources and sinks, that are included as part of the multimedia framework, can be found in the multimedia component directory under \Mmf\Src\Plugin\StdSourceAndSink.

The audio input data source and audio output data sink can be found in the \Mmf\Src\Plugin\AudioInput and \Mmf\Src\Plugin\AudioOutput directories respectively.

There are also a number of test source and sink plugins in the UnitTest\Ctlfrm\, basecl\ and \Afmt sub-directories. These can be used as a template for writing a new source/sink plugin.

[Top]


Build File

There are no special requirements for an MMF source/sink plugin mmp file over and above a conventional ECom plugin.

The main points to note are: