This page was last modified 07:03, 17 April 2008.
CS000899 - Finding audio and video formats supported by the phone
From Forum Nokia Wiki
| 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() |
Overview
This snippet shows how to find out all audio/video play and record formats supported by the phone.
This snippet can be self-signed.
MMP file
The following libraries are required:
LIBRARY MMFControllerFramework.lib
Header file
#include <mmf\common\mmfcontrollerpluginresolver.h> #include <mmf\common\mmfcontroller.h>
Source file
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
Postconditions
The controllers array contains all audio/video play and record formats supported by the phone.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to send an image to moblie OR what formats are supported | omo_5 | Mobile Java Media (Graphics & Sounds) | 4 | 2006-01-01 15:38 |
| Nokia 6260 mp3 download | gingerina | General Browsing | 11 | 2007-03-19 13:56 |
| Game sound in mp3(support) | martin.wainamoinen | Mobile Java Media (Graphics & Sounds) | 1 | 2008-02-14 15:05 |
| playing audio in series 40 phones | sridhar_ratna | Mobile Java General | 1 | 2003-08-22 09:28 |
| NMC message "unsupported or corrupted file" | jmedos | Audio | 1 | 2004-07-25 06:19 |

