|
1 // Copyright (c) 2004-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // include\mmf\common\mmfutilities.inl |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 |
|
20 Constructs the class with the supplied arguments. |
|
21 |
|
22 This constructor is used when there are multiple streams of the same media type on the same |
|
23 MDataSource. |
|
24 |
|
25 @param aMediaType |
|
26 The media type (video, audio etc.). |
|
27 @param aStreamId |
|
28 Identifies a specific stream when there are multiple streams of the same media type on |
|
29 the same MDataSource. |
|
30 */ |
|
31 inline TMediaId::TMediaId(TUid aMediaType, TUint aStreamId) : iMediaType(aMediaType), iStreamId(aStreamId), iReserved1(0), iReserved2(0), iReserved3(0) |
|
32 { |
|
33 } |
|
34 |
|
35 /** |
|
36 Constructs the class with the supplied argument. |
|
37 |
|
38 This constructor is used when there is a single stream of the same media type on the same |
|
39 MDataSource. |
|
40 |
|
41 @param aMediaType |
|
42 The media type (video, audio etc.). |
|
43 */ |
|
44 inline TMediaId::TMediaId(TUid aMediaType) : iMediaType(aMediaType), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0) |
|
45 { |
|
46 } |
|
47 |
|
48 /** |
|
49 Default constructor. |
|
50 */ |
|
51 inline TMediaId::TMediaId() : iMediaType(KNullUid), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0) |
|
52 { |
|
53 } |
|
54 |
|
55 /** |
|
56 Unpacks the FourCC code in little-endian format into the space provided by the argument. |
|
57 |
|
58 The argument must be a pointer to a buffer of 4 bytes or greater. |
|
59 |
|
60 @param aDes |
|
61 A buffer to hold the unpacked FourCC code. |
|
62 */ |
|
63 inline void TFourCC::FourCC( TPtr8* aDes ) const |
|
64 { |
|
65 TUint8 char1 = TUint8( iFourCC ) ; |
|
66 TUint8 char2 = TUint8( iFourCC >> 8 ) ; |
|
67 TUint8 char3 = TUint8( iFourCC >> 16 ) ; |
|
68 TUint8 char4 = TUint8( iFourCC >> 24 ) ; |
|
69 |
|
70 aDes->Format( _L8("%1c%1c%1c%1c"), char1, char2, char3, char4 ) ; |
|
71 } |
|
72 |