1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // include\mmf\common\mmfutilities.h
18 #ifndef __MMF_COMMON_UTILITIES_H__
19 #define __MMF_COMMON_UTILITIES_H__
22 #include <mmf/server/mmfdatabuffer.h>
23 #include <mmf/common/mmffourcc.h>
30 Identifies the particular stream of the given media type.
37 Constructs the class with the supplied arguments.
39 This constructor is used when there are multiple streams of the same media type on the same
43 The media type (video, audio etc.).
45 Identifies a specific stream when there are multiple streams of the same media type on
48 TMediaId(TUid aMediaType, TUint aStreamId);
51 Constructs the class with the supplied argument.
53 This constructor is used when there is a single stream of the same media type on the same
57 The media type (video, audio etc.).
59 TMediaId(TUid aMediaType);
67 The media type (KUidMediaTypeAudio, KUidMediaTypeVideo, etc).
72 Identifies a particular media stream used in case where multiple streams
73 of the same media type are present on the same MDataSource.
78 This member is internal and not intended for use.
89 The FourCC code that represents NULL.
91 const TInt KFourCCNULL = KMMFFourCCCodeNULL;
97 A class that holds a four character code, representing supported data encodings for the
98 conversion destination. The four character codes are packed into a single TUint32.
100 FourCC codes are a representation of the datatypes used to identify codecs. FourCC codes are used in
101 codec .rss files as a match string used by ECOM to correctly load the required DLL.
108 Default constructor initialises the class to KMMFFourCCCodeNULL.
110 TFourCC() {iFourCC = KMMFFourCCCodeNULL;} //'NULL'
113 Packs the four arguments into a single TUint32.
115 The four arguments are packed in little-endian format.
118 A character that represents part of the FourCC code. This character will be the least
119 significant byte of the code.
121 A character that represents part of the FourCC code.
123 A character that represents part of the FourCC code.
125 A character that represents part of the FourCC code. This character will be the most
126 significant byte of the code.
128 TFourCC(TUint8 aChar1, TUint8 aChar2, TUint8 aChar3, TUint8 aChar4) {iFourCC =(aChar4<<24)+(aChar3<<16)+(aChar2<<8)+aChar1;}
131 Constructs a FourCC code with the given 8 bit desciptor where the descriptor contains the
132 characters that make up the FourCC code.
135 The descriptor containing the characters from which to make the FourCC code.
137 TFourCC(const TDesC8& aDes) {iFourCC =(aDes[3]<<24)+(aDes[2]<<16)+(aDes[1]<<8)+aDes[0];}
140 Constructor with a TInt32 in little-endian format.
145 TFourCC(TInt32 aFourCC) {iFourCC = aFourCC;}
148 Returns the FourCC code in little-endian format.
150 @return The FourCC code in little-endian format.
152 TUint32 FourCC() {return iFourCC;}
153 inline void FourCC( TPtr8* aDes ) const ;
156 Sets the FourCC code equal to the value in the supplied argument.
159 The required TFourCC containting the FourCC code.
161 void Set(TFourCC aFourCC) {iFourCC = aFourCC.iFourCC;}
164 Sets the FourCC code equal to the supplied argument.
167 The required FourCC code.
169 void Set(TUint32 aFourCC) {iFourCC = aFourCC;}
175 The TFourCC code that *this will be tested against.
177 @return A boolean indicating if the two values are equal. ETrue if the two values are equal,
180 TBool operator==(const TFourCC& aA) const {return (iFourCC == aA.iFourCC);}
186 The FourCC code that *this will be tested against.
188 @return A boolean indicating if the two values are equal. ETrue if the two values are equal,
191 TBool operator==(const TUint32& aUint) const {return (iFourCC == aUint);}
197 The TFourCC code that *this will be tested against.
199 @return A boolean indicating if the two values are not equal. ETrue if the two values are
200 unequal, otherwise false.
202 TBool operator!=(const TFourCC& aA) const {return (iFourCC != aA.iFourCC);}
208 The FourCC code that *this will be tested against.
210 TBool operator!=(const TUint32& aUint) const {return (iFourCC != aUint);}
217 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
218 #include <mmf/common/mmfhelper.h>
222 #include <mmf/common/mmfutilities.inl>