|
1 /* |
|
2 * Copyright (c) 2008 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: Simple v2/v3 ASX-fileparser |
|
15 * Finds streaming URLs from ASX files and provides an |
|
16 * interface to query them |
|
17 * |
|
18 */ |
|
19 |
|
20 // Version : %version: 4.1.2 % |
|
21 |
|
22 |
|
23 |
|
24 #ifndef CASXPARSER_H |
|
25 #define CASXPARSER_H |
|
26 |
|
27 // INCLUDES |
|
28 #include <f32file.h> |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 |
|
33 // CLASS DECLARATIONS |
|
34 |
|
35 |
|
36 struct AsxStruct { |
|
37 HBufC8* url; |
|
38 TBool seek; |
|
39 }; |
|
40 |
|
41 /* |
|
42 * CAsxParser. |
|
43 * @since 3.2 |
|
44 */ |
|
45 class CAsxParser : public CBase |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /* |
|
50 * Two-phased constructor. |
|
51 * @since 3.2 |
|
52 * @param const TDesC& File to parse |
|
53 * @return CAsxParser object initialized |
|
54 */ |
|
55 IMPORT_C static CAsxParser* NewL( const TDesC& aFileName ); |
|
56 |
|
57 /* |
|
58 * Two-phased constructor. |
|
59 * @since 5.0 |
|
60 * @param aFile file handle |
|
61 * @return CAsxParser object initialized |
|
62 */ |
|
63 IMPORT_C static CAsxParser* NewL( RFile& aFile ); |
|
64 |
|
65 /* |
|
66 * Destructor. |
|
67 */ |
|
68 IMPORT_C ~CAsxParser(); |
|
69 |
|
70 /* |
|
71 * GetUrl |
|
72 * @since 3.2 |
|
73 * @param const TUint The number of URLs in the file |
|
74 * @return TInt |
|
75 */ |
|
76 IMPORT_C void GetUrlCount( TUint &aHowManyUrls ); |
|
77 |
|
78 /* |
|
79 * GetUrl |
|
80 * @since 3.2 |
|
81 * @param const TInt The index number of the URL to retrieve |
|
82 * @return TInt |
|
83 */ |
|
84 IMPORT_C TInt GetUrl( const TUint aUrlIndex, TPtrC8& aUrl ); |
|
85 IMPORT_C AsxStruct* GetUrl( const TUint aUrlIndex ); |
|
86 |
|
87 /* |
|
88 * GetUrl |
|
89 * @since 3.2 |
|
90 * @param none |
|
91 * @return TInt |
|
92 */ |
|
93 IMPORT_C TInt FileVersion(); |
|
94 |
|
95 /* |
|
96 * PrintUrl |
|
97 * @since 5.0 |
|
98 * @param aUrl8 |
|
99 * @return aUrl |
|
100 */ |
|
101 IMPORT_C void PrintUrl( TPtrC8& aUrl8, TPtr& aUrl ); |
|
102 |
|
103 |
|
104 private: // New methods |
|
105 |
|
106 /* |
|
107 * C++ default constructor. |
|
108 */ |
|
109 CAsxParser(); |
|
110 |
|
111 /* |
|
112 * By default Symbian 2nd phase constructor is private. |
|
113 * @param TDesC& File to parse |
|
114 * @return void |
|
115 */ |
|
116 void ConstructL( const TDesC& aFileName ); |
|
117 |
|
118 /* |
|
119 * By default Symbian 2nd phase constructor is private. |
|
120 * @since 5.0 |
|
121 * @param aFile file handle |
|
122 * @return void |
|
123 */ |
|
124 void ConstructL( RFile& aFile ); |
|
125 |
|
126 /* |
|
127 * Parse a Asx V2 Header file |
|
128 * @param TPtr8 pointer to buffer containing asx file |
|
129 * @return void |
|
130 */ |
|
131 void ParseAsxV2HeaderL( TPtr8 aPtr ); |
|
132 |
|
133 /* |
|
134 * Parse a Asx V3 Header file |
|
135 * @param TPtr8 pointer to buffer containing asx file |
|
136 * @return void |
|
137 */ |
|
138 void ParseAsxV3HeaderL( TPtr8 aPtr ); |
|
139 |
|
140 /* |
|
141 * Handle common file parsing |
|
142 * @since 5.0 |
|
143 * @param aFile file handle |
|
144 * @return void |
|
145 */ |
|
146 void HandleFileParsingL( RFile& aFile ); |
|
147 |
|
148 |
|
149 private: // Data |
|
150 |
|
151 RPointerArray<AsxStruct> iAsxArray; |
|
152 TInt iVersion; |
|
153 }; |
|
154 |
|
155 #endif // CBAVPCONTROLLERVIDEO_H |
|
156 |
|
157 // End of File |