sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // include\mmf\common\mmfutilities.h sl@0: // sl@0: // sl@0: sl@0: #ifndef __MMF_COMMON_UTILITIES_H__ sl@0: #define __MMF_COMMON_UTILITIES_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Identifies the particular stream of the given media type. sl@0: */ sl@0: class TMediaId sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Constructs the class with the supplied arguments. sl@0: sl@0: This constructor is used when there are multiple streams of the same media type on the same sl@0: MDataSource. sl@0: sl@0: @param aMediaType sl@0: The media type (video, audio etc.). sl@0: @param aStreamId sl@0: Identifies a specific stream when there are multiple streams of the same media type on sl@0: the same MDataSource. sl@0: */ sl@0: TMediaId(TUid aMediaType, TUint aStreamId); sl@0: sl@0: /** sl@0: Constructs the class with the supplied argument. sl@0: sl@0: This constructor is used when there is a single stream of the same media type on the same sl@0: MDataSource. sl@0: sl@0: @param aMediaType sl@0: The media type (video, audio etc.). sl@0: */ sl@0: TMediaId(TUid aMediaType); sl@0: sl@0: /** sl@0: Default constructor. sl@0: */ sl@0: TMediaId(); sl@0: public: sl@0: /** sl@0: The media type (KUidMediaTypeAudio, KUidMediaTypeVideo, etc). sl@0: */ sl@0: TUid iMediaType; sl@0: sl@0: /** sl@0: Identifies a particular media stream used in case where multiple streams sl@0: of the same media type are present on the same MDataSource. sl@0: */ sl@0: TUint iStreamId; sl@0: private: sl@0: /** sl@0: This member is internal and not intended for use. sl@0: */ sl@0: TInt iReserved1; sl@0: TInt iReserved2; sl@0: TInt iReserved3; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: The FourCC code that represents NULL. sl@0: */ sl@0: const TInt KFourCCNULL = KMMFFourCCCodeNULL; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: A class that holds a four character code, representing supported data encodings for the sl@0: conversion destination. The four character codes are packed into a single TUint32. sl@0: sl@0: FourCC codes are a representation of the datatypes used to identify codecs. FourCC codes are used in sl@0: codec .rss files as a match string used by ECOM to correctly load the required DLL. sl@0: */ sl@0: class TFourCC sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Default constructor initialises the class to KMMFFourCCCodeNULL. sl@0: */ sl@0: TFourCC() {iFourCC = KMMFFourCCCodeNULL;} //'NULL' sl@0: sl@0: /** sl@0: Packs the four arguments into a single TUint32. sl@0: sl@0: The four arguments are packed in little-endian format. sl@0: sl@0: @param aChar1 sl@0: A character that represents part of the FourCC code. This character will be the least sl@0: significant byte of the code. sl@0: @param aChar2 sl@0: A character that represents part of the FourCC code. sl@0: @param aChar3 sl@0: A character that represents part of the FourCC code. sl@0: @param aChar4 sl@0: A character that represents part of the FourCC code. This character will be the most sl@0: significant byte of the code. sl@0: */ sl@0: TFourCC(TUint8 aChar1, TUint8 aChar2, TUint8 aChar3, TUint8 aChar4) {iFourCC =(aChar4<<24)+(aChar3<<16)+(aChar2<<8)+aChar1;} sl@0: sl@0: /** sl@0: Constructs a FourCC code with the given 8 bit desciptor where the descriptor contains the sl@0: characters that make up the FourCC code. sl@0: sl@0: @param aDes sl@0: The descriptor containing the characters from which to make the FourCC code. sl@0: */ sl@0: TFourCC(const TDesC8& aDes) {iFourCC =(aDes[3]<<24)+(aDes[2]<<16)+(aDes[1]<<8)+aDes[0];} sl@0: sl@0: /** sl@0: Constructor with a TInt32 in little-endian format. sl@0: sl@0: @param aFourCC sl@0: The FourCC code. sl@0: */ sl@0: TFourCC(TInt32 aFourCC) {iFourCC = aFourCC;} sl@0: sl@0: /** sl@0: Returns the FourCC code in little-endian format. sl@0: sl@0: @return The FourCC code in little-endian format. sl@0: */ sl@0: TUint32 FourCC() {return iFourCC;} sl@0: inline void FourCC( TPtr8* aDes ) const ; sl@0: sl@0: /** sl@0: Sets the FourCC code equal to the value in the supplied argument. sl@0: sl@0: @param aFourCC sl@0: The required TFourCC containting the FourCC code. sl@0: */ sl@0: void Set(TFourCC aFourCC) {iFourCC = aFourCC.iFourCC;} sl@0: sl@0: /** sl@0: Sets the FourCC code equal to the supplied argument. sl@0: sl@0: @param aFourCC sl@0: The required FourCC code. sl@0: */ sl@0: void Set(TUint32 aFourCC) {iFourCC = aFourCC;} sl@0: sl@0: /** sl@0: Equality operator. sl@0: sl@0: @param aA sl@0: The TFourCC code that *this will be tested against. sl@0: sl@0: @return A boolean indicating if the two values are equal. ETrue if the two values are equal, sl@0: otherwise false. sl@0: */ sl@0: TBool operator==(const TFourCC& aA) const {return (iFourCC == aA.iFourCC);} sl@0: sl@0: /** sl@0: Equality operator. sl@0: sl@0: @param aUint sl@0: The FourCC code that *this will be tested against. sl@0: sl@0: @return A boolean indicating if the two values are equal. ETrue if the two values are equal, sl@0: otherwise false. sl@0: */ sl@0: TBool operator==(const TUint32& aUint) const {return (iFourCC == aUint);} sl@0: sl@0: /** sl@0: Inequality operator. sl@0: sl@0: @param aA sl@0: The TFourCC code that *this will be tested against. sl@0: sl@0: @return A boolean indicating if the two values are not equal. ETrue if the two values are sl@0: unequal, otherwise false. sl@0: */ sl@0: TBool operator!=(const TFourCC& aA) const {return (iFourCC != aA.iFourCC);} sl@0: sl@0: /** sl@0: Inequality operator. sl@0: sl@0: @param aUint sl@0: The FourCC code that *this will be tested against. sl@0: */ sl@0: TBool operator!=(const TUint32& aUint) const {return (iFourCC != aUint);} sl@0: sl@0: private: sl@0: TUint32 iFourCC; sl@0: }; sl@0: sl@0: sl@0: #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: sl@0: sl@0: #include sl@0: sl@0: #endif sl@0: