khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.c
author hgs
Fri, 28 May 2010 19:26:28 -0500
changeset 21 2ed61feeead6
parent 19 4a629bc82c5e
child 25 6f7ceef7b1d1
permissions -rw-r--r--
201021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description: 
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include <assert.h>
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include <stdlib.h>
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "xamediaplayeradaptctxmmf.h"
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include "xaadaptationmmf.h"
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include "xaobjectitf.h"
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include "cmmfbackendengine.h"
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
19
hgs
parents: 12
diff changeset
    25
#include "cmetadatautilityitf.h"
hgs
parents: 12
diff changeset
    26
hgs
parents: 12
diff changeset
    27
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
/*
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
 * XAMediaPlayerAdaptationMMFCtx* XAMediaPlayerAdapt_Create()
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
 * Allocates memory for Media Player Adaptation Context and makes 1st phase initialization
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
 * @param XADataSource *pDataSrc - pointer to OMX-AL data source
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
 * @param XADataSource *pBankSrc - pointer to instrument bank structure in Mobile DLS, if NULL default will be used.
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
 * @param XADataSink *pAudioSnk - pointer to OMX-AL audio sink definition
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
 * @param XADataSink *pImageVideoSnk - pointer to OMX-AL image and video sink definition
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
 * @returns XAMediaPlayerAdaptationMMFCtx* - Pointer to created context, NULL if error occurs.
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
 */
19
hgs
parents: 12
diff changeset
    38
XAAdaptationBaseCtx* XAMediaPlayerAdaptMMF_Create(XADataSource *pDataSrc, XADataSource *pBankSrc,
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
                                                      XADataSink *pAudioSnk, XADataSink *pImageVideoSnk,
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
                                                      XADataSink *pVibra, XADataSink *pLEDArray)
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
{
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
    XAMediaPlayerAdaptationMMFCtx *pSelf = NULL;
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
    XAuint32 locType = 0;
21
hgs
parents: 19
diff changeset
    44
    XADataLocator_IODevice *ioDevice;         
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
    XAresult res;
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
    DEBUG_API("->XAMediaPlayerAdaptMMF_Create");
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
    
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
    pSelf = calloc(1, sizeof(XAMediaPlayerAdaptationMMFCtx));
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
    if ( pSelf)
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
    {
21
hgs
parents: 19
diff changeset
    51
    	if ( pDataSrc )
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
			{
21
hgs
parents: 19
diff changeset
    53
				locType = *((XAuint32*)(pDataSrc->pLocator));
hgs
parents: 19
diff changeset
    54
				if ( locType == XA_DATALOCATOR_IODEVICE  )
hgs
parents: 19
diff changeset
    55
				{
hgs
parents: 19
diff changeset
    56
					ioDevice = (XADataLocator_IODevice*)(pDataSrc->pLocator);
hgs
parents: 19
diff changeset
    57
					if ( ioDevice->deviceType == XA_IODEVICE_RADIO )
hgs
parents: 19
diff changeset
    58
					{
hgs
parents: 19
diff changeset
    59
						return XAMediaPlayerAdaptMMF_CreateRadio(pSelf, pDataSrc, pBankSrc, pAudioSnk, pImageVideoSnk, pVibra, pLEDArray);
hgs
parents: 19
diff changeset
    60
					}
hgs
parents: 19
diff changeset
    61
				}    	
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
		}
21
hgs
parents: 19
diff changeset
    63
    if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),XAMediaPlayerAdaptation) != XA_RESULT_SUCCESS )
hgs
parents: 19
diff changeset
    64
    {
hgs
parents: 19
diff changeset
    65
      DEBUG_ERR("Failed to init base context!!!");
hgs
parents: 19
diff changeset
    66
       free(pSelf);
hgs
parents: 19
diff changeset
    67
       pSelf = NULL;
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
    }
21
hgs
parents: 19
diff changeset
    69
    else            
19
hgs
parents: 12
diff changeset
    70
    {
21
hgs
parents: 19
diff changeset
    71
    		pSelf->isForRadio = XA_BOOLEAN_FALSE;
hgs
parents: 19
diff changeset
    72
      	pSelf->baseObj.baseObj.fwtype = FWMgrFWMMF;
hgs
parents: 19
diff changeset
    73
        pSelf->xaSource = pDataSrc;
hgs
parents: 19
diff changeset
    74
        pSelf->xaBankSrc = pBankSrc;
hgs
parents: 19
diff changeset
    75
        pSelf->xaAudioSink = pAudioSnk;
hgs
parents: 19
diff changeset
    76
        pSelf->xaVideoSink = pImageVideoSnk;
hgs
parents: 19
diff changeset
    77
        pSelf->xaLEDArray = pLEDArray;
hgs
parents: 19
diff changeset
    78
        pSelf->xaVibra = pVibra;
hgs
parents: 19
diff changeset
    79
        pSelf->curMirror = XA_VIDEOMIRROR_NONE;
hgs
parents: 19
diff changeset
    80
        pSelf->curRotation = 0;
hgs
parents: 19
diff changeset
    81
        pSelf->isobjsrc = XA_BOOLEAN_FALSE;
hgs
parents: 19
diff changeset
    82
        pSelf->cameraSinkSynced = XA_BOOLEAN_FALSE;
hgs
parents: 19
diff changeset
    83
        /*pSelf->waitData = XA_BOOLEAN_FALSE;*/
hgs
parents: 19
diff changeset
    84
		}
hgs
parents: 19
diff changeset
    85
	}
hgs
parents: 19
diff changeset
    86
 	else
hgs
parents: 19
diff changeset
    87
 	{
hgs
parents: 19
diff changeset
    88
		DEBUG_ERR("Failed to create XAMediaPlayerAdaptationMMFCtx !!!");
hgs
parents: 19
diff changeset
    89
		return NULL;
hgs
parents: 19
diff changeset
    90
 	}
hgs
parents: 19
diff changeset
    91
 	if(pSelf)
hgs
parents: 19
diff changeset
    92
 	{
hgs
parents: 19
diff changeset
    93
		res = mmf_backend_engine_init(&(pSelf->mmfContext));
hgs
parents: 19
diff changeset
    94
   	if(!(pSelf->mmfContext) || (res != XA_RESULT_SUCCESS))
hgs
parents: 19
diff changeset
    95
   	{
hgs
parents: 19
diff changeset
    96
    	/* TODO Check to make sure there is no undeleted MMF objects here*/
hgs
parents: 19
diff changeset
    97
     	DEBUG_ERR("Failed to init mmf context!!!");
hgs
parents: 19
diff changeset
    98
     	free(pSelf);
hgs
parents: 19
diff changeset
    99
    	pSelf = NULL;
hgs
parents: 19
diff changeset
   100
    	return NULL;
hgs
parents: 19
diff changeset
   101
  	}
19
hgs
parents: 12
diff changeset
   102
		res = mmf_set_play_adapt_context(pSelf->mmfContext, &(pSelf->baseObj));
hgs
parents: 12
diff changeset
   103
		if(pDataSrc)
hgs
parents: 12
diff changeset
   104
		    {
hgs
parents: 12
diff changeset
   105
             pSelf->mmfMetadataContext = mmf_metadata_utility_init((char *)(( (XADataLocator_URI*)(pDataSrc->pLocator))->URI));
hgs
parents: 12
diff changeset
   106
             if(!pSelf->mmfMetadataContext)
hgs
parents: 12
diff changeset
   107
                {
hgs
parents: 12
diff changeset
   108
                    DEBUG_ERR("Failed to init mmf metadata context!!!");
hgs
parents: 12
diff changeset
   109
                    pSelf->mmfMetadataContext = NULL;			
hgs
parents: 12
diff changeset
   110
                }
hgs
parents: 12
diff changeset
   111
		    }
hgs
parents: 12
diff changeset
   112
		else
hgs
parents: 12
diff changeset
   113
        	{
hgs
parents: 12
diff changeset
   114
        	DEBUG_ERR("Failed to create XAMediaPlayerAdaptationMMFCtx !!!");
hgs
parents: 12
diff changeset
   115
        	return NULL;
hgs
parents: 12
diff changeset
   116
        	}	
hgs
parents: 12
diff changeset
   117
    }
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
    DEBUG_API("<-XAMediaPlayerAdaptMMF_Create");
19
hgs
parents: 12
diff changeset
   120
    return (XAAdaptationBaseCtx*)(&pSelf->baseObj.baseObj);
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
}
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
21
hgs
parents: 19
diff changeset
   123
/*
hgs
parents: 19
diff changeset
   124
 * XAMediaPlayerAdaptationMMFCtx* XAMediaPlayerAdapt_CreateRadio()
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
21
hgs
parents: 19
diff changeset
   126
 * @returns XAMediaPlayerAdaptationMMFCtx* - Pointer to created context, NULL if error occurs.
hgs
parents: 19
diff changeset
   127
 */
hgs
parents: 19
diff changeset
   128
XAAdaptationBaseCtx* XAMediaPlayerAdaptMMF_CreateRadio(XAMediaPlayerAdaptationMMFCtx *pSelf, XADataSource *pDataSrc, XADataSource *pBankSrc,
hgs
parents: 19
diff changeset
   129
                                                      XADataSink *pAudioSnk, XADataSink *pImageVideoSnk,
hgs
parents: 19
diff changeset
   130
                                                      XADataSink *pVibra, XADataSink *pLEDArray)
hgs
parents: 19
diff changeset
   131
{
hgs
parents: 19
diff changeset
   132
    XAresult res;
hgs
parents: 19
diff changeset
   133
    DEBUG_API("->XAMediaPlayerAdaptMMF_CreateRadio");
hgs
parents: 19
diff changeset
   134
    
hgs
parents: 19
diff changeset
   135
		res =  XAAdaptationBaseMMF_Init(&(pSelf->baseObj), XARadioAdaptation); 
hgs
parents: 19
diff changeset
   136
		if (res != XA_RESULT_SUCCESS) 	
hgs
parents: 19
diff changeset
   137
   	{
hgs
parents: 19
diff changeset
   138
    	DEBUG_ERR("Failed to init base context!!!");
hgs
parents: 19
diff changeset
   139
      free(pSelf);
hgs
parents: 19
diff changeset
   140
      pSelf = NULL;
hgs
parents: 19
diff changeset
   141
      return NULL;
hgs
parents: 19
diff changeset
   142
    }
hgs
parents: 19
diff changeset
   143
hgs
parents: 19
diff changeset
   144
   	pSelf->isForRadio = XA_BOOLEAN_TRUE;
hgs
parents: 19
diff changeset
   145
  	pSelf->baseObj.baseObj.fwtype = FWMgrFWMMF;
hgs
parents: 19
diff changeset
   146
    pSelf->xaSource = pDataSrc;
hgs
parents: 19
diff changeset
   147
    pSelf->xaBankSrc = pBankSrc;
hgs
parents: 19
diff changeset
   148
    pSelf->xaAudioSink = pAudioSnk;
hgs
parents: 19
diff changeset
   149
    pSelf->xaVideoSink = pImageVideoSnk;
hgs
parents: 19
diff changeset
   150
    pSelf->xaLEDArray = pLEDArray;
hgs
parents: 19
diff changeset
   151
    pSelf->xaVibra = pVibra;
hgs
parents: 19
diff changeset
   152
    pSelf->curMirror = XA_VIDEOMIRROR_NONE;
hgs
parents: 19
diff changeset
   153
    pSelf->curRotation = 0;
hgs
parents: 19
diff changeset
   154
    pSelf->isobjsrc = XA_BOOLEAN_FALSE;
hgs
parents: 19
diff changeset
   155
    pSelf->cameraSinkSynced = XA_BOOLEAN_FALSE;
hgs
parents: 19
diff changeset
   156
    /*pSelf->waitData = XA_BOOLEAN_FALSE;*/
hgs
parents: 19
diff changeset
   157
hgs
parents: 19
diff changeset
   158
		res = mmf_backend_engine_init(&(pSelf->mmfContext));
hgs
parents: 19
diff changeset
   159
   	if(!(pSelf->mmfContext) || (res != XA_RESULT_SUCCESS))
hgs
parents: 19
diff changeset
   160
   	{
hgs
parents: 19
diff changeset
   161
    	/* TODO Check to make sure there is no undeleted MMF objects here*/
hgs
parents: 19
diff changeset
   162
    	DEBUG_ERR("Failed to init mmf context!!!");
hgs
parents: 19
diff changeset
   163
   		free(pSelf);
hgs
parents: 19
diff changeset
   164
     	pSelf = NULL;
hgs
parents: 19
diff changeset
   165
    	return NULL;
hgs
parents: 19
diff changeset
   166
    }
hgs
parents: 19
diff changeset
   167
    DEBUG_API("<-XAMediaPlayerAdaptMMF_Create");
hgs
parents: 19
diff changeset
   168
    return (XAAdaptationBaseCtx*)(&pSelf->baseObj.baseObj);
hgs
parents: 19
diff changeset
   169
}
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
/*
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
 * XAresult XAMediaPlayerAdaptMMF_PostInit()
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
 * 2nd phase initialization of Media Player Adaptation Context
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
 * @param XAMediaPlayerAdaptationMMFCtx* ctx - pointer to Media Player adaptation context
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
 * @return XAresult - Success value
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
 */
19
hgs
parents: 12
diff changeset
   177
XAresult XAMediaPlayerAdaptMMF_PostInit( XAAdaptationMMFCtx* bCtx )
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
{
19
hgs
parents: 12
diff changeset
   179
    XAresult ret = XA_RESULT_PRECONDITIONS_VIOLATED;
hgs
parents: 12
diff changeset
   180
    XAMediaPlayerAdaptationMMFCtx *pSelf = (XAMediaPlayerAdaptationMMFCtx*)bCtx;
hgs
parents: 12
diff changeset
   181
hgs
parents: 12
diff changeset
   182
    DEBUG_API("->XAMediaPlayerAdaptMMF_PostInit");
hgs
parents: 12
diff changeset
   183
    
hgs
parents: 12
diff changeset
   184
    XAAdaptationBaseMMF_PostInit(bCtx);
hgs
parents: 12
diff changeset
   185
    
21
hgs
parents: 19
diff changeset
   186
    if (pSelf->isForRadio)
hgs
parents: 19
diff changeset
   187
    {
hgs
parents: 19
diff changeset
   188
     DEBUG_API("<-XAMediaPlayerAdaptMMF_PostInit");   
hgs
parents: 19
diff changeset
   189
     return XA_RESULT_SUCCESS;	
hgs
parents: 19
diff changeset
   190
    }    
hgs
parents: 19
diff changeset
   191
    
19
hgs
parents: 12
diff changeset
   192
    if(pSelf->mmfContext)
hgs
parents: 12
diff changeset
   193
    {
hgs
parents: 12
diff changeset
   194
        XADataLocator_URI* tempUri = (XADataLocator_URI*)(pSelf->xaSource->pLocator);
hgs
parents: 12
diff changeset
   195
        XADataFormat_MIME* tempFormat = (XADataFormat_MIME*)(pSelf->xaSource->pFormat);
hgs
parents: 12
diff changeset
   196
        ret = XA_RESULT_SUCCESS;
hgs
parents: 12
diff changeset
   197
        if(pSelf->xaVideoSink)
hgs
parents: 12
diff changeset
   198
          {
hgs
parents: 12
diff changeset
   199
          ret = mmf_setup_native_display(pSelf->mmfContext, pSelf->xaVideoSink);
hgs
parents: 12
diff changeset
   200
          }
hgs
parents: 12
diff changeset
   201
        if (ret == XA_RESULT_SUCCESS)
hgs
parents: 12
diff changeset
   202
        {
hgs
parents: 12
diff changeset
   203
            ret = mmf_set_player_uri(pSelf->mmfContext, (char *)(tempUri->URI), tempFormat->containerType);
hgs
parents: 12
diff changeset
   204
        }
hgs
parents: 12
diff changeset
   205
    }
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
    DEBUG_API("<-XAMediaPlayerAdaptMMF_PostInit");
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
    return ret;
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
}
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
/*
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
 * void XAMediaPlayerAdaptMMF_Destroy( XAMediaPlayerAdaptationMMFCtx* ctx )
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
 * Destroys Media Player Adaptation Context
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
 * @param ctx - Media Player Adaptation context to be destroyed
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
 */
19
hgs
parents: 12
diff changeset
   215
void XAMediaPlayerAdaptMMF_Destroy( XAAdaptationMMFCtx* bCtx )
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
{
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
    XAMediaPlayerAdaptationMMFCtx* ctx = NULL;
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
    
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
    DEBUG_API("->XAMediaPlayerAdaptMMF_Destroy");
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
    if(bCtx == NULL)
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
    {
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
        DEBUG_ERR("Invalid parameter!!");
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
        DEBUG_API("<-XAMediaPlayerAdaptMMF_Destroy");
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
        return;
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
    }
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
    ctx = (XAMediaPlayerAdaptationMMFCtx*)bCtx;
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
19
hgs
parents: 12
diff changeset
   229
    if(ctx->mmfContext)
hgs
parents: 12
diff changeset
   230
        {
hgs
parents: 12
diff changeset
   231
        mmf_backend_engine_deinit(ctx->mmfContext);
hgs
parents: 12
diff changeset
   232
        }
hgs
parents: 12
diff changeset
   233
hgs
parents: 12
diff changeset
   234
	if(ctx->mmfMetadataContext)
hgs
parents: 12
diff changeset
   235
	{
hgs
parents: 12
diff changeset
   236
		mmf_metadata_utility_destroy(ctx->mmfMetadataContext);		
hgs
parents: 12
diff changeset
   237
	}
hgs
parents: 12
diff changeset
   238
	
hgs
parents: 12
diff changeset
   239
    XAAdaptationBaseMMF_Free( bCtx );
hgs
parents: 12
diff changeset
   240
    
12
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
    free(ctx);
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
    ctx = NULL;
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
    DEBUG_API("<-XAMediaPlayerAdaptMMF_Destroy");
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
}
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
5a06f39ad45b Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247