os/mm/mmlibs/mmfw/inc/mmf/common/MmfUtilities.inl
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// include\mmf\common\mmfutilities.inl
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 
sl@0
    20
 Constructs the class with the supplied arguments.
sl@0
    21
 
sl@0
    22
 This constructor is used when there are multiple streams of the same media type on the same
sl@0
    23
 MDataSource.
sl@0
    24
 
sl@0
    25
 @param  aMediaType
sl@0
    26
 The media type (video, audio etc.).
sl@0
    27
 @param  aStreamId
sl@0
    28
 Identifies a specific stream when there are multiple streams of the same media type on 
sl@0
    29
 the same MDataSource.
sl@0
    30
*/
sl@0
    31
inline TMediaId::TMediaId(TUid aMediaType, TUint aStreamId) : iMediaType(aMediaType), iStreamId(aStreamId), iReserved1(0), iReserved2(0), iReserved3(0) 
sl@0
    32
	{
sl@0
    33
	}
sl@0
    34
sl@0
    35
/**
sl@0
    36
Constructs the class with the supplied argument.
sl@0
    37
	
sl@0
    38
This constructor is used when there is a single stream of the same media type on the same
sl@0
    39
MDataSource.
sl@0
    40
sl@0
    41
@param  aMediaType
sl@0
    42
        The media type (video, audio etc.).
sl@0
    43
*/
sl@0
    44
inline TMediaId::TMediaId(TUid aMediaType) : iMediaType(aMediaType), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0) 
sl@0
    45
	{
sl@0
    46
	}
sl@0
    47
sl@0
    48
/**
sl@0
    49
Default constructor.
sl@0
    50
*/
sl@0
    51
inline TMediaId::TMediaId() : iMediaType(KNullUid), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0) 
sl@0
    52
	{
sl@0
    53
	}
sl@0
    54
sl@0
    55
/**
sl@0
    56
Unpacks the FourCC code in little-endian format into the space provided by the argument.
sl@0
    57
sl@0
    58
The argument must be a pointer to a buffer of 4 bytes or greater.
sl@0
    59
sl@0
    60
@param aDes
sl@0
    61
       A buffer to hold the unpacked FourCC code.
sl@0
    62
*/
sl@0
    63
inline void TFourCC::FourCC( TPtr8* aDes ) const
sl@0
    64
	{
sl@0
    65
	TUint8 char1 = TUint8( iFourCC ) ;
sl@0
    66
	TUint8 char2 = TUint8( iFourCC >> 8 ) ;
sl@0
    67
	TUint8 char3 = TUint8( iFourCC >> 16 ) ;
sl@0
    68
	TUint8 char4 = TUint8( iFourCC >> 24 ) ;
sl@0
    69
sl@0
    70
	aDes->Format( _L8("%1c%1c%1c%1c"), char1, char2, char3, char4 ) ;
sl@0
    71
	}
sl@0
    72