1 mmfutilities.inl |
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 /** |
|
21 |
|
22 Constructs the class with the supplied arguments. |
|
23 |
|
24 This constructor is used when there are multiple streams of the same media type on the same |
|
25 MDataSource. |
|
26 |
|
27 @param aMediaType |
|
28 The media type (video, audio etc.). |
|
29 @param aStreamId |
|
30 Identifies a specific stream when there are multiple streams of the same media type on |
|
31 the same MDataSource. |
|
32 */ |
|
33 inline TMediaId::TMediaId(TUid aMediaType, TUint aStreamId) : iMediaType(aMediaType), iStreamId(aStreamId), iReserved1(0), iReserved2(0), iReserved3(0) |
|
34 { |
|
35 } |
|
36 |
|
37 /** |
|
38 Constructs the class with the supplied argument. |
|
39 |
|
40 This constructor is used when there is a single stream of the same media type on the same |
|
41 MDataSource. |
|
42 |
|
43 @param aMediaType |
|
44 The media type (video, audio etc.). |
|
45 */ |
|
46 inline TMediaId::TMediaId(TUid aMediaType) : iMediaType(aMediaType), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0) |
|
47 { |
|
48 } |
|
49 |
|
50 /** |
|
51 Default constructor. |
|
52 */ |
|
53 inline TMediaId::TMediaId() : iMediaType(KNullUid), iStreamId(0), iReserved1(0), iReserved2(0), iReserved3(0) |
|
54 { |
|
55 } |
|
56 |
|
57 /** |
|
58 Unpacks the FourCC code in little-endian format into the space provided by the argument. |
|
59 |
|
60 The argument must be a pointer to a buffer of 4 bytes or greater. |
|
61 |
|
62 @param aDes |
|
63 A buffer to hold the unpacked FourCC code. |
|
64 */ |
|
65 inline void TFourCC::FourCC( TPtr8* aDes ) const |
|
66 { |
|
67 TUint8 char1 = TUint8( iFourCC ) ; |
|
68 TUint8 char2 = TUint8( iFourCC >> 8 ) ; |
|
69 TUint8 char3 = TUint8( iFourCC >> 16 ) ; |
|
70 TUint8 char4 = TUint8( iFourCC >> 24 ) ; |
|
71 |
|
72 aDes->Format( _L8("%1c%1c%1c%1c"), char1, char2, char3, char4 ) ; |
|
73 } |