Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



How to Write a Format Plugin

To write a Multimedia Framework (MMF) format plugin, the following needs to be done:


Resource File

For each format plugin DLL one resource file (.RSS) is required to enable ECom to identify and instantiate the format or formats present in the DLL. It is up to the implementer whether the formats are to be placed in one or more ECom plugin DLLs.

An example resource file for a format plugin DLL containing one format decode and one format encode is as follows:

// nnnnnnnn.RSS
#include <acmeControllerUIDs.hrh>
#include <mmfPluginInterfaceUIDs.hrh>
#include <mmfdatasourcesink.hrh>
#include "RegistryInfo.rh"

RESOURCE REGISTRY_INFO theInfo
{
    dll_uid = KAcmeFormatPluginDLLUid;
    interfaces =
        {
        INTERFACE_INFO
{
            interface_uid = KmmfUidPluginInterfaceFormatDecode ;
            implementations =
                {
                IMPLEMENTATION_INFO
                                {
                                    implementation_uid = KAcmeFormatWavReadUid;
                                    version_no = 1;
                                    display_name = "Acme WAV Read Format ";
                                    default_data = "KUidAcmeControllerPlugin" 
                                    opaque_data = "<s>Acme<i>KUidMediaTypeAudio<e>.wav<h>RIFF?????WAVE<m>audio</x-wav">

                                                                        }
                                                        }
                       },
              INTERFACE_INFO
               {
              interface_uid = KmmfUidPluginInterfaceFormatEncode ;
               implementations =
                              {
                              IMPLEMENTATION_INFO
                                     {
                                     implementation_uid = KAcmeFormatWavWriteUid;
                                     version_no = 1;
                                     display_name = "Acme WAV Write Format ";
                                     default_data = "KUidAcmeControllerPlugin" 
                                     opaque_data = "<s>Acme<i>KUidMediaTypeAudio<e>.wav<h>RIFF?????WAVE<m>audio/wav<m>audio/x-wav";                                     }
                                };
                        }
                }
         }

Where:

nnnnnnnn is the UID of the ECom plugin DLL. This is the same as the dll_uid.

AcmeFormatUids.hrh is a header file containing the format specific UIDs . These values could also be inserted directly into the resource file.

AcmeControllerUids.hrh is a header file containing the controller specific UIDs . These values could also be inserted directly into the resource file. The controller uid is required as the format needs to register which default controller it is expected to be used with (see default_data).

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 is the UID used to specify the controller that is used in the controller recognition to identify which formats are supported by the controller. This controller UID is not exclusive, other controller plugins with a different UID to that specified in default_data can also use a particular format plugin. The controller UID is used by the format recognition code (i.e when a client requests information about the formats supported by the system, the format supported by the format plugin will be reported by the controller plugin with the specified UID).

opaque_data:

A number of audio formats are included as part of the multimedia framework which provide a number of standard common audio formats. The formats provided are WAV, au and RAW. These can be found in the multimedia component directory under \Mmf\Src\Plugin\Format. These provide example code for writing a format plugin. There is also a test format in the UnitTest\basecl sub-directories which could be used as a template for writing a new format plugin.

[Top]


Build File

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

The main points to note are:

Note that it is not necessary to include mmfserverbaseclasses.lib.

[Top]


Implementation Considerations

When implementing a format plugin consider the following: