|
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 MCCGENERICDATASOURCE_H |
|
22 #define MCCGENERICDATASOURCE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include "mccdatasource.h" |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 class CMccGenericDataSource : |
|
40 public CMccDataSource |
|
41 { |
|
42 public: |
|
43 |
|
44 CMccGenericDataSource ( TUid aType ) : |
|
45 CMccDataSource( aType ), |
|
46 iCanCreateSourceBuffer( ETrue ), |
|
47 iFourCC( KMccFourCCIdH263 ), |
|
48 iSourceBuffer( NULL ) |
|
49 { }; |
|
50 |
|
51 inline virtual ~CMccGenericDataSource() { } |
|
52 |
|
53 public: // From MDataSource |
|
54 |
|
55 /** |
|
56 * From MDataSource. Returns the data type as a fourCC code of the data source. |
|
57 * |
|
58 * @since Series 60 3.0 |
|
59 * @param "aMediaId" |
|
60 * This identifies the type of media eg audio or video and the stream id. |
|
61 * Only KUidMediaTypeAudio -mediatype is supported. |
|
62 * @return The fourCC code identifying the source datatype for the specified aMediaId. |
|
63 */ |
|
64 TFourCC SourceDataTypeCode( TMediaId /*aMediaId*/ ) |
|
65 { return iFourCC; } |
|
66 |
|
67 /** |
|
68 * From MDataSource. Method called by a MDataSink to request the data source to fill aBuffer with data. |
|
69 * |
|
70 * Datasource gets packet from jitterbuffer and forwards it to the payloadformatdecoder |
|
71 * for further processing. Datasource works synchronously; consumers BufferFilledL |
|
72 * is called when RTP packet is got succesfully from jitterbuffer. |
|
73 * |
|
74 * @since Series 60 3.0 |
|
75 * @param "aBuffer" |
|
76 * The buffer that needs filling with data |
|
77 * |
|
78 * @param "aConsumer" |
|
79 * The data sink that consumes the data. The data source needs this to make the BufferFilledL |
|
80 * callback on aConsumer when the data source has completed filling the aBuffer. |
|
81 * |
|
82 * @param "aMediaId" |
|
83 * This identifies the type of media eg audio or video and the stream id. |
|
84 * This parameter is required in cases where the source can supply data |
|
85 * of more than one media type and/or multiple strams of data eg a multimedia file. |
|
86 * @return None |
|
87 */ |
|
88 void FillBufferL( CMMFBuffer* /*aBuffer*/, MDataSink* /*aConsumer*/, TMediaId /*aMediaId*/ ) { }; |
|
89 |
|
90 /** |
|
91 * From MDataSource. Not used. Leaves with KErrNotSupported. |
|
92 * |
|
93 * @since Series 60 3.0 |
|
94 * @param "aBuffer" |
|
95 * The buffer that has been emptied by a data sink and is now available for reuse |
|
96 * @return None |
|
97 */ |
|
98 void BufferEmptiedL( CMMFBuffer* /*aBuffer*/ ) { }; |
|
99 |
|
100 /** |
|
101 * From MDataSource. Method to indicate whether the data source can create a buffer. |
|
102 * |
|
103 * @since Series 60 3.0 |
|
104 * |
|
105 * @return EFalse |
|
106 */ |
|
107 TBool CanCreateSourceBuffer() { return iCanCreateSourceBuffer; }; |
|
108 |
|
109 /** |
|
110 * From MDataSource. Not used. Leaves with KErrNotSupported. |
|
111 * |
|
112 * @since Series 60 3.0 |
|
113 * @param "aMediaId" |
|
114 * This identifies the type of media eg audio or video and the stream id. |
|
115 * This parameter is required in cases where the source can supply data |
|
116 * of more than one media type and/or multiple strams of data eg a multimedia file. |
|
117 * |
|
118 * @param "aReference" |
|
119 * This must be written to by the method to indicate whether the created buffer is |
|
120 * a 'reference' buffer. A 'reference' buffer is a buffer that is owned by the source |
|
121 * and should be used in preference to the sink buffer provided the sink buffer |
|
122 * is also not a reference buffer. |
|
123 * . |
|
124 * @return The created buffer |
|
125 */ |
|
126 CMMFBuffer* CreateSourceBufferL( TMediaId /*aMediaId*/, TBool& /*aReference*/ ) |
|
127 { return iSourceBuffer; }; |
|
128 |
|
129 /** |
|
130 * Method to perform any source construction dependant on the source construction |
|
131 * initialisation data aInitData |
|
132 * |
|
133 * This is a pure virtual function that a derrived data source must implement |
|
134 * |
|
135 * @param "aInitData" |
|
136 * source specific initialisation data required for source construction |
|
137 */ |
|
138 void ConstructSourceL ( const TDesC8& /*aInitData*/ ) { }; |
|
139 |
|
140 public: // From MMccDataSource |
|
141 |
|
142 virtual void GetParameterL( TUint32 aParam, TDes8& aVal ) |
|
143 { |
|
144 if ( aParam == iParam ) |
|
145 { |
|
146 aVal = iVal; |
|
147 } |
|
148 } |
|
149 |
|
150 virtual void SetParameterL( TUint32 aParam, const TDesC8& aVal ) |
|
151 { |
|
152 iParam = aParam; |
|
153 iVal = aVal; |
|
154 } |
|
155 |
|
156 protected: |
|
157 |
|
158 TUint32 iParam; |
|
159 |
|
160 TBuf8<100> iVal; |
|
161 |
|
162 TBool iCanCreateSourceBuffer; |
|
163 |
|
164 TFourCC iFourCC; |
|
165 |
|
166 CMMFBuffer* iSourceBuffer; |
|
167 |
|
168 }; |
|
169 |
|
170 #endif // MCCGENERICDATASOURCE_H |
|
171 |
|
172 // End of File |