43 |
43 |
44 extern void* vfHandle; |
44 extern void* vfHandle; |
45 |
45 |
46 /* Static mapping of enumeration XAMediaPlayerInterfaces to interface iids */ |
46 /* Static mapping of enumeration XAMediaPlayerInterfaces to interface iids */ |
47 static const XAInterfaceID* xaMediaPlayerItfIIDs[MP_ITFCOUNT] = |
47 static const XAInterfaceID* xaMediaPlayerItfIIDs[MP_ITFCOUNT] = |
48 { |
48 { |
49 &XA_IID_OBJECT, |
49 &XA_IID_OBJECT, |
50 &XA_IID_DYNAMICINTERFACEMANAGEMENT, |
50 &XA_IID_DYNAMICINTERFACEMANAGEMENT, |
51 &XA_IID_PLAY, |
51 &XA_IID_PLAY, |
52 &XA_IID_SEEK, |
52 &XA_IID_SEEK, |
53 &XA_IID_VOLUME, |
53 &XA_IID_VOLUME, |
54 &XA_IID_PREFETCHSTATUS, |
54 &XA_IID_PREFETCHSTATUS, |
55 &XA_IID_CONFIGEXTENSION, |
55 &XA_IID_CONFIGEXTENSION, |
56 &XA_IID_DYNAMICSOURCE, |
56 &XA_IID_DYNAMICSOURCE, |
57 &XA_IID_EQUALIZER, |
57 &XA_IID_EQUALIZER, |
58 &XA_IID_IMAGECONTROLS, |
58 &XA_IID_IMAGECONTROLS, |
59 &XA_IID_IMAGEEFFECTS, |
59 &XA_IID_IMAGEEFFECTS, |
60 &XA_IID_METADATAEXTRACTION, |
60 &XA_IID_METADATAEXTRACTION, |
61 &XA_IID_METADATATRAVERSAL, |
61 &XA_IID_METADATATRAVERSAL, |
62 &XA_IID_PLAYBACKRATE, |
62 &XA_IID_PLAYBACKRATE, |
63 &XA_IID_VIDEOPOSTPROCESSING, |
63 &XA_IID_VIDEOPOSTPROCESSING, |
64 &XA_IID_NOKIAVOLUMEEXT, |
64 &XA_IID_NOKIAVOLUMEEXT, |
65 &XA_IID_NOKIALINEARVOLUME, |
65 &XA_IID_NOKIALINEARVOLUME, |
66 &XA_IID_STREAMINFORMATION |
66 &XA_IID_STREAMINFORMATION |
67 }; |
67 }; |
68 |
68 |
69 /* Global methods */ |
69 /* Global methods */ |
70 |
70 |
71 /* XAResult XAMediaPlayerImpl_CreateMediaPlayer |
71 /* XAResult XAMediaPlayerImpl_CreateMediaPlayer |
72 * Create object |
72 * Create object |
73 */ |
73 */ |
74 XAresult XAMediaPlayerImpl_CreateMediaPlayer(FrameworkMap* mapper, |
74 XAresult XAMediaPlayerImpl_CreateMediaPlayer(FrameworkMap* mapper, |
75 XACapabilities* capabilities, |
75 XACapabilities* capabilities, XAObjectItf *pPlayer, |
76 XAObjectItf *pPlayer, |
76 XADataSource *pDataSrc, XADataSource *pBankSrc, |
77 XADataSource *pDataSrc, |
77 XADataSink *pAudioSnk, XADataSink *pImageVideoSnk, |
78 XADataSource *pBankSrc, |
78 XADataSink *pVibra, XADataSink *pLEDArray, XAuint32 numInterfaces, |
79 XADataSink *pAudioSnk, |
79 const XAInterfaceID *pInterfaceIds, |
80 XADataSink *pImageVideoSnk, |
80 const XAboolean *pInterfaceRequired) |
81 XADataSink *pVibra, |
81 { |
82 XADataSink *pLEDArray, |
|
83 XAuint32 numInterfaces, |
|
84 const XAInterfaceID *pInterfaceIds, |
|
85 const XAboolean *pInterfaceRequired) |
|
86 { |
|
87 XAuint8 itfIdx = 0; |
82 XAuint8 itfIdx = 0; |
88 XAMediaType mediaType = XA_MEDIATYPE_UNKNOWN; |
83 XAMediaType mediaType = XA_MEDIATYPE_UNKNOWN; |
89 XAMediaPlayerImpl* pPlayerImpl = NULL; |
84 XAMediaPlayerImpl* pPlayerImpl = NULL; |
90 FWMgrFwType fwType; |
85 FWMgrFwType fwType; |
91 XAObjectItfImpl* pBaseObj = NULL; |
86 XAObjectItfImpl* pBaseObj = NULL; |
92 const char *uri = NULL; |
87 const char *uri = NULL; |
93 XAresult ret = XA_RESULT_SUCCESS; |
88 XAresult ret = XA_RESULT_SUCCESS; |
94 XADataLocator_IODevice* tmpIODevice; |
89 XADataLocator_IODevice* tmpIODevice; |
95 XADataLocator_IODevice locatorIODevice; |
90 XADataLocator_IODevice locatorIODevice; |
96 |
91 |
97 DEBUG_API("->XAMediaPlayerImpl_CreateMediaPlayer"); |
92 DEBUG_API("->XAMediaPlayerImpl_CreateMediaPlayer"); |
98 |
93 |
99 XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer); |
94 XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer); |
100 |
95 |
101 if(!pPlayer || !pDataSrc) |
96 if (!pPlayer || !pDataSrc) |
102 { |
97 { |
103 XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer); |
98 XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer); |
104 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
99 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
105 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
100 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
106 return XA_RESULT_PARAMETER_INVALID; |
101 return XA_RESULT_PARAMETER_INVALID; |
107 } |
102 } |
108 /* check sink&source parameters */ |
103 /* check sink&source parameters */ |
109 ret = XACommon_ValidateDataLocator(6, pAudioSnk, pImageVideoSnk, pDataSrc, |
104 ret = XACommon_ValidateDataLocator(6, pAudioSnk, pImageVideoSnk, |
110 pBankSrc, pVibra, pLEDArray); |
105 pDataSrc, pBankSrc, pVibra, pLEDArray); |
111 if(ret!=XA_RESULT_SUCCESS) |
106 if (ret != XA_RESULT_SUCCESS) |
112 { |
107 { |
113 XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer); |
108 XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer); |
114 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
109 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
115 return ret; |
110 return ret; |
116 } |
111 } |
117 /* also, check source availability */ |
112 /* also, check source availability */ |
118 ret = XACommon_CheckDataSource(pDataSrc,&mediaType); |
113 ret = XACommon_CheckDataSource(pDataSrc, &mediaType); |
119 if(ret!=XA_RESULT_SUCCESS) |
114 if (ret != XA_RESULT_SUCCESS) |
120 { |
115 { |
121 XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer); |
116 XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer); |
122 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
117 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
123 return ret; |
118 return ret; |
124 } |
119 } |
125 |
120 |
126 /* instantiate object */ |
121 /* instantiate object */ |
127 pPlayerImpl = (XAMediaPlayerImpl*)calloc(1,sizeof(XAMediaPlayerImpl)); |
122 pPlayerImpl = (XAMediaPlayerImpl*) calloc(1, sizeof(XAMediaPlayerImpl)); |
128 if(!pPlayerImpl) |
123 if (!pPlayerImpl) |
129 { |
124 { |
130 /* memory allocation failed */ |
125 /* memory allocation failed */ |
131 XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer); |
126 XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer); |
132 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
127 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
133 return XA_RESULT_MEMORY_FAILURE; |
128 return XA_RESULT_MEMORY_FAILURE; |
134 } |
129 } |
135 pBaseObj = &pPlayerImpl->baseObj; |
130 pBaseObj = &pPlayerImpl->baseObj; |
136 |
131 |
137 /* Initialize base object default implementation */ |
132 /* Initialize base object default implementation */ |
138 XAObjectItfImpl_Init(pBaseObj, MP_ITFCOUNT, xaMediaPlayerItfIIDs, |
133 XAObjectItfImpl_Init(pBaseObj, MP_ITFCOUNT, xaMediaPlayerItfIIDs, |
139 XAMediaPlayerImpl_DoRealize, XAMediaPlayerImpl_DoResume, |
134 XAMediaPlayerImpl_DoRealize, XAMediaPlayerImpl_DoResume, |
140 XAMediaPlayerImpl_FreeResources); |
135 XAMediaPlayerImpl_FreeResources); |
141 |
136 |
142 /* Mark interfaces that need to be exposed */ |
137 /* Mark interfaces that need to be exposed */ |
143 /* Implicit and mandated interfaces */ |
138 /* Implicit and mandated interfaces */ |
144 pBaseObj->interfaceMap[MP_PLAYITF].required = XA_BOOLEAN_TRUE; |
139 pBaseObj->interfaceMap[MP_PLAYITF].required = XA_BOOLEAN_TRUE; |
145 pBaseObj->interfaceMap[MP_DIMITF].required = XA_BOOLEAN_TRUE; |
140 pBaseObj->interfaceMap[MP_DIMITF].required = XA_BOOLEAN_TRUE; |
146 |
141 |
147 /* Explicit interfaces */ |
142 /* Explicit interfaces */ |
148 if((numInterfaces != 0) && pInterfaceIds && pInterfaceRequired) |
143 if ((numInterfaces != 0) && pInterfaceIds && pInterfaceRequired) |
149 { |
144 { |
150 /* Check required interfaces */ |
145 /* Check required interfaces */ |
151 for(itfIdx = 0; itfIdx < numInterfaces; itfIdx++) |
146 for (itfIdx = 0; itfIdx < numInterfaces; itfIdx++) |
152 { |
147 { |
153 /* If mapEntry is null then required interface is not supported.*/ |
148 /* If mapEntry is null then required interface is not supported.*/ |
154 XAObjItfMapEntry *entry = |
149 XAObjItfMapEntry *entry = XAObjectItfImpl_GetItfEntry( |
155 XAObjectItfImpl_GetItfEntry((XAObjectItf)&(pBaseObj), pInterfaceIds[itfIdx]); |
150 (XAObjectItf) &(pBaseObj), pInterfaceIds[itfIdx]); |
156 if( !entry ) |
151 if (!entry) |
157 { |
|
158 if( pInterfaceRequired[itfIdx] ) |
|
159 { |
152 { |
|
153 if (pInterfaceRequired[itfIdx]) |
|
154 { |
160 /* required interface cannot be accommodated - fail creation */ |
155 /* required interface cannot be accommodated - fail creation */ |
161 DEBUG_ERR("Required interface not found - abort creation!"); |
156 DEBUG_ERR("Required interface not found - abort creation!"); |
162 ret = XA_RESULT_FEATURE_UNSUPPORTED; |
157 ret = XA_RESULT_FEATURE_UNSUPPORTED; |
163 break; |
158 break; |
|
159 } |
|
160 else |
|
161 { |
|
162 DEBUG_INFO("Requested (not required) interface not found - continue creation"); |
|
163 } |
164 } |
164 } |
165 else |
|
166 { |
|
167 DEBUG_INFO("Requested (not required) interface not found - continue creation"); |
|
168 } |
|
169 } |
|
170 else |
165 else |
171 { /* weed out unsupported content-aware itf's */ |
166 { /* weed out unsupported content-aware itf's */ |
172 if( (mediaType==XA_MEDIATYPE_IMAGE && |
167 if ((mediaType == XA_MEDIATYPE_IMAGE && (entry->mapIdx |
173 (entry->mapIdx==MP_SEEKITF || |
168 == MP_SEEKITF || entry->mapIdx == MP_EQUALIZERITF |
174 entry->mapIdx==MP_EQUALIZERITF || |
169 || entry->mapIdx == MP_VOLUMEITF)) || (mediaType |
175 entry->mapIdx==MP_VOLUMEITF)) |
170 == XA_MEDIATYPE_AUDIO && (entry->mapIdx |
176 || |
171 == MP_IMAGECONTROLSITF || entry->mapIdx |
177 (mediaType==XA_MEDIATYPE_AUDIO && |
172 == MP_IMAGEEFFECTSITF || entry->mapIdx |
178 (entry->mapIdx==MP_IMAGECONTROLSITF || |
173 == MP_VIDEOPOSTPROCESSINGITF))) |
179 entry->mapIdx==MP_IMAGEEFFECTSITF || |
174 { |
180 entry->mapIdx==MP_VIDEOPOSTPROCESSINGITF)) ) |
|
181 { |
|
182 entry->required = XA_BOOLEAN_FALSE; |
175 entry->required = XA_BOOLEAN_FALSE; |
183 if( pInterfaceRequired[itfIdx] ) |
176 if (pInterfaceRequired[itfIdx]) |
184 { |
177 { |
185 DEBUG_ERR("Required interface not supported for given media - abort creation!"); |
178 DEBUG_ERR("Required interface not supported for given media - abort creation!"); |
186 ret = XA_RESULT_FEATURE_UNSUPPORTED; |
179 ret = XA_RESULT_FEATURE_UNSUPPORTED; |
187 break; |
180 break; |
|
181 } |
|
182 } |
|
183 else |
|
184 { |
|
185 entry->required = XA_BOOLEAN_TRUE; |
188 } |
186 } |
189 } |
187 } |
190 else |
188 } |
191 { |
189 } |
192 entry->required = XA_BOOLEAN_TRUE; |
190 |
193 } |
191 if (ret != XA_RESULT_SUCCESS) |
194 } |
192 { /* creation fails */ |
195 } |
193 XAObjectItfImpl_Destroy((XAObjectItf) &(pBaseObj)); |
196 } |
|
197 |
|
198 if(ret!=XA_RESULT_SUCCESS) |
|
199 { /* creation fails */ |
|
200 XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj)); |
|
201 return ret; |
194 return ret; |
202 } |
195 } |
203 |
196 |
204 /* Mark interfaces that can be handled dynamically */ |
197 /* Mark interfaces that can be handled dynamically */ |
205 /* Mandated dynamic itfs */ |
198 /* Mandated dynamic itfs */ |
206 pBaseObj->interfaceMap[MP_EQUALIZERITF].isDynamic = XA_BOOLEAN_TRUE; |
199 pBaseObj->interfaceMap[MP_EQUALIZERITF].isDynamic = XA_BOOLEAN_TRUE; |
207 pBaseObj->interfaceMap[MP_IMAGEEFFECTSITF].isDynamic = XA_BOOLEAN_TRUE; |
200 pBaseObj->interfaceMap[MP_IMAGEEFFECTSITF].isDynamic = XA_BOOLEAN_TRUE; |
208 pBaseObj->interfaceMap[MP_METADATAEXTRACTIONITF].isDynamic = XA_BOOLEAN_TRUE; |
201 pBaseObj->interfaceMap[MP_METADATAEXTRACTIONITF].isDynamic |
209 pBaseObj->interfaceMap[MP_METADATATRAVERSALITF].isDynamic = XA_BOOLEAN_TRUE; |
202 = XA_BOOLEAN_TRUE; |
|
203 pBaseObj->interfaceMap[MP_METADATATRAVERSALITF].isDynamic |
|
204 = XA_BOOLEAN_TRUE; |
210 pBaseObj->interfaceMap[MP_PLAYBACKRATEITF].isDynamic = XA_BOOLEAN_TRUE; |
205 pBaseObj->interfaceMap[MP_PLAYBACKRATEITF].isDynamic = XA_BOOLEAN_TRUE; |
211 |
206 |
212 |
207 /*Set ObjectItf to point to newly created object*/ |
213 /*Set ObjectItf to point to newly created object*/ |
208 *pPlayer = (XAObjectItf) &(pBaseObj->self); |
214 *pPlayer = (XAObjectItf)&(pBaseObj->self); |
|
215 |
209 |
216 /*initialize XAPlayerImpl variables */ |
210 /*initialize XAPlayerImpl variables */ |
217 |
211 |
218 pPlayerImpl->dataSrc = pDataSrc; |
212 pPlayerImpl->dataSrc = pDataSrc; |
219 pPlayerImpl->bankSrc = pBankSrc; |
213 pPlayerImpl->bankSrc = pBankSrc; |
220 pPlayerImpl->audioSnk = pAudioSnk; |
214 pPlayerImpl->audioSnk = pAudioSnk; |
221 pPlayerImpl->imageVideoSnk = pImageVideoSnk; |
215 pPlayerImpl->imageVideoSnk = pImageVideoSnk; |
222 pPlayerImpl->vibra = pVibra; |
216 pPlayerImpl->vibra = pVibra; |
223 pPlayerImpl->LEDArray = pLEDArray; |
217 pPlayerImpl->LEDArray = pLEDArray; |
224 |
218 |
225 // Handle possible radio: |
219 // Handle possible radio: |
226 tmpIODevice = (XADataLocator_IODevice*)(pPlayerImpl->dataSrc->pLocator); |
220 tmpIODevice = (XADataLocator_IODevice*) (pPlayerImpl->dataSrc->pLocator); |
227 locatorIODevice = *tmpIODevice; |
221 locatorIODevice = *tmpIODevice; |
228 if (locatorIODevice.deviceType == XA_IODEVICE_RADIO) |
222 if (locatorIODevice.deviceType == XA_IODEVICE_RADIO) |
229 { |
223 { |
230 fwType = (FWMgrFwType)FWMgrFWMMF; |
224 fwType = (FWMgrFwType) FWMgrFWMMF; |
231 } |
225 } |
232 else |
|
233 { |
|
234 /* Determine framework type that can handle recording */ |
|
235 fwType = (FWMgrFwType)FWMgrMOUnknown; |
|
236 /**/ |
|
237 if (pDataSrc->pLocator) |
|
238 { |
|
239 XADataLocator_URI* dataLoc = (XADataLocator_URI*)pDataSrc->pLocator; |
|
240 if (dataLoc->locatorType == XA_DATALOCATOR_URI) |
|
241 { |
|
242 uri = (char*)dataLoc->URI; |
|
243 } |
|
244 } |
|
245 fwType = XAFrameworkMgr_GetFramework( |
|
246 mapper, |
|
247 uri, |
|
248 FWMgrMOPlayer); |
|
249 |
|
250 if (fwType == FWMgrMOUnknown) |
|
251 { |
|
252 ret = XA_RESULT_CONTENT_UNSUPPORTED; |
|
253 XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj)); |
|
254 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
|
255 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
|
256 return ret; |
|
257 } |
|
258 } // end else |
|
259 |
|
260 if(fwType == FWMgrFWMMF) |
|
261 { |
|
262 pPlayerImpl->adaptationCtxMMF = XAMediaPlayerAdaptMMF_Create(pPlayerImpl->dataSrc, |
|
263 pPlayerImpl->bankSrc, |
|
264 pPlayerImpl->audioSnk, |
|
265 pPlayerImpl->imageVideoSnk, |
|
266 pPlayerImpl->vibra, |
|
267 pPlayerImpl->LEDArray); |
|
268 |
|
269 pPlayerImpl->curAdaptCtx = pPlayerImpl->adaptationCtxMMF; |
|
270 } |
|
271 else |
226 else |
272 { |
227 { |
273 pPlayerImpl->adaptationCtxGst = XAMediaPlayerAdapt_Create(pPlayerImpl->dataSrc, |
228 /* Determine framework type that can handle recording */ |
274 pPlayerImpl->bankSrc, |
229 fwType = (FWMgrFwType) FWMgrMOUnknown; |
275 pPlayerImpl->audioSnk, |
230 /**/ |
276 pPlayerImpl->imageVideoSnk, |
231 if (pDataSrc->pLocator) |
277 pPlayerImpl->vibra, |
232 { |
278 pPlayerImpl->LEDArray); |
233 XADataLocator_URI* dataLoc = |
279 |
234 (XADataLocator_URI*) pDataSrc->pLocator; |
280 pPlayerImpl->curAdaptCtx = pPlayerImpl->adaptationCtxGst; |
235 if (dataLoc->locatorType == XA_DATALOCATOR_URI) |
281 } |
236 { |
282 |
237 uri = (char*) dataLoc->URI; |
|
238 } |
|
239 } |
|
240 fwType = XAFrameworkMgr_GetFramework(mapper, uri, FWMgrMOPlayer); |
|
241 |
|
242 if (fwType == FWMgrMOUnknown) |
|
243 { |
|
244 ret = XA_RESULT_CONTENT_UNSUPPORTED; |
|
245 XAObjectItfImpl_Destroy((XAObjectItf) &(pBaseObj)); |
|
246 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
|
247 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
|
248 return ret; |
|
249 } |
|
250 } // end else |
|
251 |
|
252 if (fwType == FWMgrFWMMF) |
|
253 { |
|
254 pPlayerImpl->adaptationCtxMMF = XAMediaPlayerAdaptMMF_Create( |
|
255 pPlayerImpl->dataSrc, pPlayerImpl->bankSrc, |
|
256 pPlayerImpl->audioSnk, pPlayerImpl->imageVideoSnk, |
|
257 pPlayerImpl->vibra, pPlayerImpl->LEDArray); |
|
258 |
|
259 pPlayerImpl->curAdaptCtx = pPlayerImpl->adaptationCtxMMF; |
|
260 } |
|
261 else |
|
262 { |
|
263 pPlayerImpl->adaptationCtxGst = XAMediaPlayerAdapt_Create( |
|
264 pPlayerImpl->dataSrc, pPlayerImpl->bankSrc, |
|
265 pPlayerImpl->audioSnk, pPlayerImpl->imageVideoSnk, |
|
266 pPlayerImpl->vibra, pPlayerImpl->LEDArray); |
|
267 |
|
268 pPlayerImpl->curAdaptCtx = pPlayerImpl->adaptationCtxGst; |
|
269 } |
|
270 |
283 pPlayerImpl->curAdaptCtx->capslist = capabilities; |
271 pPlayerImpl->curAdaptCtx->capslist = capabilities; |
284 pPlayerImpl->curAdaptCtx->fwtype = fwType; |
272 pPlayerImpl->curAdaptCtx->fwtype = fwType; |
285 |
273 |
286 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
274 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
287 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
275 DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer"); |
288 return XA_RESULT_SUCCESS; |
276 return XA_RESULT_SUCCESS; |
289 } |
277 } |
290 |
278 |
291 /* XAResult XAMediaPlayerImpl_QueryNumSupportedInterfaces |
279 /* XAResult XAMediaPlayerImpl_QueryNumSupportedInterfaces |
292 * Statically query supported interfaces |
280 * Statically query supported interfaces |
293 */ |
281 */ |
294 XAresult XAMediaPlayerImpl_QueryNumSupportedInterfaces(XAuint32 * pNumSupportedInterfaces) |
282 XAresult XAMediaPlayerImpl_QueryNumSupportedInterfaces( |
295 { |
283 XAuint32 * pNumSupportedInterfaces) |
|
284 { |
296 DEBUG_API("->XAMediaPlayerImpl_QueryNumSupportedInterfaces"); |
285 DEBUG_API("->XAMediaPlayerImpl_QueryNumSupportedInterfaces"); |
297 |
286 |
298 if(pNumSupportedInterfaces) |
287 if (pNumSupportedInterfaces) |
299 { |
288 { |
300 *pNumSupportedInterfaces = MP_ITFCOUNT; |
289 *pNumSupportedInterfaces = MP_ITFCOUNT; |
301 DEBUG_API("<-XAMediaPlayerImpl_QueryNumSupportedInterfaces"); |
290 DEBUG_API("<-XAMediaPlayerImpl_QueryNumSupportedInterfaces"); |
302 return XA_RESULT_SUCCESS; |
291 return XA_RESULT_SUCCESS; |
303 } |
292 } |
304 else |
293 else |
305 { |
294 { |
306 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
295 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
307 DEBUG_API("<-XAMediaPlayerImpl_QueryNumSupportedInterfaces"); |
296 DEBUG_API("<-XAMediaPlayerImpl_QueryNumSupportedInterfaces"); |
308 return XA_RESULT_PARAMETER_INVALID; |
297 return XA_RESULT_PARAMETER_INVALID; |
309 } |
298 } |
310 } |
299 } |
311 |
300 |
312 /* XAResult XAMediaPlayerImpl_QuerySupportedInterfaces |
301 /* XAResult XAMediaPlayerImpl_QuerySupportedInterfaces |
313 * Statically query supported interfaces |
302 * Statically query supported interfaces |
314 */ |
303 */ |
315 XAresult XAMediaPlayerImpl_QuerySupportedInterfaces(XAuint32 index, |
304 XAresult XAMediaPlayerImpl_QuerySupportedInterfaces(XAuint32 index, |
316 XAInterfaceID * pInterfaceId) |
305 XAInterfaceID * pInterfaceId) |
317 { |
306 { |
318 DEBUG_API("->XAMediaPlayerImpl_QuerySupportedInterfaces"); |
307 DEBUG_API("->XAMediaPlayerImpl_QuerySupportedInterfaces"); |
319 |
308 |
320 if (index >= MP_ITFCOUNT || !pInterfaceId ) |
309 if (index >= MP_ITFCOUNT || !pInterfaceId) |
321 { |
310 { |
322 if(pInterfaceId) |
311 if (pInterfaceId) |
323 { |
312 { |
324 *pInterfaceId = XA_IID_NULL; |
313 *pInterfaceId = XA_IID_NULL; |
325 } |
314 }DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
326 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
315 DEBUG_API("<-XAMediaPlayerImpl_QuerySupportedInterfaces"); |
327 DEBUG_API("<-XAMediaPlayerImpl_QuerySupportedInterfaces"); |
|
328 return XA_RESULT_PARAMETER_INVALID; |
316 return XA_RESULT_PARAMETER_INVALID; |
329 } |
317 } |
330 else |
318 else |
331 { |
319 { |
332 *pInterfaceId = *(xaMediaPlayerItfIIDs[index]); |
320 *pInterfaceId = *(xaMediaPlayerItfIIDs[index]); |
333 DEBUG_API("<-XAMediaPlayerImpl_QuerySupportedInterfaces"); |
321 DEBUG_API("<-XAMediaPlayerImpl_QuerySupportedInterfaces"); |
334 return XA_RESULT_SUCCESS; |
322 return XA_RESULT_SUCCESS; |
335 } |
323 } |
336 } |
324 } |
337 |
325 |
338 /* |
326 /* |
339 * Realize the object |
327 * Realize the object |
340 */ |
328 */ |
341 XAresult XAMediaPlayerImpl_DoRealize(XAObjectItf self) |
329 XAresult XAMediaPlayerImpl_DoRealize(XAObjectItf self) |
342 { |
330 { |
343 XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self); |
331 XAObjectItfImpl* pObj = (XAObjectItfImpl*) (*self); |
344 XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*)(pObj); |
332 XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*) (pObj); |
345 XAuint8 itfIdx = 0; |
333 XAuint8 itfIdx = 0; |
346 void *pItf = NULL; |
334 void *pItf = NULL; |
347 XAresult ret = XA_RESULT_SUCCESS; |
335 XAresult ret = XA_RESULT_SUCCESS; |
348 |
336 |
349 DEBUG_API("->XAMediaPlayerImpl_DoRealize"); |
337 DEBUG_API("->XAMediaPlayerImpl_DoRealize"); |
350 XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer ); |
338 XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer ); |
351 |
339 |
352 /* check casting from correct pointer type */ |
340 /* check casting from correct pointer type */ |
353 if(!pImpl || pObj != pImpl->baseObj.self) |
341 if (!pImpl || pObj != pImpl->baseObj.self) |
354 { |
342 { |
355 /* invalid parameter */ |
343 /* invalid parameter */ |
356 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
344 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
357 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
345 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
358 DEBUG_API("<-XAMediaPlayerImpl_DoRealize"); |
346 DEBUG_API("<-XAMediaPlayerImpl_DoRealize"); |
359 return XA_RESULT_PARAMETER_INVALID; |
347 return XA_RESULT_PARAMETER_INVALID; |
360 } |
348 } |
361 |
349 |
362 /* Realize all implicit and explicitly wanted interfaces */ |
350 /* Realize all implicit and explicitly wanted interfaces */ |
363 for(itfIdx = 0; itfIdx < MP_ITFCOUNT; itfIdx++) |
351 for (itfIdx = 0; itfIdx < MP_ITFCOUNT; itfIdx++) |
364 { |
352 { |
365 if(!(pObj->interfaceMap[itfIdx].pItf) && pObj->interfaceMap[itfIdx].required) |
353 if (!(pObj->interfaceMap[itfIdx].pItf) |
366 { |
354 && pObj->interfaceMap[itfIdx].required) |
367 switch(itfIdx) |
355 { |
368 { |
356 switch (itfIdx) |
|
357 { |
369 case MP_DIMITF: |
358 case MP_DIMITF: |
370 pItf = XADIMItfImpl_Create(); |
359 pItf = XADIMItfImpl_Create(); |
371 if(pItf) |
360 if (pItf) |
372 { |
361 { |
373 XADIMItfImpl_Init(pItf, self, |
362 XADIMItfImpl_Init(pItf, self, |
374 XAMediaPlayerImpl_DoAddItf, |
363 XAMediaPlayerImpl_DoAddItf, |
375 XAMediaPlayerImpl_DoResumeItf, |
364 XAMediaPlayerImpl_DoResumeItf, |
376 XAMediaPlayerImpl_DoRemoveItf); |
365 XAMediaPlayerImpl_DoRemoveItf); |
377 } |
366 } |
378 break; |
367 break; |
379 case MP_PLAYITF: |
368 case MP_PLAYITF: |
380 pItf = XAPlayItfImpl_Create(pImpl); |
369 pItf = XAPlayItfImpl_Create(pImpl); |
381 if ( pImpl->dataSrc ) |
370 if (pImpl->dataSrc) |
382 { |
371 { |
383 XAuint32 locType = *((XAuint32*)(pImpl->dataSrc->pLocator)); |
372 XAuint32 locType = |
384 if ( locType == XA_DATALOCATOR_IODEVICE ) |
373 *((XAuint32*) (pImpl->dataSrc->pLocator)); |
385 { |
374 if (locType == XA_DATALOCATOR_IODEVICE) |
386 XADataLocator_IODevice *ioDevice = (XADataLocator_IODevice*)(pImpl->dataSrc->pLocator); |
375 { |
387 if ( ioDevice->deviceType == XA_IODEVICE_CAMERA) |
376 XADataLocator_IODevice |
388 { |
377 *ioDevice = |
389 vfHandle = (void*) pItf; |
378 (XADataLocator_IODevice*) (pImpl->dataSrc->pLocator); |
390 DEBUG_INFO_A1("Stored view finder pointer to global address %x", vfHandle); |
379 if (ioDevice->deviceType == XA_IODEVICE_CAMERA) |
391 } |
380 { |
392 } |
381 vfHandle = (void*) pItf; |
393 else |
382 DEBUG_INFO_A1("Stored view finder pointer to global address %x", vfHandle); |
394 { |
383 } |
395 |
384 } |
396 } |
385 else |
397 } |
386 { |
|
387 |
|
388 } |
|
389 } |
398 break; |
390 break; |
399 case MP_VOLUMEITF: |
391 case MP_VOLUMEITF: |
400 pItf = XAVolumeItfImpl_Create(pImpl->curAdaptCtx); |
392 pItf = XAVolumeItfImpl_Create(pImpl->curAdaptCtx); |
401 break; |
393 break; |
402 case MP_SEEKITF: |
394 case MP_SEEKITF: |
403 pItf = XASeekItfImpl_Create(pImpl); |
395 pItf = XASeekItfImpl_Create(pImpl); |
404 break; |
396 break; |
405 case MP_PREFETCHSTATUSITF: |
397 case MP_PREFETCHSTATUSITF: |
406 pItf = XAPrefetchStatusItfImpl_Create( pImpl ); |
398 pItf = XAPrefetchStatusItfImpl_Create(pImpl); |
407 break; |
399 break; |
408 case MP_METADATAEXTRACTIONITF: |
400 case MP_METADATAEXTRACTIONITF: |
409 pItf = XAMetadataExtractionItfImpl_Create( pImpl->curAdaptCtx ); |
401 pItf = XAMetadataExtractionItfImpl_Create( |
|
402 pImpl->curAdaptCtx); |
410 break; |
403 break; |
411 case MP_METADATATRAVERSALITF: |
404 case MP_METADATATRAVERSALITF: |
412 pItf = XAMetadataTraversalItfImpl_Create( pImpl->curAdaptCtx ); |
405 pItf = XAMetadataTraversalItfImpl_Create( |
|
406 pImpl->curAdaptCtx); |
413 break; |
407 break; |
414 case MP_PLAYBACKRATEITF: |
408 case MP_PLAYBACKRATEITF: |
415 pItf = XAPlaybackRateItfImpl_Create(pImpl); |
409 pItf = XAPlaybackRateItfImpl_Create(pImpl); |
416 break; |
410 break; |
417 case MP_CONFIGEXTENSIONITF: |
411 case MP_CONFIGEXTENSIONITF: |
418 pItf = XAConfigExtensionsItfImpl_Create(); |
412 pItf = XAConfigExtensionsItfImpl_Create(); |
419 XAConfigExtensionsItfImpl_SetContext( pItf, pImpl->curAdaptCtx); |
413 XAConfigExtensionsItfImpl_SetContext(pItf, |
|
414 pImpl->curAdaptCtx); |
420 break; |
415 break; |
421 case MP_DYNAMICSOURCEITF: |
416 case MP_DYNAMICSOURCEITF: |
422 pItf = XADynamicSourceItfImpl_Create(pImpl->curAdaptCtx); |
417 pItf = XADynamicSourceItfImpl_Create(pImpl->curAdaptCtx); |
423 break; |
418 break; |
424 case MP_EQUALIZERITF: |
419 case MP_EQUALIZERITF: |
425 pItf = XAEqualizerItfImpl_Create(pImpl->curAdaptCtx); |
420 pItf = XAEqualizerItfImpl_Create(pImpl->curAdaptCtx); |
426 break; |
421 break; |
427 #ifdef OMAX_CAMERABIN |
422 #ifdef OMAX_CAMERABIN |
428 case MP_IMAGECONTROLSITF: |
423 case MP_IMAGECONTROLSITF: |
429 pItf = XAImageControlsItfImpl_Create(pImpl->curAdaptCtx); |
424 pItf = XAImageControlsItfImpl_Create(pImpl->curAdaptCtx); |
430 break; |
425 break; |
431 case MP_IMAGEEFFECTSITF: |
426 case MP_IMAGEEFFECTSITF: |
432 pItf = XAImageEffectsItfImpl_Create(pImpl->curAdaptCtx); |
427 pItf = XAImageEffectsItfImpl_Create(pImpl->curAdaptCtx); |
433 break; |
428 break; |
434 case MP_VIDEOPOSTPROCESSINGITF: |
429 case MP_VIDEOPOSTPROCESSINGITF: |
435 pItf = XAVideoPostProcessingItfImpl_Create(pImpl->curAdaptCtx); |
430 pItf = XAVideoPostProcessingItfImpl_Create(pImpl->curAdaptCtx); |
436 break; |
431 break; |
437 #endif |
432 #endif |
438 case MP_NOKIAVOLUMEEXT: |
433 case MP_NOKIAVOLUMEEXT: |
439 pItf = XANokiaVolumeExtItfImpl_Create(pImpl->curAdaptCtx); |
434 pItf = XANokiaVolumeExtItfImpl_Create(pImpl->curAdaptCtx); |
440 break; |
435 break; |
441 case MP_NOKIALINEARVOLUME: |
436 case MP_NOKIALINEARVOLUME: |
442 pItf = XANokiaLinearVolumeItfImpl_Create(pImpl->curAdaptCtx); |
437 pItf = XANokiaLinearVolumeItfImpl_Create( |
443 break; |
438 pImpl->curAdaptCtx); |
|
439 break; |
444 case MP_STREAMINFORMATIONITF: |
440 case MP_STREAMINFORMATIONITF: |
445 pItf = XAStreamInformationItfImpl_Create(pImpl->curAdaptCtx); |
441 pItf = XAStreamInformationItfImpl_Create( |
446 break; |
442 pImpl->curAdaptCtx); |
|
443 break; |
447 default: |
444 default: |
448 break; |
445 break; |
449 } |
446 } |
450 if(!pItf) |
447 if (!pItf) |
451 { |
448 { |
452 /* Memory allocation failed */ |
449 /* Memory allocation failed */ |
453 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
450 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
454 DEBUG_ERR("XA_RESULT_MEMORY_FAILURE"); |
451 DEBUG_ERR("XA_RESULT_MEMORY_FAILURE"); |
455 DEBUG_API("<-XAMediaPlayerImpl_DoRealize"); |
452 DEBUG_API("<-XAMediaPlayerImpl_DoRealize"); |
456 return XA_RESULT_MEMORY_FAILURE; |
453 return XA_RESULT_MEMORY_FAILURE; |
457 } |
454 } |
458 else |
455 else |
459 { |
456 { |
460 pObj->interfaceMap[itfIdx].pItf = pItf; |
457 pObj->interfaceMap[itfIdx].pItf = pItf; |
461 } |
458 } |
462 } |
459 } |
463 } |
460 } |
464 /* init adaptation */ |
461 /* init adaptation */ |
465 if(pImpl->curAdaptCtx->fwtype == FWMgrFWMMF) |
462 if (pImpl->curAdaptCtx->fwtype == FWMgrFWMMF) |
466 { |
463 { |
467 ret = XAMediaPlayerAdaptMMF_PostInit( (XAAdaptationMMFCtx*)pImpl->adaptationCtxMMF ); |
464 ret = XAMediaPlayerAdaptMMF_PostInit( |
468 } |
465 (XAAdaptationMMFCtx*) pImpl->adaptationCtxMMF); |
|
466 } |
469 else |
467 else |
470 { |
468 { |
471 ret = XAMediaPlayerAdapt_PostInit( (XAAdaptationGstCtx*)pImpl->adaptationCtxGst ); |
469 ret = XAMediaPlayerAdapt_PostInit( |
472 } |
470 (XAAdaptationGstCtx*) pImpl->adaptationCtxGst); |
473 if ( ret != XA_RESULT_SUCCESS ) |
471 } |
474 { |
472 if (ret != XA_RESULT_SUCCESS) |
|
473 { |
475 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
474 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
476 DEBUG_ERR("Adaptation init failed!"); |
475 DEBUG_ERR("Adaptation init failed!"); |
477 DEBUG_API("<-XAMediaPlayerImpl_DoRealize"); |
476 DEBUG_API("<-XAMediaPlayerImpl_DoRealize"); |
478 return ret; |
477 return ret; |
479 } |
478 } |
480 |
479 |
481 pObj->state = XA_OBJECT_STATE_REALIZED; |
480 pObj->state = XA_OBJECT_STATE_REALIZED; |
482 |
481 |
483 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
482 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
484 DEBUG_API("<-XAMediaPlayerImpl_DoRealize"); |
483 DEBUG_API("<-XAMediaPlayerImpl_DoRealize"); |
485 return XA_RESULT_SUCCESS; |
484 return XA_RESULT_SUCCESS; |
486 } |
485 } |
487 |
486 |
488 /* |
487 /* |
489 * Resume object |
488 * Resume object |
490 */ |
489 */ |
491 XAresult XAMediaPlayerImpl_DoResume(XAObjectItf self) |
490 XAresult XAMediaPlayerImpl_DoResume(XAObjectItf self) |
492 { |
491 { |
493 DEBUG_API("->XAMediaPlayerImpl_DoResume"); |
492 DEBUG_API("->XAMediaPlayerImpl_DoResume"); |
494 DEBUG_API("<-XAMediaPlayerImpl_DoResume"); |
493 DEBUG_API("<-XAMediaPlayerImpl_DoResume"); |
495 /* suspended state not supported by this implementation */ |
494 /* suspended state not supported by this implementation */ |
496 return XA_RESULT_PRECONDITIONS_VIOLATED; |
495 return XA_RESULT_PRECONDITIONS_VIOLATED; |
497 } |
496 } |
498 |
497 |
499 /** |
498 /** |
500 * void XAMediaPlayerImpl_FreeResources(XAObjectItf self) |
499 * void XAMediaPlayerImpl_FreeResources(XAObjectItf self) |
501 * Description: Free all resources reserved at XAMediaPlayerImpl_DoRealize() |
500 * Description: Free all resources reserved at XAMediaPlayerImpl_DoRealize() |
502 **/ |
501 **/ |
503 void XAMediaPlayerImpl_FreeResources(XAObjectItf self) |
502 void XAMediaPlayerImpl_FreeResources(XAObjectItf self) |
504 { |
503 { |
505 XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self); |
504 XAObjectItfImpl* pObj = (XAObjectItfImpl*) (*self); |
506 XAuint8 itfIdx = 0; |
505 XAuint8 itfIdx = 0; |
507 XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*)pObj; |
506 XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*) pObj; |
508 DEBUG_API("->XAMediaPlayerImpl_FreeResources"); |
507 DEBUG_API("->XAMediaPlayerImpl_FreeResources"); |
509 XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS( XATSMediaPlayer ); |
508 XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS( XATSMediaPlayer ); |
510 |
509 |
511 assert(pObj && pImpl && pObj == pObj->self); |
510 assert(pObj && pImpl && pObj == pObj->self); |
512 for(itfIdx = 0; itfIdx < MP_ITFCOUNT; itfIdx++) |
511 for (itfIdx = 0; itfIdx < MP_ITFCOUNT; itfIdx++) |
513 { |
512 { |
514 void *pItf = pObj->interfaceMap[itfIdx].pItf; |
513 void *pItf = pObj->interfaceMap[itfIdx].pItf; |
515 if(pItf) |
514 if (pItf) |
516 { |
515 { |
517 switch(itfIdx) |
516 switch (itfIdx) |
518 { |
517 { |
519 case MP_DIMITF: |
518 case MP_DIMITF: |
520 XADIMItfImpl_Free(pItf); |
519 XADIMItfImpl_Free(pItf); |
521 break; |
520 break; |
522 case MP_PLAYITF: |
521 case MP_PLAYITF: |
523 XAPlayItfImpl_Free(pItf); |
522 XAPlayItfImpl_Free(pItf); |
548 break; |
547 break; |
549 case MP_EQUALIZERITF: |
548 case MP_EQUALIZERITF: |
550 XAEqualizerItfImpl_Free(pItf); |
549 XAEqualizerItfImpl_Free(pItf); |
551 break; |
550 break; |
552 #ifdef OMAX_CAMERABIN |
551 #ifdef OMAX_CAMERABIN |
553 case MP_IMAGECONTROLSITF: |
552 case MP_IMAGECONTROLSITF: |
554 XAImageControlsItfImpl_Free(pItf); |
553 XAImageControlsItfImpl_Free(pItf); |
555 break; |
554 break; |
556 case MP_IMAGEEFFECTSITF: |
555 case MP_IMAGEEFFECTSITF: |
557 XAImageEffectsItfImpl_Free(pItf); |
556 XAImageEffectsItfImpl_Free(pItf); |
558 break; |
557 break; |
559 case MP_VIDEOPOSTPROCESSINGITF: |
558 case MP_VIDEOPOSTPROCESSINGITF: |
560 XAVideoPostProcessingItfImpl_Free(pItf); |
559 XAVideoPostProcessingItfImpl_Free(pItf); |
561 break; |
560 break; |
562 #endif |
561 #endif |
563 case MP_NOKIAVOLUMEEXT: |
562 case MP_NOKIAVOLUMEEXT: |
564 XANokiaVolumeExtItfImpl_Free(pItf); |
563 XANokiaVolumeExtItfImpl_Free(pItf); |
565 break; |
564 break; |
566 case MP_NOKIALINEARVOLUME: |
565 case MP_NOKIALINEARVOLUME: |
567 XANokiaLinearVolumeItfImpl_Free(pItf); |
566 XANokiaLinearVolumeItfImpl_Free(pItf); |
568 break; |
567 break; |
569 case MP_STREAMINFORMATIONITF: |
568 case MP_STREAMINFORMATIONITF: |
570 XAStreamInformationItfImpl_Free(pItf); |
569 XAStreamInformationItfImpl_Free(pItf); |
571 break; |
570 break; |
572 |
571 |
573 } |
572 } |
574 pObj->interfaceMap[itfIdx].pItf = NULL; |
573 pObj->interfaceMap[itfIdx].pItf = NULL; |
575 } |
574 } |
576 } |
575 } |
577 |
576 |
578 if(pImpl->curAdaptCtx) |
577 if (pImpl->curAdaptCtx) |
579 { |
578 { |
580 if(pImpl->curAdaptCtx->fwtype == FWMgrFWMMF) |
579 if (pImpl->curAdaptCtx->fwtype == FWMgrFWMMF) |
581 { |
580 { |
582 XAMediaPlayerAdaptMMF_Destroy( (XAAdaptationMMFCtx*)pImpl->adaptationCtxMMF ); |
581 XAMediaPlayerAdaptMMF_Destroy( |
|
582 (XAAdaptationMMFCtx*) pImpl->adaptationCtxMMF); |
583 } |
583 } |
584 else |
584 else |
585 { |
585 { |
586 XAMediaPlayerAdapt_Destroy( (XAAdaptationGstCtx*)pImpl->adaptationCtxGst ); |
586 XAMediaPlayerAdapt_Destroy( |
|
587 (XAAdaptationGstCtx*) pImpl->adaptationCtxGst); |
587 } |
588 } |
588 } |
589 } |
589 |
590 |
590 XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( XATSMediaPlayer ); |
591 XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( XATSMediaPlayer ); |
591 DEBUG_API("<-XAMediaPlayerImpl_FreeResources"); |
592 DEBUG_API("<-XAMediaPlayerImpl_FreeResources"); |
592 return; |
593 return; |
593 } |
594 } |
594 |
595 |
595 /* XAMediaPlayerImpl_DoAddItf |
596 /* XAMediaPlayerImpl_DoAddItf |
596 * Dynamically add an interface, object specific parts |
597 * Dynamically add an interface, object specific parts |
597 */ |
598 */ |
598 XAresult XAMediaPlayerImpl_DoAddItf(XAObjectItf self, XAObjItfMapEntry *mapEntry ) |
599 XAresult XAMediaPlayerImpl_DoAddItf(XAObjectItf self, |
599 { |
600 XAObjItfMapEntry *mapEntry) |
600 |
601 { |
601 XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self); |
602 |
602 XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*)(pObj); |
603 XAObjectItfImpl* pObj = (XAObjectItfImpl*) (*self); |
|
604 XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*) (pObj); |
603 |
605 |
604 XAresult ret = XA_RESULT_SUCCESS; |
606 XAresult ret = XA_RESULT_SUCCESS; |
605 DEBUG_API("->XAMediaPlayerImpl_DoAddItf"); |
607 DEBUG_API("->XAMediaPlayerImpl_DoAddItf"); |
606 |
608 |
607 if(mapEntry) |
609 if (mapEntry) |
608 { |
610 { |
609 switch( mapEntry->mapIdx ) |
611 switch (mapEntry->mapIdx) |
610 { |
612 { |
611 |
613 |
612 case MP_METADATAEXTRACTIONITF: |
614 case MP_METADATAEXTRACTIONITF: |
613 mapEntry->pItf = XAMetadataExtractionItfImpl_Create( pImpl->curAdaptCtx ); |
615 mapEntry->pItf = XAMetadataExtractionItfImpl_Create( |
|
616 pImpl->curAdaptCtx); |
614 break; |
617 break; |
615 case MP_METADATATRAVERSALITF: |
618 case MP_METADATATRAVERSALITF: |
616 mapEntry->pItf = XAMetadataTraversalItfImpl_Create( pImpl->curAdaptCtx ); |
619 mapEntry->pItf = XAMetadataTraversalItfImpl_Create( |
|
620 pImpl->curAdaptCtx); |
617 break; |
621 break; |
618 case MP_PLAYBACKRATEITF: |
622 case MP_PLAYBACKRATEITF: |
619 mapEntry->pItf = XAPlaybackRateItfImpl_Create(pImpl); |
623 mapEntry->pItf = XAPlaybackRateItfImpl_Create(pImpl); |
620 break; |
624 break; |
621 case MP_EQUALIZERITF: |
625 case MP_EQUALIZERITF: |
622 mapEntry->pItf = XAEqualizerItfImpl_Create( pImpl->curAdaptCtx ); |
626 mapEntry->pItf |
|
627 = XAEqualizerItfImpl_Create(pImpl->curAdaptCtx); |
623 break; |
628 break; |
624 #ifdef OMAX_CAMERABIN |
629 #ifdef OMAX_CAMERABIN |
625 case MP_IMAGEEFFECTSITF: |
630 case MP_IMAGEEFFECTSITF: |
626 mapEntry->pItf = XAImageEffectsItfImpl_Create( pImpl->curAdaptCtx ); |
631 mapEntry->pItf = XAImageEffectsItfImpl_Create( pImpl->curAdaptCtx ); |
627 break; |
632 break; |
628 #endif |
633 #endif |
629 default: |
634 default: |
630 DEBUG_ERR("XAMediaPlayerImpl_DoAddItf unknown id"); |
635 DEBUG_ERR("XAMediaPlayerImpl_DoAddItf unknown id") |
|
636 ; |
631 ret = XA_RESULT_FEATURE_UNSUPPORTED; |
637 ret = XA_RESULT_FEATURE_UNSUPPORTED; |
632 break; |
638 break; |
633 } |
639 } |
634 |
640 |
635 if( !mapEntry->pItf && ret == XA_RESULT_SUCCESS) |
641 if (!mapEntry->pItf && ret == XA_RESULT_SUCCESS) |
636 { |
642 { |
637 DEBUG_ERR("XAMediaPlayerImpl_DoAddItf itf creation failed"); |
643 DEBUG_ERR("XAMediaPlayerImpl_DoAddItf itf creation failed"); |
638 ret = XA_RESULT_MEMORY_FAILURE; |
644 ret = XA_RESULT_MEMORY_FAILURE; |
639 } |
645 } |
640 } |
646 } |
641 else |
647 else |
642 { |
648 { |
643 ret = XA_RESULT_PARAMETER_INVALID; |
649 ret = XA_RESULT_PARAMETER_INVALID; |
644 } |
650 } |
645 |
651 |
646 DEBUG_API("<-XAMediaPlayerImpl_DoAddItf"); |
652 DEBUG_API("<-XAMediaPlayerImpl_DoAddItf"); |
647 return ret; |
653 return ret; |
648 } |
654 } |
649 |
655 |
650 /* XAMediaPlayerImpl_DoResumeItf |
656 /* XAMediaPlayerImpl_DoResumeItf |
651 * Try to resume lost interface, object specific parts |
657 * Try to resume lost interface, object specific parts |
652 */ |
658 */ |
653 XAresult XAMediaPlayerImpl_DoResumeItf(XAObjectItf self, XAObjItfMapEntry *mapEntry ) |
659 XAresult XAMediaPlayerImpl_DoResumeItf(XAObjectItf self, |
654 { |
660 XAObjItfMapEntry *mapEntry) |
|
661 { |
655 /* For now, no difference between suspended and unrealised itfs */ |
662 /* For now, no difference between suspended and unrealised itfs */ |
656 XAresult ret = XA_RESULT_SUCCESS; |
663 XAresult ret = XA_RESULT_SUCCESS; |
657 DEBUG_API("->XAMediaPlayerImpl_DoResumeItf"); |
664 DEBUG_API("->XAMediaPlayerImpl_DoResumeItf"); |
658 ret = XAMediaPlayerImpl_DoAddItf(self,mapEntry); |
665 ret = XAMediaPlayerImpl_DoAddItf(self, mapEntry); |
659 DEBUG_API("<-XAMediaPlayerImpl_DoResumeItf"); |
666 DEBUG_API("<-XAMediaPlayerImpl_DoResumeItf"); |
660 return ret; |
667 return ret; |
661 } |
668 } |
662 |
669 |
663 /* XAMediaPlayerImpl_DoRemoveItf |
670 /* XAMediaPlayerImpl_DoRemoveItf |
664 * Dynamically remove an interface, object specific parts |
671 * Dynamically remove an interface, object specific parts |
665 */ |
672 */ |
666 XAresult XAMediaPlayerImpl_DoRemoveItf(XAObjectItf self, XAObjItfMapEntry *mapEntry ) |
673 XAresult XAMediaPlayerImpl_DoRemoveItf(XAObjectItf self, |
667 { |
674 XAObjItfMapEntry *mapEntry) |
|
675 { |
668 XAresult ret = XA_RESULT_SUCCESS; |
676 XAresult ret = XA_RESULT_SUCCESS; |
669 DEBUG_API("->XAMediaPlayerImpl_DoRemoveItf"); |
677 DEBUG_API("->XAMediaPlayerImpl_DoRemoveItf"); |
670 |
678 |
671 if(mapEntry) |
679 if (mapEntry) |
672 { |
680 { |
673 switch( mapEntry->mapIdx ) |
681 switch (mapEntry->mapIdx) |
674 { |
682 { |
675 case MP_METADATAEXTRACTIONITF: |
683 case MP_METADATAEXTRACTIONITF: |
676 XAMetadataExtractionItfImpl_Free(mapEntry->pItf); |
684 XAMetadataExtractionItfImpl_Free(mapEntry->pItf); |
677 break; |
685 break; |
678 case MP_METADATATRAVERSALITF: |
686 case MP_METADATATRAVERSALITF: |
679 XAMetadataTraversalItfImpl_Free(mapEntry->pItf); |
687 XAMetadataTraversalItfImpl_Free(mapEntry->pItf); |