| ID | CS000899 | Creation date | April 17, 2008 |
| Platform | S60 3rd Edition, FP1 | Tested on devices | Nokia N93 |
| Category | Symbian C++ | Subcategory | Multimedia, Audio, Video |
| Keywords (APIs, classes, methods, functions): CMMFControllerPluginSelectionParameters, CMMFFormatSelectionParameters, RMMFControllerImplInfoArray, RMMFFormatImplInfoArray, CMMFControllerPluginSelectionParameters::SetRequiredPlayFormatSupportL(), CMMFControllerPluginSelectionParameters::SetRequiredRecordFormatSupportL(), CMMFControllerPluginSelectionParameters::SetMediaIdsL(), CMMFControllerPluginSelectionParameters::SetPreferredSupplierL(), CMMFControllerPluginSelectionParameters::ListImplementationsL() |
This snippet shows how to find out all audio/video play and record formats supported by the phone.
This snippet can be self-signed.
The following libraries are required:
LIBRARY MMFControllerFramework.lib
#include <mmf\common\mmfcontrollerpluginresolver.h>
#include <mmf\common\mmfcontroller.h>
CMMFControllerPluginSelectionParameters* pluginParameters = CMMFControllerPluginSelectionParameters::NewLC();
CMMFFormatSelectionParameters* formatParameters = CMMFFormatSelectionParameters::NewLC();
pluginParameters->SetRequiredPlayFormatSupportL(*formatParameters);
pluginParameters->SetRequiredRecordFormatSupportL(*formatParameters);
RArray<TUid> ids;
User::LeaveIfError(ids.Append(KUidMediaTypeAudio));
User::LeaveIfError(ids.Append(KUidMediaTypeVideo));
//EAllowOnlySuppliedMediaIds - plug-ins that support exact media ID
//EAllowOtherMediaIds - plug-ins that support at least the media ID
//pluginParameters->SetMediaIdsL(ids, CMMFPluginSelectionParameters::EAllowOnlySuppliedMediaIds);
pluginParameters->SetMediaIdsL(ids, CMMFPluginSelectionParameters::EAllowOtherMediaIds);
//It is also possible to set the preferred supplier of the plug-in
//and return e.g. only those plug-ins
//pluginParameters->->SetPreferredSupplierL(_L("SupplierName"),
// CMMFPluginSelectionParameters::EOnlyPreferredSupplierPluginsReturned);
RMMFControllerImplInfoArray controllers;
CleanupResetAndDestroyPushL(controllers);
//Get all audio/video play and record controllers/formats that are supported
pluginParameters->ListImplementationsL(controllers);
/* //Print results e.g. to global CConsoleBase* console
_LIT(KAudioFormats,"Audio/Video play and record formats detected:\n");
_LIT(KTab, "\t");
_LIT(KNewLine, "\n");
console->Printf(KAudioFormats);
for (TInt index=0; index<controllers.Count(); index++)
{
const RMMFFormatImplInfoArray& playFormats = controllers[index]->PlayFormats();
const RMMFFormatImplInfoArray& recordFormats = controllers[index]->RecordFormats();
console->Printf(controllers[index]->DisplayName());
console->Printf(KNewLine);
for (TInt i=0; i<playFormats.Count(); i++)
{
console->Printf(KTab);
console->Printf(playFormats[i]->DisplayName());
console->Printf(KNewLine);
}
console->Printf(KNewLine);
for (TInt j=0; j<recordFormats.Count(); j++)
{
console->Printf(KTab);
console->Printf(recordFormats[j]->DisplayName());
console->Printf(KNewLine);
}
}
*/
CleanupStack::PopAndDestroy(3);//controllers, formatParameters, pluginParameters
The controllers array contains all audio/video play and record formats supported by the phone.
No related wiki articles found