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