1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/inc/mmf/common/MmfUtilities.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,72 @@
1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// include\mmf\common\mmfutilities.inl
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 +
1.23 + Constructs the class with the supplied arguments.
1.24 +
1.25 + This constructor is used when there are multiple streams of the same media type on the same
1.26 + MDataSource.
1.27 +
1.28 + @param aMediaType
1.29 + The media type (video, audio etc.).
1.30 + @param aStreamId
1.31 + Identifies a specific stream when there are multiple streams of the same media type on
1.32 + the same MDataSource.
1.33 +*/
1.34 +inline TMediaId::TMediaId(TUid aMediaType, TUint aStreamId) : iMediaType(aMediaType), iStreamId(aStreamId), iReserved1(0), iReserved2(0), iReserved3(0)
1.35 + {
1.36 + }
1.37 +
1.38 +/**
1.39 +Constructs the class with the supplied argument.
1.40 +
1.41 +This constructor is used when there is a single stream of the same media type on the same
1.42 +MDataSource.
1.43 +
1.44 +@param aMediaType
1.45 + The media type (video, audio etc.).
1.46 +*/
1.47 +inline TMediaId::TMediaId(TUid aMediaType) : iMediaType(aMediaType), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0)
1.48 + {
1.49 + }
1.50 +
1.51 +/**
1.52 +Default constructor.
1.53 +*/
1.54 +inline TMediaId::TMediaId() : iMediaType(KNullUid), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0)
1.55 + {
1.56 + }
1.57 +
1.58 +/**
1.59 +Unpacks the FourCC code in little-endian format into the space provided by the argument.
1.60 +
1.61 +The argument must be a pointer to a buffer of 4 bytes or greater.
1.62 +
1.63 +@param aDes
1.64 + A buffer to hold the unpacked FourCC code.
1.65 +*/
1.66 +inline void TFourCC::FourCC( TPtr8* aDes ) const
1.67 + {
1.68 + TUint8 char1 = TUint8( iFourCC ) ;
1.69 + TUint8 char2 = TUint8( iFourCC >> 8 ) ;
1.70 + TUint8 char3 = TUint8( iFourCC >> 16 ) ;
1.71 + TUint8 char4 = TUint8( iFourCC >> 24 ) ;
1.72 +
1.73 + aDes->Format( _L8("%1c%1c%1c%1c"), char1, char2, char3, char4 ) ;
1.74 + }
1.75 +