|
1 /* |
|
2 * Copyright (c) 2005 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 * Messaging Video Info class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __MSGVIDEOINFO_H |
|
22 #define __MSGVIDEOINFO_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <w32std.h> |
|
28 |
|
29 // VideoPlayerUtility API |
|
30 #include <videoplayer.h> |
|
31 |
|
32 // Base Class |
|
33 #include <msgmediainfo.h> |
|
34 |
|
35 // CONSTANTS |
|
36 |
|
37 // MACROS |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 |
|
41 class RFile; |
|
42 class TDataType; |
|
43 class CHXMetaDataUtility; |
|
44 |
|
45 // DATA TYPES |
|
46 |
|
47 // FUNCTION PROTOTYPES |
|
48 |
|
49 // CLASS DECLARATION |
|
50 |
|
51 /** |
|
52 * Messaging Video Info class. |
|
53 * |
|
54 * @lib MsgMedia.lib |
|
55 * @since 3.1 |
|
56 */ |
|
57 NONSHARABLE_CLASS( CMsgVideoInfo ) : public CMsgMediaInfo |
|
58 { |
|
59 |
|
60 public: // New methods |
|
61 |
|
62 /** |
|
63 * Factory method that creates this object. |
|
64 * |
|
65 * @param aFile IN File handle to create info class from. |
|
66 * @param aMimeType IN Mime type of the file. |
|
67 * @return pointer to instance |
|
68 */ |
|
69 IMPORT_C static CMsgVideoInfo* NewL( |
|
70 RFile& aFile, |
|
71 TDataType& aMimeType ); |
|
72 |
|
73 /** |
|
74 * Destructor |
|
75 */ |
|
76 virtual ~CMsgVideoInfo(); |
|
77 |
|
78 /** |
|
79 * Get Framerate. |
|
80 * |
|
81 * @return Framerate of Video component. |
|
82 */ |
|
83 inline TReal32 VideoFrameRate() const; |
|
84 |
|
85 /** |
|
86 * Get Bitrate. |
|
87 * |
|
88 * @return Bitrate of Video component. |
|
89 */ |
|
90 inline TInt VideoBitRate() const; |
|
91 |
|
92 /** |
|
93 * Get Bitrate. |
|
94 * |
|
95 * @return Bitrate of Audio component. |
|
96 */ |
|
97 inline TInt AudioBitRate() const; |
|
98 |
|
99 /** |
|
100 * Get dimensions. |
|
101 * |
|
102 * @return Dimensions of unscaled image. |
|
103 */ |
|
104 inline TSize Dimensions() const; |
|
105 |
|
106 /** |
|
107 * Is Audio. |
|
108 * |
|
109 * @return Does video have audio clip included. |
|
110 */ |
|
111 inline TBool IsAudio() const; |
|
112 |
|
113 public: // From base classes |
|
114 |
|
115 /** |
|
116 * From CActive |
|
117 */ |
|
118 void DoCancel(); |
|
119 |
|
120 /** |
|
121 * From CActive |
|
122 */ |
|
123 void RunL(); |
|
124 |
|
125 |
|
126 protected: |
|
127 |
|
128 /** |
|
129 * Constructor. |
|
130 * |
|
131 * @param aMimeType IN Mime type of the file. |
|
132 */ |
|
133 CMsgVideoInfo( TDataType& aMimeType ); |
|
134 |
|
135 /** |
|
136 * 2nd phase constructor. |
|
137 * |
|
138 * @param aFile IN File handle to create info class from. |
|
139 */ |
|
140 void ConstructL( RFile& aFile ); |
|
141 |
|
142 /** |
|
143 * Opens the audio file and gets info (e.g. duration and dimensions). |
|
144 * Called from ConstructL. |
|
145 * |
|
146 * @param aFile IN File handle to create info class from. |
|
147 */ |
|
148 void ResolveVideoInfoL( RFile& aFile ); |
|
149 |
|
150 /** |
|
151 * ReadInformationL |
|
152 * Reads information from CVideoPlayerUtility object into |
|
153 * member variables. |
|
154 * |
|
155 * @param aVideoPlayer IN VideoPlayerUtility object to |
|
156 * read information from. |
|
157 */ |
|
158 void ReadInformationL( CHXMetaDataUtility& dataUtil ); |
|
159 |
|
160 protected: // data |
|
161 |
|
162 enum TMsgVideoState |
|
163 { |
|
164 EVideoStateIdle = 0, |
|
165 EVideoStateReady |
|
166 }; |
|
167 |
|
168 TInt iState; |
|
169 |
|
170 TInt iBitRate; |
|
171 TInt iAudioBitRate; |
|
172 |
|
173 TSize iOverallSizeInPixels; |
|
174 TReal32 iFramesPerSecond; |
|
175 TDataType iAudioType; |
|
176 TUid iControllerUid; |
|
177 |
|
178 }; |
|
179 |
|
180 #include <msgvideoinfo.inl> |
|
181 |
|
182 #endif // __MSGVIDEOINFO_H |