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:
Write the appropriate source .cpp
and .h
files that make up the implementation of the source/sink plugin.
See Creating a Source Plugin and
Creating a Sink Plugin.
Write a resource file defining the formats available in the plugin DLL.
Write the appropriate build files.
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:
nnnnnnnn
is the UID of the ECom plugin DLL. This is the same as the dll_uid
.
AcmeSourceSinkPluginUids.hrh
is a header file containing the source and sink UIDs. These values could also be inserted directly into the resource file.
version_no
is the version number. Note that although this field can be read by ECom, the format instantiation does not make use of this field.
display_name
contains the display name.
default_data
and opaque_data
fields are not used in data source/sink plugins.
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.
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:
TARGETTYPE
is ECOMIIC
.
TARGETPATH
is \System\Libs\Plugins
.
UID
should be the ECom DLL
.
LIBRARY
needs to include ecom.lib
.