|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MCCFILEAUDIO_H |
|
22 #define MCCFILEAUDIO_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <mmf/common/mmfutilities.h> |
|
26 |
|
27 #include "mccfilesourcetypebase.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CMccFileSourceImpl; |
|
31 |
|
32 |
|
33 class CMccFileAudio : public CMccFileSourceTypeBase |
|
34 { |
|
35 public: |
|
36 static CMccFileAudio* NewL( CMccFileSourceImpl& aSource ); |
|
37 |
|
38 |
|
39 ~CMccFileAudio(); |
|
40 |
|
41 public: |
|
42 void FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer ); |
|
43 void DoSetPositionL( TUint32 aPosition ); |
|
44 CCMRMediaBuffer::TBufferType Type(); |
|
45 TUint32 Position(); |
|
46 TUint32 Duration(); |
|
47 TUint32 AudioBitRate(); |
|
48 TSize VideoFrameSize(); |
|
49 TReal VideoFrameRateL(); |
|
50 void StartTimerL(); |
|
51 TFourCC GetFourCC(); |
|
52 TCallBack TickCallBack(); |
|
53 |
|
54 public: |
|
55 static TInt TickAudioL( TAny* aObject ); |
|
56 TBool ReadFrameL( TBool aDoTimingCorrection ); |
|
57 |
|
58 public: |
|
59 |
|
60 TBool ParseUpdateAudioDescriptions( MP4Handle aMP4Handle ); |
|
61 |
|
62 private: |
|
63 |
|
64 CMccFileAudio( CMccFileSourceImpl& aSource ); |
|
65 void ConstructL(); |
|
66 |
|
67 private: |
|
68 |
|
69 TTimeIntervalMicroSeconds GetTimeStamp( TUint32 aAddToTimeStamp ); |
|
70 |
|
71 /** |
|
72 * Returns the frame lenght from given audio sample |
|
73 * @since |
|
74 */ |
|
75 TUint32 GetFrameLength( TPtrC8 aData ); |
|
76 |
|
77 void WriteBufferL(); |
|
78 |
|
79 private: //data |
|
80 |
|
81 TUint32 iLength; |
|
82 TUint32 iType; |
|
83 TUint32 iAverageBitRate; |
|
84 TUint32 iBufferSize; |
|
85 TUint32 iAudioSize; |
|
86 TUint32 iReturnedFrames; |
|
87 |
|
88 TBool iIsAudioLeft; |
|
89 |
|
90 TUint8 iFramesPerSample; |
|
91 |
|
92 TFourCC iFourCC; |
|
93 |
|
94 CCMRMediaBuffer::TBufferType iBufferType; |
|
95 |
|
96 TInt iReadsPerInterval; |
|
97 |
|
98 private: |
|
99 |
|
100 #ifdef EUNIT_TEST |
|
101 friend class UT_CMccFileAudio; |
|
102 friend class UT_CMccMultiplexer; |
|
103 #endif |
|
104 }; |
|
105 |
|
106 #endif // MCCFILEAUDIO_H |
|
107 |
|
108 // end of file |