sl@0: // Copyright (c) 2004-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.inl sl@0: // sl@0: // sl@0: 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: inline TMediaId::TMediaId(TUid aMediaType, TUint aStreamId) : iMediaType(aMediaType), iStreamId(aStreamId), iReserved1(0), iReserved2(0), iReserved3(0) sl@0: { sl@0: } 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: inline TMediaId::TMediaId(TUid aMediaType) : iMediaType(aMediaType), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0) sl@0: { sl@0: } sl@0: sl@0: /** sl@0: Default constructor. sl@0: */ sl@0: inline TMediaId::TMediaId() : iMediaType(KNullUid), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0) sl@0: { sl@0: } sl@0: sl@0: /** sl@0: Unpacks the FourCC code in little-endian format into the space provided by the argument. sl@0: sl@0: The argument must be a pointer to a buffer of 4 bytes or greater. sl@0: sl@0: @param aDes sl@0: A buffer to hold the unpacked FourCC code. sl@0: */ sl@0: inline void TFourCC::FourCC( TPtr8* aDes ) const sl@0: { sl@0: TUint8 char1 = TUint8( iFourCC ) ; sl@0: TUint8 char2 = TUint8( iFourCC >> 8 ) ; sl@0: TUint8 char3 = TUint8( iFourCC >> 16 ) ; sl@0: TUint8 char4 = TUint8( iFourCC >> 24 ) ; sl@0: sl@0: aDes->Format( _L8("%1c%1c%1c%1c"), char1, char2, char3, char4 ) ; sl@0: } sl@0: