mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectcallbacks.cpp
changeset 16 43d09473c595
parent 14 80975da52420
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
    17 
    17 
    18 // [INCLUDE FILES] - do not remove
    18 // [INCLUDE FILES] - do not remove
    19 #include <e32svr.h>
    19 #include <e32svr.h>
    20 #include <StifParser.h>
    20 #include <StifParser.h>
    21 #include <StifTestInterface.h>
    21 #include <StifTestInterface.h>
       
    22 #include <StifTestEventInterface.h>
    22 #include "openmaxaltestmodule.h"
    23 #include "openmaxaltestmodule.h"
    23 
    24 
    24 // EXTERNAL DATA STRUCTURES
    25 // EXTERNAL DATA STRUCTURES
    25 //extern  ?external_data;
    26 //extern  ?external_data;
    26 
    27 
    48         XAuint32 event,
    49         XAuint32 event,
    49         XAresult result,
    50         XAresult result,
    50         XAuint32 param,
    51         XAuint32 param,
    51         void * pInterface);
    52         void * pInterface);
    52 
    53 
    53 void MediaRecorderCallback(XAObjectItf caller,
       
    54         const void * pContext,
       
    55         XAuint32 event,
       
    56         XAresult result,
       
    57         XAuint32 param,
       
    58         void * pInterface);
       
    59 // FORWARD DECLARATIONS
    54 // FORWARD DECLARATIONS
    60 //class ?FORWARD_CLASSNAME;
    55 //class ?FORWARD_CLASSNAME;
    61 
    56 
    62 // ============================= LOCAL FUNCTIONS ===============================
    57 // ============================= LOCAL FUNCTIONS ===============================
    63 
    58 
    89         {
    84         {
    90         case EEngine:
    85         case EEngine:
    91             func = ObjectCallback;
    86             func = ObjectCallback;
    92             break;
    87             break;
    93         case EMediaRecorder:
    88         case EMediaRecorder:
    94             func = MediaRecorderCallback;
    89             func = ObjectCallback;
       
    90             break;
       
    91         case EMediaPlayer:
       
    92             func = ObjectCallback;
    95             break;
    93             break;
    96         default:
    94         default:
    97             func = NULL;
    95             func = NULL;
    98             break;
    96             break;
    99         }
    97         }
   100     return func;
    98     return func;
   101     
    99     
   102     }
   100     }
   103 
   101 
       
   102 void COpenMAXALTestModule::HandleObjectCallback(XAObjectItf caller,XAuint32 event,
       
   103                         XAresult result,XAuint32 param, void * pInterface)
       
   104     {
       
   105     switch(event)
       
   106         {
       
   107         case XA_OBJECT_EVENT_RUNTIME_ERROR:
       
   108             {
       
   109             TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_RUNTIME_ERROR") );
       
   110             TestModuleIf().Event( event );
       
   111             }
       
   112             break;
       
   113         case XA_OBJECT_EVENT_ASYNC_TERMINATION:
       
   114             {
       
   115             TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_ASYNC_TERMINATION") );
       
   116             TestModuleIf().Event( event );
       
   117             }
       
   118             break;
       
   119         case XA_OBJECT_EVENT_RESOURCES_LOST:
       
   120             {
       
   121             TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_RESOURCES_LOST") );
       
   122             TestModuleIf().Event( event );
       
   123             }
       
   124             break;
       
   125         case XA_OBJECT_EVENT_RESOURCES_AVAILABLE:
       
   126             {
       
   127             TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_RESOURCES_AVAILABLE") );
       
   128             TestModuleIf().Event( event );
       
   129             }
       
   130             break;
       
   131         case XA_OBJECT_EVENT_ITF_CONTROL_TAKEN:
       
   132             {
       
   133             TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_ITF_CONTROL_TAKEN") );
       
   134             TestModuleIf().Event( event );
       
   135             }
       
   136             break;
       
   137         case XA_OBJECT_EVENT_ITF_CONTROL_RETURNED:
       
   138             {
       
   139             TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_ITF_CONTROL_RETURNED") );
       
   140             TestModuleIf().Event( event );
       
   141             }
       
   142             break;
       
   143         case XA_OBJECT_EVENT_ITF_PARAMETERS_CHANGED:
       
   144             {
       
   145             TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_ITF_PARAMETERS_CHANGED") );
       
   146             TestModuleIf().Event( event );
       
   147 
       
   148             }
       
   149             break;
       
   150         default:
       
   151             break;
       
   152         }
       
   153     }
   104 
   154 
   105 void ObjectCallback(XAObjectItf caller,
   155 void ObjectCallback(XAObjectItf caller,
   106         const void * pContext,
   156         const void * pContext,
   107         XAuint32 event,
   157         XAuint32 event,
   108         XAresult result,
   158         XAresult result,
   109         XAuint32 param,
   159         XAuint32 param,
   110         void * pInterface)
   160         void * pInterface)
   111     {
   161     {
   112     
   162     if (pContext)
       
   163         {
       
   164         ((COpenMAXALTestModule*)pContext)->HandleObjectCallback(caller, event, result, param, pInterface);
       
   165         }
   113     }
   166     }
   114 
   167 
   115 void MediaRecorderCallback(XAObjectItf caller,
       
   116         const void * pContext,
       
   117         XAuint32 event,
       
   118         XAresult result,
       
   119         XAuint32 param,
       
   120         void * pInterface)
       
   121     {
       
   122     
       
   123     }
       
   124