|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Base DLNA profile resolver class for av files. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef C_UPNPAVSOLVERBASE_H |
|
24 #define C_UPNPAVSOLVERBASE_H |
|
25 |
|
26 |
|
27 // system includes |
|
28 #include <3gplibrary/mp4lib.h> |
|
29 |
|
30 // user includes |
|
31 #include "upnpprofiler.h" |
|
32 |
|
33 // forward declarations |
|
34 class CVideoRecorderUtility; |
|
35 |
|
36 // constants |
|
37 const TInt TMP4DecoderSpecificInfoSize = 16; |
|
38 |
|
39 // NONE |
|
40 |
|
41 /** |
|
42 * Av file DLNA profile base resolver class. |
|
43 * |
|
44 * This class is the base class for resolving DLNA profile of av files. |
|
45 * It contains methods for querying the profiles supported by this solver |
|
46 * and for resolving a DLNA profile of a given av file. |
|
47 * |
|
48 * |
|
49 * @lib dlnaprofiler.lib |
|
50 * @since S60 v3.1 |
|
51 */ |
|
52 NONSHARABLE_CLASS( CUpnpAvSolverBase ) : public CBase, |
|
53 public MUpnpProfiler |
|
54 { |
|
55 |
|
56 public: |
|
57 |
|
58 static CUpnpAvSolverBase* NewL(); |
|
59 |
|
60 static CUpnpAvSolverBase* NewLC(); |
|
61 |
|
62 virtual ~CUpnpAvSolverBase(); |
|
63 |
|
64 // from base class MUpnpProfiler |
|
65 |
|
66 /** |
|
67 * From MUpnpProfiler. |
|
68 * SupportedProfilesL returns DLNA profiles that are currently supported. |
|
69 * |
|
70 * @since S60 v3.1 |
|
71 * @param aProfiles Descriptor array where supported DLNA profiles are |
|
72 * added. |
|
73 * @return TInt Error code, KErrNone if successfull. |
|
74 */ |
|
75 TInt SupportedProfilesL( CDesC16ArrayFlat* aProfiles ) const; |
|
76 |
|
77 /** |
|
78 * From MUpnpProfiler. |
|
79 * ProfileForFileL is for resolving a DLNA profile of a given file. |
|
80 * Besides of file name, also mime type of the file is passed as a |
|
81 * parameter in order to avoid re-opening of the file. |
|
82 * |
|
83 * @since S60 v3.1 |
|
84 * @param aFileName Filename of the file which is to be resolved. |
|
85 * @param aMimeType Mime type of the file which is to be resolved. |
|
86 * @param aFile Handle to opened file specified by aFilename |
|
87 * @return DLNA profile of the file as a HBufC*, |
|
88 * NULL if could not be resolved |
|
89 */ |
|
90 HBufC* ProfileForFileL( const TDesC& aFilename, |
|
91 const TDesC8& aMimetype, |
|
92 RFile& aFile ); |
|
93 |
|
94 |
|
95 private: |
|
96 |
|
97 CUpnpAvSolverBase(); |
|
98 |
|
99 void ConstructL(); |
|
100 |
|
101 /** |
|
102 * GetVideoFileInformationL |
|
103 * |
|
104 * @since S60 v3.1 |
|
105 * @param aFileName Filename of the file which is to be resolved. |
|
106 * @return Error code. KErrNone if successfull. |
|
107 */ |
|
108 TInt GetVideoFileInformationL( RFile& aFile ); |
|
109 |
|
110 /** |
|
111 * A generic data container to be used in parsing different |
|
112 * MPEG4 codec headers |
|
113 */ |
|
114 class TMP4DecoderSpecificInfo |
|
115 { |
|
116 public: |
|
117 TUint32 iData[TMP4DecoderSpecificInfoSize]; |
|
118 }; |
|
119 |
|
120 |
|
121 private: // data |
|
122 |
|
123 // Type of video codec within the AV file |
|
124 mp4_u32 iVideoType; |
|
125 |
|
126 // Video resolution X size |
|
127 mp4_u32 iVideoResolutionX; |
|
128 |
|
129 // Video resolution Y size |
|
130 mp4_u32 iVideoResolutionY; |
|
131 |
|
132 mp4_double iVideoFramerate; |
|
133 |
|
134 // Type of audio codec within the AV file |
|
135 mp4_u32 iAudioType; |
|
136 |
|
137 // stream bitrate |
|
138 mp4_u32 iStreamAverageBitrate; |
|
139 |
|
140 // codec-specific details |
|
141 TMP4DecoderSpecificInfo iCodecInfo; |
|
142 |
|
143 }; |
|
144 |
|
145 #endif // C_UPNPAVSOLVERBASE_H |