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