OsclReturnCode EventHandlerThreadSafeCallbackAOEnc::ProcessEvent(OsclAny* EventData) { // In this case, ProcessEvent calls the method of the primary test AO to process the Event if (iObserver != NULL) { PVMFOMXEncNode* ptr = (PVMFOMXEncNode*) iObserver; if (ptr->IsAdded()) { ptr->ProcessCallbackEventHandler_MultiThreaded(EventData); } } return OsclSuccess; }
OsclReturnCode EventHandlerThreadSafeCallbackAOEnc::ProcessEvent(OsclAny* EventData) { // Note: this method executes in the context of threadsafe AO (in the node thread) // In this case, ProcessEvent calls the method of the primary test AO to process the Event if (iObserver != NULL) { PVMFOMXEncNode* ptr = (PVMFOMXEncNode*) iObserver; if (ptr->IsAdded()) { // call the node method that processes the callback EventHandlerSpecificData* ED = (EventHandlerSpecificData*) EventData; OMX_HANDLETYPE aComponent = ED->hComponent; OMX_PTR aAppData = ED->pAppData; OMX_EVENTTYPE aEvent = ED->eEvent; OMX_U32 aData1 = ED->nData1; OMX_U32 aData2 = ED->nData2; OMX_PTR aEventData = ED->pEventData; ptr->EventHandlerProcessing(aComponent, aAppData, aEvent, aData1, aData2, aEventData); } } // release the memory back to the mempool after processing the event iMemoryPool->deallocate(EventData); // Signal the semaphore that controls the remote thread. // The remote thread might be blocked and waiting for an event to be processed in case the event queue is full // Note: by signaling the semaphore AFTER releasing the memory back to the mempool, there is no // need to allocate more mempool items than the queue depth. OsclProcStatus::eOsclProcError sema_status; sema_status = RemoteThreadCtrlSema.Signal(); if (sema_status != OsclProcStatus::SUCCESS_ERROR) { return OsclFailure; } return OsclSuccess; }