25
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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".
|
19
|
8 |
*
|
25
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: StreamInfo Itf Adaptation MMF
|
|
15 |
*
|
|
16 |
*/
|
19
|
17 |
|
|
18 |
#include "xadebug.h"
|
|
19 |
#include "xathreadsafety.h"
|
|
20 |
#include "xamediaplayeradaptctxmmf.h"
|
|
21 |
#include "xastreaminformationitfadaptationmmf.h"
|
|
22 |
#include "xaplayitfadaptationmmf.h"
|
|
23 |
#include "cmmfbackendengine.h"
|
|
24 |
/*
|
|
25 |
* XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation(
|
|
26 |
* XAAdaptationBaseCtx *adaptCtx,
|
|
27 |
* XAMediaContainerInformation *info);
|
|
28 |
* Description: Obtains media container information
|
|
29 |
*/
|
25
|
30 |
XAresult XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation(
|
|
31 |
XAAdaptationBaseCtx *adaptCtx, XAuint32 *containerType,
|
|
32 |
XAmillisecond *mediaDuration, XAuint32 *numStreams)
|
|
33 |
{
|
19
|
34 |
XAresult ret = XA_RESULT_SUCCESS;
|
|
35 |
XADataSource *xaDataSource = NULL;
|
|
36 |
|
|
37 |
DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation");
|
|
38 |
/* Both Media Player and Metadata Extractor objec uses the same ctxId */
|
25
|
39 |
if (!adaptCtx || (adaptCtx->ctxId != XAMediaPlayerAdaptation))
|
|
40 |
{
|
|
41 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation");
|
19
|
42 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
43 |
}
|
19
|
44 |
|
|
45 |
/* Initialize to unspecified */
|
|
46 |
*containerType = XA_CONTAINERTYPE_UNSPECIFIED;
|
|
47 |
xaDataSource = ((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->xaSource;
|
25
|
48 |
/* DEBUG_INFO("Obtained handle to xaDataSource");*/
|
|
49 |
if (xaDataSource && xaDataSource->pFormat
|
|
50 |
&& ((*(XAuint32*) xaDataSource->pFormat) == XA_DATAFORMAT_MIME))
|
|
51 |
{
|
|
52 |
*containerType
|
|
53 |
= ((XADataFormat_MIME*) (xaDataSource->pFormat))->containerType;
|
19
|
54 |
DEBUG_INFO_A1("Container type obtained from xaDataSource->pFormat is [%u]", (unsigned int)(*containerType));
|
25
|
55 |
}
|
19
|
56 |
else
|
25
|
57 |
{
|
19
|
58 |
DEBUG_INFO("Container type unspecified");
|
25
|
59 |
}
|
19
|
60 |
|
|
61 |
/* Get media duration */
|
|
62 |
ret = XAPlayItfAdaptMMF_GetDuration(adaptCtx, mediaDuration);
|
25
|
63 |
if (ret != XA_RESULT_SUCCESS)
|
|
64 |
{
|
19
|
65 |
return ret;
|
25
|
66 |
}
|
19
|
67 |
|
25
|
68 |
ret = mmf_streaminformationitf_get_numstreams(
|
|
69 |
((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->mmfContext,
|
|
70 |
numStreams);
|
19
|
71 |
|
|
72 |
DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation");
|
|
73 |
return ret;
|
25
|
74 |
}
|
19
|
75 |
|
|
76 |
/*
|
|
77 |
* XAresult XAStreamInformationItfAdaptMMF_QueryStreamType(
|
|
78 |
* XAAdaptationBaseCtx *adaptCtx,
|
|
79 |
* XAuint32 streamIndex,
|
|
80 |
* XAuint32 *domain)
|
|
81 |
* Description: Obtains stream type information
|
|
82 |
*/
|
|
83 |
XAresult XAStreamInformationItfAdaptMMF_QueryStreamType(
|
25
|
84 |
XAAdaptationBaseCtx *adaptCtx, XAuint32 streamIndex, XAuint32 *domain)
|
|
85 |
{
|
19
|
86 |
XAresult ret;
|
|
87 |
XAuint32 numStreams;
|
|
88 |
XADataSource *xaDataSource = NULL;
|
|
89 |
|
25
|
90 |
if (!adaptCtx || !domain)
|
|
91 |
{
|
|
92 |
ret = XA_RESULT_PARAMETER_INVALID;
|
|
93 |
return ret;
|
|
94 |
}
|
19
|
95 |
|
|
96 |
DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryStreamType");
|
|
97 |
|
25
|
98 |
ret = mmf_streaminformationitf_get_numstreams(
|
|
99 |
((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->mmfContext,
|
|
100 |
&numStreams);
|
19
|
101 |
if (ret != XA_RESULT_SUCCESS)
|
25
|
102 |
{
|
|
103 |
DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamType");
|
19
|
104 |
return ret;
|
25
|
105 |
}
|
19
|
106 |
|
|
107 |
/* validate stream index */
|
25
|
108 |
if (streamIndex > numStreams)
|
|
109 |
{
|
|
110 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamType");
|
19
|
111 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
112 |
}
|
19
|
113 |
|
|
114 |
/* if format type is raw image */
|
|
115 |
xaDataSource = ((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->xaSource;
|
25
|
116 |
if (xaDataSource && xaDataSource->pFormat
|
|
117 |
&& ((*(XAuint32*) xaDataSource->pFormat)
|
|
118 |
== XA_DATAFORMAT_RAWIMAGE))
|
|
119 |
{
|
19
|
120 |
*domain = XA_DOMAINTYPE_IMAGE;
|
|
121 |
return XA_RESULT_SUCCESS;
|
25
|
122 |
}
|
19
|
123 |
else
|
25
|
124 |
{
|
|
125 |
ret = mmf_streaminformationitf_get_streaminfo(
|
|
126 |
((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->mmfContext,
|
|
127 |
streamIndex, domain);
|
|
128 |
}
|
19
|
129 |
|
|
130 |
DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamType");
|
|
131 |
return ret;
|
25
|
132 |
}
|
19
|
133 |
|
|
134 |
/*
|
|
135 |
* XAresult XAStreamInformationItfAdaptMMF_QueryStreamInformation(
|
|
136 |
* XAAdaptationBaseCtx *adaptCtx,
|
|
137 |
* XAuint32 streamIndex,
|
|
138 |
* void * info)
|
|
139 |
* Description: Obtains stream information
|
|
140 |
*/
|
|
141 |
XAresult XAStreamInformationItfAdaptMMF_QueryStreamInformation(
|
25
|
142 |
XAAdaptationBaseCtx *adaptCtx, XAuint32 streamIndex, void * info)
|
|
143 |
{
|
19
|
144 |
XAresult ret = XA_RESULT_SUCCESS;
|
|
145 |
XAuint32 domain;
|
|
146 |
XAuint32 codecId;
|
|
147 |
XAuint32 channels;
|
|
148 |
XAmilliHertz sampleRate;
|
|
149 |
XAuint32 bitRate;
|
|
150 |
XAmillisecond duration;
|
|
151 |
XAuint32 width;
|
|
152 |
XAuint32 height;
|
|
153 |
XAuint32 frameRate;
|
|
154 |
void* mmfctx;
|
25
|
155 |
|
|
156 |
if (!adaptCtx || !info)
|
|
157 |
{
|
|
158 |
ret = XA_RESULT_PARAMETER_INVALID;
|
|
159 |
return ret;
|
|
160 |
}
|
|
161 |
|
|
162 |
mmfctx = ((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->mmfContext;
|
19
|
163 |
|
|
164 |
DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryStreamInformation");
|
|
165 |
|
|
166 |
/* stream index is validated in XAStreamInformationItfAdaptMMF_QueryStreamType */
|
25
|
167 |
ret = XAStreamInformationItfAdaptMMF_QueryStreamType(adaptCtx,
|
|
168 |
streamIndex, &domain);
|
19
|
169 |
|
|
170 |
if (ret != XA_RESULT_SUCCESS)
|
25
|
171 |
{
|
19
|
172 |
DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);
|
|
173 |
DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamInformation");
|
|
174 |
return ret;
|
25
|
175 |
}
|
19
|
176 |
|
25
|
177 |
switch (domain)
|
|
178 |
{
|
19
|
179 |
case XA_DOMAINTYPE_AUDIO:
|
|
180 |
DEBUG_INFO("Getting Audio Stream Info from Backend Engine");
|
|
181 |
ret = mmf_get_channels(mmfctx, &channels);
|
|
182 |
ret = mmf_get_samplerate(mmfctx, &sampleRate);
|
|
183 |
ret = mmf_get_bitrate(mmfctx, &bitRate);
|
|
184 |
ret = mmf_get_codec_id(mmfctx, &codecId);
|
|
185 |
break;
|
|
186 |
case XA_DOMAINTYPE_VIDEO:
|
|
187 |
DEBUG_INFO("Getting Video Stream Info from Backend Engine");
|
|
188 |
ret = mmf_get_bitrate(mmfctx, &bitRate);
|
25
|
189 |
ret = mmf_get_codec_id(mmfctx, &codecId);
|
|
190 |
ret = mmf_streaminformationitf_get_videoframesize(mmfctx,
|
|
191 |
&height, &width, &frameRate);
|
19
|
192 |
break;
|
|
193 |
case XA_DOMAINTYPE_IMAGE:
|
|
194 |
DEBUG_INFO("Getting Image Stream Info from SrcPad");
|
|
195 |
break;
|
|
196 |
default:
|
25
|
197 |
DEBUG_ERR("XA_RESULT_CONTENT_UNSUPPORTED");
|
|
198 |
DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamInformation");
|
|
199 |
ret = XA_RESULT_CONTENT_UNSUPPORTED;
|
19
|
200 |
break;
|
25
|
201 |
};
|
19
|
202 |
|
25
|
203 |
if (ret == XA_RESULT_SUCCESS)
|
|
204 |
{
|
19
|
205 |
DEBUG_INFO("Getting media duration");
|
|
206 |
ret = XAPlayItfAdaptMMF_GetDuration(adaptCtx, &duration);
|
25
|
207 |
}
|
19
|
208 |
|
|
209 |
/* Now assign properties to data structure */
|
25
|
210 |
if (ret == XA_RESULT_SUCCESS)
|
19
|
211 |
{
|
25
|
212 |
switch (domain)
|
19
|
213 |
{
|
25
|
214 |
case XA_DOMAINTYPE_AUDIO:
|
|
215 |
{
|
|
216 |
XAAudioStreamInformation* streamInfo =
|
|
217 |
(XAAudioStreamInformation*) info;
|
19
|
218 |
DEBUG_INFO("Assigning values for XAAudioStreamInformation");
|
|
219 |
streamInfo->codecId = codecId;
|
|
220 |
streamInfo->channels = channels;
|
|
221 |
streamInfo->sampleRate = sampleRate;
|
|
222 |
streamInfo->bitRate = bitRate;
|
|
223 |
streamInfo->langCountry[0] = '\0';
|
|
224 |
streamInfo->duration = duration;
|
25
|
225 |
}
|
19
|
226 |
break;
|
|
227 |
case XA_DOMAINTYPE_MIDI:
|
25
|
228 |
{
|
|
229 |
XAMIDIStreamInformation* streamInfo =
|
|
230 |
(XAMIDIStreamInformation*) info;
|
19
|
231 |
DEBUG_INFO("Assigning values for XAMIDIStreamInformation");
|
|
232 |
/*currently there is no way to get these information from gstreamer*/
|
|
233 |
streamInfo->channels = XA_MIDI_UNKNOWN;
|
|
234 |
streamInfo->tracks = XA_MIDI_UNKNOWN;
|
|
235 |
streamInfo->bankType = XA_MIDIBANK_DEVICE;
|
|
236 |
/*streamInfo->bitRate = 0;*/
|
|
237 |
streamInfo->langCountry[0] = '\0';
|
|
238 |
streamInfo->duration = duration;
|
25
|
239 |
}
|
19
|
240 |
break;
|
|
241 |
case XA_DOMAINTYPE_VIDEO:
|
25
|
242 |
{
|
|
243 |
XAVideoStreamInformation* streamInfo =
|
|
244 |
(XAVideoStreamInformation*) info;
|
19
|
245 |
DEBUG_INFO("Assigning values for XAVideoStreamInformation");
|
|
246 |
streamInfo->codecId = codecId;
|
|
247 |
streamInfo->width = width;
|
|
248 |
streamInfo->height = height;
|
|
249 |
streamInfo->bitRate = bitRate;
|
|
250 |
streamInfo->duration = duration;
|
|
251 |
streamInfo->frameRate = frameRate;
|
25
|
252 |
}
|
19
|
253 |
break;
|
|
254 |
case XA_DOMAINTYPE_IMAGE:
|
25
|
255 |
{
|
|
256 |
XAImageStreamInformation* streamInfo =
|
|
257 |
(XAImageStreamInformation*) info;
|
19
|
258 |
DEBUG_INFO("Assigning values for XAImageStreamInformation");
|
|
259 |
streamInfo->codecId = codecId;
|
|
260 |
streamInfo->width = width;
|
|
261 |
streamInfo->height = height;
|
|
262 |
streamInfo->presentationDuration = duration;
|
25
|
263 |
}
|
19
|
264 |
break;
|
|
265 |
default:
|
|
266 |
break;
|
25
|
267 |
};
|
|
268 |
} /*if ( ret == XA_RESULT_SUCCESS)*/
|
19
|
269 |
|
|
270 |
DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamInformation");
|
|
271 |
return ret;
|
25
|
272 |
}
|
19
|
273 |
|
|
274 |
/*
|
|
275 |
* XAresult XAStreamInformationItfAdaptMMF_QueryStreamName(
|
|
276 |
* XAAdaptationBaseCtx *adaptCtx,
|
|
277 |
* XAuint32 streamIndex,
|
|
278 |
* XAuint16 * pNameSize,
|
|
279 |
* XAchar * pName)
|
|
280 |
* Description: Obtains stream name
|
|
281 |
*/
|
|
282 |
XAresult XAStreamInformationItfAdaptMMF_QueryStreamName(
|
25
|
283 |
XAAdaptationBaseCtx *adaptCtx, XAuint32 streamIndex,
|
|
284 |
XAuint16 * pNameSize, XAchar * pName)
|
|
285 |
{
|
19
|
286 |
XAresult ret = XA_RESULT_SUCCESS;
|
|
287 |
XAuint32 numStreams;
|
|
288 |
|
|
289 |
DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryStreamName");
|
|
290 |
/* Both Media Player and Metadata Extractor objec uses the same ctxId */
|
25
|
291 |
if (!adaptCtx || !pNameSize || (adaptCtx->ctxId
|
|
292 |
!= XAMediaPlayerAdaptation))
|
|
293 |
{
|
|
294 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamName");
|
19
|
295 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
296 |
}
|
19
|
297 |
|
|
298 |
/* validate stream index */
|
25
|
299 |
ret = mmf_streaminformationitf_get_numstreams(
|
|
300 |
((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->mmfContext,
|
|
301 |
&numStreams);
|
19
|
302 |
if (ret != XA_RESULT_SUCCESS)
|
25
|
303 |
{
|
|
304 |
DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamName");
|
19
|
305 |
return ret;
|
25
|
306 |
}
|
19
|
307 |
|
|
308 |
/* validate stream index */
|
25
|
309 |
if (streamIndex > numStreams)
|
|
310 |
{
|
|
311 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamName");
|
19
|
312 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
313 |
}
|
19
|
314 |
|
|
315 |
/* TODO there is no straight way to retreive stream name from mmf*/
|
|
316 |
/*XAuint16 inputNameSize = *pNameSize;*/
|
|
317 |
*pNameSize = 0; /* Replace this with actual size*/
|
25
|
318 |
if (pName)
|
|
319 |
{
|
|
320 |
/* TODO copy stream name into pName taking into account inputNameSize */
|
|
321 |
}
|
19
|
322 |
|
|
323 |
DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamName");
|
|
324 |
return ret;
|
25
|
325 |
}
|
19
|
326 |
|
|
327 |
/*
|
|
328 |
* XAresult XAStreamInformationItfAdaptMMF_QueryActiveStreams(
|
|
329 |
* XAAdaptationBaseCtx *adaptCtx,
|
|
330 |
* XAuint32 *numStreams,
|
|
331 |
* XAboolean *activeStreams);
|
|
332 |
* Description: Obtains active stream information
|
|
333 |
*/
|
25
|
334 |
XAresult XAStreamInformationItfAdaptMMF_QueryActiveStreams(
|
|
335 |
XAAdaptationBaseCtx *adaptCtx, XAuint32 *numStreams,
|
|
336 |
XAboolean *activeStreams)
|
|
337 |
{
|
19
|
338 |
XAresult ret = XA_RESULT_SUCCESS;
|
|
339 |
XAuint32 inputNumStreams;
|
|
340 |
|
|
341 |
DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryActiveStreams");
|
|
342 |
|
|
343 |
/* Both Media Player and Metadata Extractor objec uses the same ctxId */
|
25
|
344 |
if (!adaptCtx || !numStreams || (adaptCtx->ctxId
|
|
345 |
!= XAMediaPlayerAdaptation))
|
|
346 |
{
|
|
347 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
|
19
|
348 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
349 |
}
|
19
|
350 |
|
25
|
351 |
if (adaptCtx->ctxId == XAMDAdaptation)
|
|
352 |
{
|
|
353 |
DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
|
19
|
354 |
return XA_RESULT_PRECONDITIONS_VIOLATED;
|
25
|
355 |
}
|
19
|
356 |
|
|
357 |
/* Determine number of streams */
|
25
|
358 |
ret = mmf_streaminformationitf_get_numstreams(
|
|
359 |
((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->mmfContext,
|
|
360 |
&inputNumStreams);
|
19
|
361 |
if (ret != XA_RESULT_SUCCESS)
|
25
|
362 |
{
|
|
363 |
DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
|
19
|
364 |
return ret;
|
25
|
365 |
}
|
19
|
366 |
|
25
|
367 |
if (activeStreams)
|
|
368 |
{
|
19
|
369 |
XAuint32 loopIndex;
|
|
370 |
if (*numStreams < inputNumStreams)
|
25
|
371 |
{
|
|
372 |
DEBUG_INFO("numStreams param value is smaller than number of streams");DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
|
19
|
373 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
374 |
}
|
19
|
375 |
for (loopIndex = 0; loopIndex < inputNumStreams; loopIndex++)
|
25
|
376 |
{
|
19
|
377 |
/* TODO currently gstreamer doesn't allow multiple dynamic streams
|
|
378 |
* all streams are active streams */
|
|
379 |
activeStreams[loopIndex] = XA_BOOLEAN_TRUE;
|
25
|
380 |
}
|
19
|
381 |
}
|
|
382 |
else
|
|
383 |
{
|
|
384 |
*numStreams = inputNumStreams;
|
|
385 |
}
|
|
386 |
|
|
387 |
DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryActiveStreams");
|
|
388 |
return XA_RESULT_SUCCESS;
|
25
|
389 |
}
|
19
|
390 |
|
|
391 |
XAresult XAStreamInformationItfAdaptMMF_SetActiveStream(
|
25
|
392 |
XAAdaptationBaseCtx *adaptCtx, XAuint32 streamNum, XAboolean active,
|
|
393 |
XAboolean commitNow)
|
|
394 |
{
|
19
|
395 |
XAresult ret = XA_RESULT_SUCCESS;
|
|
396 |
XAuint32 numStreams;
|
|
397 |
|
|
398 |
DEBUG_API("->XAStreamInformationItfAdaptMMF_SetActiveStream");
|
|
399 |
|
|
400 |
/* Both Media Player and Metadata Extractor objec uses the same ctxId */
|
25
|
401 |
if (!adaptCtx || (adaptCtx->ctxId != XAMediaPlayerAdaptation))
|
|
402 |
{
|
|
403 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("-<XAStreamInformationItfAdaptMMF_SetActiveStream");
|
19
|
404 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
405 |
}
|
19
|
406 |
|
25
|
407 |
if (adaptCtx->ctxId == XAMDAdaptation)
|
|
408 |
{
|
|
409 |
DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");DEBUG_API("-<XAStreamInformationItfAdaptMMF_SetActiveStream");
|
19
|
410 |
return XA_RESULT_PRECONDITIONS_VIOLATED;
|
25
|
411 |
}
|
19
|
412 |
|
|
413 |
/* Determine number of streams */
|
25
|
414 |
ret = mmf_streaminformationitf_get_numstreams(
|
|
415 |
((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->mmfContext,
|
|
416 |
&numStreams);
|
19
|
417 |
if (ret != XA_RESULT_SUCCESS)
|
25
|
418 |
{
|
|
419 |
DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
|
19
|
420 |
return ret;
|
25
|
421 |
}
|
19
|
422 |
|
|
423 |
/* validate stream index */
|
25
|
424 |
if (streamNum > numStreams)
|
|
425 |
{
|
|
426 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("-<XAStreamInformationItfAdaptMMF_SetActiveStream");
|
19
|
427 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
428 |
}
|
19
|
429 |
|
25
|
430 |
if (commitNow)
|
19
|
431 |
{
|
25
|
432 |
ret = mmf_streaminformationitf_set_activestream(
|
|
433 |
((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->mmfContext,
|
|
434 |
streamNum, active);
|
19
|
435 |
}
|
|
436 |
|
|
437 |
DEBUG_API("->XAStreamInformationItfAdaptMMF_SetActiveStream");
|
|
438 |
return ret;
|
25
|
439 |
}
|
19
|
440 |
|