Update contrib.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 #include <e32msgqueue.h>
18 #include <mmf/server/mmfdatabuffer.h>
19 #include "omxcomponentbody.h"
20 #include "omxcomponentimpl.h"
22 const TInt KMaxMsgQueueEntries = 10;
23 const TInt KMaxComponentNameLength = 256;
25 const TInt KSymbianErrors[] =
27 KErrNoMemory, /*OMX_ErrorInsufficientResources*/
31 KErrGeneral, /*OMX_ErrorInvalidComponent*/
32 KErrArgument, /*OMX_ErrorBadParameter*/
33 KErrNotSupported, /*OMX_ErrorNotImplemented*/
34 KErrUnderflow, /*OMX_ErrorUnderflow*/
35 KErrOverflow, /*OMX_ErrorOverflow*/
36 KErrHardwareNotAvailable, /* OMX_ErrorHardware*/
37 KErrGeneral, /*OMX_ErrorInvalidState*/
38 KErrCorrupt, /*OMX_ErrorStreamCorrupt*/
39 KErrArgument, /*OMX_ErrorPortsNotCompatible*/
40 KErrHardwareNotAvailable, /*OMX_ErrorResourcesLost*/
41 KErrCompletion, /*OMX_ErrorNoMore*/
42 KErrGeneral, /*OMX_ErrorVersionMismatch*/
43 KErrNotReady, /*OMX_ErrorNotReady*/
44 KErrTimedOut, /*OMX_ErrorTimeout*/
45 KErrNone /*OMX_ErrorSameState*/
49 Converts an OpenMAX error code to a Symbian error code.
50 @param aErrorType The OpenMAX error code.
51 @return The Symbian error code.
53 TInt ConvertOmxErrorType(OMX_ERRORTYPE aErrorType)
55 if (aErrorType == OMX_ErrorNone)
59 else if (aErrorType >= OMX_ErrorInsufficientResources &&
60 aErrorType <= OMX_ErrorSameState)
62 return KSymbianErrors[aErrorType - OMX_ErrorInsufficientResources];
71 Converts a Symbian error code to an OpenMAX error code.
72 @param aError The Symbian error code.
73 @return The OpenMAX error code.
75 OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError)
77 OMX_ERRORTYPE err = OMX_ErrorNone;
84 err = OMX_ErrorInsufficientResources;
89 err = OMX_ErrorUndefined;
95 COmxBufferManager::COmxBufferManager(OMX_COMPONENTTYPE* aHandle)
100 COmxBufferManager::COmxBuffer::COmxBuffer()
105 COmxBufferManager::COmxBuffer* COmxBufferManager::COmxBuffer::NewL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer)
107 COmxBuffer* self = new (ELeave) COmxBuffer;
108 CleanupStack::PushL(self);
109 self->ConstructL(aBufferHeader, aBuffer);
110 CleanupStack::Pop(self);
114 COmxBufferManager::COmxBuffer::~COmxBuffer()
123 CMMFBuffer* COmxBufferManager::COmxBuffer::MmfBuffer() const
128 OMX_BUFFERHEADERTYPE* COmxBufferManager::COmxBuffer::BufferHeader() const
130 return iBufferHeader;
134 MOmxInputPortCallbacks* COmxBufferManager::COmxBuffer::InputPortCallbacks() const
136 return iInputPortCallbacks;
139 MOmxOutputPortCallbacks* COmxBufferManager::COmxBuffer::OutputPortCallbacks() const
141 return iOutputPortCallbacks;
144 void COmxBufferManager::COmxBuffer::SetInputPortCallbacks(MOmxInputPortCallbacks* aCallbacks)
146 iInputPortCallbacks = aCallbacks;
149 void COmxBufferManager::COmxBuffer::SetOutputPortCallbacks(MOmxOutputPortCallbacks* aCallbacks)
151 iOutputPortCallbacks = aCallbacks;
154 // look up the corresponding buffer
155 COmxBufferManager::COmxBuffer* COmxBufferManager::FindBuffer(const CMMFBuffer* aBuffer) const
157 COmxBuffer* buffer = NULL;
158 for (TInt i=0;i<iBuffers.Count() && !buffer;i++)
160 if (iBuffers[i]->MmfBuffer() == aBuffer)
162 buffer = iBuffers[i];
168 COmxBufferManager::COmxBuffer* COmxBufferManager::FindBuffer(OMX_BUFFERHEADERTYPE* aBuffer) const
170 return reinterpret_cast<COmxBuffer*>(aBuffer->pAppPrivate);
175 TInt COmxBufferManager::UseBuffer(CMMFBuffer& aBuffer, TUint aPortIndex)
177 if (CMMFBuffer::IsSupportedDataBuffer(aBuffer.Type()))
179 OMX_BUFFERHEADERTYPE* buffer;
180 CMMFDataBuffer& dataBuffer = static_cast<CMMFDataBuffer&>(aBuffer);
182 TDes8& aBufferDes = dataBuffer.Data();
183 OMX_ERRORTYPE error = iHandle->UseBuffer(static_cast<OMX_HANDLETYPE>(iHandle), &buffer, aPortIndex, (void*)&aBuffer, aBufferDes.MaxLength(), const_cast<TUint8*>(aBufferDes.Ptr()));
184 if (error != OMX_ErrorNone)
186 return ConvertOmxErrorType(error);
188 TRAPD(err, StoreBufferL(buffer, &aBuffer));
193 return KErrNotSupported;
198 CMMFBuffer* COmxBufferManager::AllocateBufferL(TUint aPortIndex, TUint aSizeBytes)
200 OMX_BUFFERHEADERTYPE* buffer;
201 OMX_ERRORTYPE error = iHandle->AllocateBuffer(static_cast<OMX_HANDLETYPE>(iHandle), &buffer, aPortIndex, NULL, aSizeBytes);
202 User::LeaveIfError(ConvertOmxErrorType(error));
204 StoreBufferL(buffer,NULL); // transfers ownership
206 // return the newly created buffer
207 return FindBuffer(buffer)->MmfBuffer();
211 TInt COmxBufferManager::FreeBuffer(CMMFBuffer* aBuffer)
214 for (TInt i=0;i<iBuffers.Count();i++)
216 buffer = iBuffers[i];
217 if (buffer->MmfBuffer() == aBuffer)
220 OMX_ERRORTYPE err = iHandle->FreeBuffer(static_cast<OMX_HANDLETYPE>(iHandle), 0, buffer->BufferHeader());
228 void COmxBufferManager::COmxBuffer::ConstructL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer)
231 // Now if CMMFBuffer is NULL, this is been called from allocate buffer, and we need to
232 // Allocate a ptr buffer to correspond to the buffer created by OMX
233 ASSERT(aBufferHeader);
234 iBufferHeader = aBufferHeader;
237 TPtr8 ptr(iBufferHeader->pBuffer, iBufferHeader->nFilledLen, iBufferHeader->nAllocLen);
238 CMMFBuffer* mmfBuffer = CMMFPtrBuffer::NewL(ptr);
239 iMmfBuffer = mmfBuffer;
240 iOwnsMmfBuffer = ETrue;
244 iMmfBuffer = aBuffer;
247 // store pointer to element in array
248 iBufferHeader->pAppPrivate = this;
253 // Store OMX buffer pointer
254 void COmxBufferManager::StoreBufferL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer)
256 COmxBuffer* buf = COmxBuffer::NewL(aBufferHeader, aBuffer);
257 CleanupStack::PushL(buf);
258 iBuffers.AppendL(buf);
259 CleanupStack::Pop(buf);
263 TInt COmxBufferManager::EmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxInputPortCallbacks* aObserver)
265 if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
267 COmxBuffer* omxBuffer = FindBuffer(aBuffer);
273 omxBuffer->SetInputPortCallbacks(aObserver);
274 OMX_BUFFERHEADERTYPE* bufferHeader = omxBuffer->BufferHeader();
275 const CMMFDataBuffer* buf = static_cast<const CMMFDataBuffer*>(aBuffer);
276 const TDesC8& des = buf->Data();
277 bufferHeader->nFilledLen = des.Length();
278 bufferHeader->nFlags = 0;
279 if (aBuffer->LastBuffer())
281 bufferHeader->nFlags |= OMX_BUFFERFLAG_EOS;
285 bufferHeader->nFlags &= ~OMX_BUFFERFLAG_EOS;
287 return ConvertOmxErrorType(iHandle->EmptyThisBuffer(static_cast<OMX_HANDLETYPE>(iHandle), bufferHeader));
291 return KErrNotSupported;
296 TInt COmxBufferManager::FillThisBuffer(CMMFBuffer* aBuffer, MOmxOutputPortCallbacks* aObserver)
298 if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
300 COmxBuffer* omxBuffer = FindBuffer(aBuffer);
305 omxBuffer->SetOutputPortCallbacks(aObserver);
306 OMX_BUFFERHEADERTYPE* bufferHeader = omxBuffer->BufferHeader();
308 bufferHeader->nFilledLen = 0;
309 // clear last buffer flag
310 bufferHeader->nFlags &= ~OMX_BUFFERFLAG_EOS;
311 return ConvertOmxErrorType(iHandle->FillThisBuffer(static_cast<OMX_HANDLETYPE>(iHandle), bufferHeader));
315 return KErrNotSupported;
321 COmxBufferManager::~COmxBufferManager()
323 for (TInt i=0;i<iBuffers.Count();i++)
325 COmxBuffer* omxBuffer = iBuffers[i];
326 iHandle->FreeBuffer(static_cast<OMX_HANDLETYPE>(iHandle), 0, omxBuffer->BufferHeader());
332 // Implementation of the Class COmxComponent
336 COmxCallbacks* COmxCallbacks::NewL(MOmxPuCallbacks& aPuCallbacks)
338 COmxCallbacks* self = new (ELeave) COmxCallbacks(aPuCallbacks);
339 CleanupStack::PushL(self);
341 CleanupStack::Pop(self);
346 void COmxCallbacks::ConstructL()
356 CActiveScheduler::Add(this);
358 User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries));
359 iMsgQueue.NotifyDataAvailable(iStatus);
363 COmxCallbacks::COmxCallbacks(MOmxPuCallbacks& aPuCallbacks)
364 : CActive(EPriorityNormal),
365 iPuCallbacks(&aPuCallbacks)
370 COmxCallbacks::operator OMX_CALLBACKTYPE*()
376 void COmxCallbacks::RunL()
379 while (iMsgQueue.Receive(msg)==KErrNone)
383 case EEmptyBufferCallback:
385 MOmxInputPortCallbacks* callback = msg.iBuffer->InputPortCallbacks();
386 const CMMFBuffer* buffer = msg.iBuffer->MmfBuffer();
387 callback->EmptyBufferDone(msg.iComponent, buffer);
391 case EFillBufferCallback:
393 CMMFBuffer* mmfBuffer = msg.iBuffer->MmfBuffer();
394 OMX_BUFFERHEADERTYPE* bufferHeader = msg.iBuffer->BufferHeader();
396 if (CMMFBuffer::IsSupportedDataBuffer(mmfBuffer->Type()))
398 CMMFDataBuffer* dataBuffer = static_cast<CMMFDataBuffer*>(mmfBuffer);
399 TDes8& aBufferDes = dataBuffer->Data();
400 aBufferDes.SetLength(bufferHeader->nFilledLen);
401 mmfBuffer->SetLastBuffer(bufferHeader->nFlags & OMX_BUFFERFLAG_EOS);
407 MOmxOutputPortCallbacks* callback = msg.iBuffer->OutputPortCallbacks();
408 callback->FillBufferDone(msg.iComponent, mmfBuffer);
413 iPuCallbacks->MopcEventHandler(msg.iComponent,
414 msg.iEventParams.iEvent,
415 msg.iEventParams.iData1,
416 msg.iEventParams.iData2,
417 msg.iEventParams.iExtra);
422 // This is an invalid state
428 // setup for next callbacks
429 iStatus = KRequestPending;
430 iMsgQueue.NotifyDataAvailable(iStatus);
434 COmxCallbacks::~COmxCallbacks()
441 void COmxCallbacks::DoCancel()
443 if (iMsgQueue.Handle()!=NULL)
445 iMsgQueue.CancelDataAvailable();
449 TInt COmxCallbacks::FillBufferDone(OMX_HANDLETYPE aComponent, COmxBufferManager::COmxBuffer* aBuffer)
452 message.iType = EFillBufferCallback;
453 message.iComponent = aComponent;
454 message.iBuffer = aBuffer;
455 return iMsgQueue.Send(message);
458 TInt COmxCallbacks::EmptyBufferDone(OMX_HANDLETYPE aComponent, COmxBufferManager::COmxBuffer* aBuffer)
461 message.iType = EEmptyBufferCallback;
462 message.iComponent = aComponent;
463 message.iBuffer = aBuffer;
464 return iMsgQueue.Send(message);
467 TInt COmxCallbacks::EventHandler(OMX_HANDLETYPE aComponent, TEventParams aEventParams)
470 message.iType = EEventCallback;
471 message.iComponent = aComponent;
472 message.iEventParams = aEventParams;
473 return iMsgQueue.Send(message);
477 COmxProcessingUnit::CBody::CBody()
479 iPuState = EProcessingUnitInvalid;
483 COmxProcessingUnit::CBody::~CBody()
485 delete iBufferManager;
489 iOutputPorts.Close();
491 ::OMX_FreeHandle((OMX_HANDLETYPE)iHandle);
494 COmxProcessingUnit::CBody* COmxProcessingUnit::CBody::NewL(const TDesC8& aComponentName,
495 MOmxPuCallbacks& aPuCallbacks,
496 COmxProcessingUnit* aParent,
497 const MMdfProcessingUnitObserver& aObserver)
499 CBody* self = new (ELeave) CBody;
500 CleanupStack::PushL(self);
501 self->ConstructL(aComponentName, aPuCallbacks, aParent, aObserver);
502 CleanupStack::Pop(self);
507 void COmxProcessingUnit::CBody::ConstructL(const TDesC8& aComponentName,
508 MOmxPuCallbacks& aPuCallbacks,
509 COmxProcessingUnit* aParent,
510 const MMdfProcessingUnitObserver& aObserver)
512 iCallbacks = COmxCallbacks::NewL(aPuCallbacks);
515 iObserver = const_cast<MMdfProcessingUnitObserver*>(&aObserver);
517 OMX_ERRORTYPE errorType;
518 OMX_CALLBACKTYPE* omxCallbacks = *iCallbacks;
519 TBuf8<KMaxComponentNameLength> buf;
520 buf.Copy(aComponentName);
521 const char* name = reinterpret_cast<const char*>(buf.PtrZ());
522 errorType = ::OMX_GetHandle((OMX_HANDLETYPE*)&iHandle, const_cast<char*>(name), iCallbacks, omxCallbacks);
524 User::LeaveIfError(ConvertOmxErrorType(errorType));
525 // Create the BufferManager class to look after the buffering
526 iBufferManager = new (ELeave) COmxBufferManager(iHandle);
527 SetPuState(EProcessingUnitLoaded);
532 TInt COmxProcessingUnit::CBody::GetInputPorts(RPointerArray<MMdfInputPort>& aComponentInputPorts)
535 for (TInt i=0; i < iInputPorts.Count() && err == KErrNone; i++ )
537 err = aComponentInputPorts.Append(iInputPorts[i]);
543 TInt COmxProcessingUnit::CBody::GetOutputPorts(RPointerArray<MMdfOutputPort>& aComponentOutputPorts)
546 for (TInt i=0; i < iOutputPorts.Count() && err == KErrNone; i++ )
548 err = aComponentOutputPorts.Append(iOutputPorts[i]);
554 void COmxProcessingUnit::CBody::Initialize()
556 // if the state is not Loaded, we should not accept this call
557 if (State() != EProcessingUnitLoaded)
559 Observer()->InitializeComplete(iParent, KErrNotReady);
563 // initialize each of the ports in turn
564 for (TInt i=0; i < iInputPorts.Count(); i++ )
566 iInputPorts[i]->MipInitialize();
569 for (TInt i=0; i < iOutputPorts.Count(); i++ )
571 iOutputPorts[i]->MopInitialize();
574 // instruct the OMX component to go into the Idle state
575 SendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL);
576 SetPuState(EProcessingUnitInitializing);
580 void COmxProcessingUnit::CBody::Execute()
583 SendCommand(OMX_CommandStateSet, OMX_StateExecuting, NULL);
584 iPuState = EProcessingUnitExecuting;
587 TProcessingUnitState COmxProcessingUnit::CBody::State()
592 TInt COmxProcessingUnit::CBody::EventHandler(OMX_HANDLETYPE /*aComponent*/, OMX_EVENTTYPE aEvent, TUint32 /*aData1*/,
593 TUint32 aData2, TAny* /*aExtraInfo*/)
598 case OMX_EventCmdComplete:
604 if (iPuState == EProcessingUnitInitializing)
606 Observer()->InitializeComplete(iParent, KErrNone);
610 Observer()->ExecuteComplete(iParent, KErrNone);
612 SetPuState(EProcessingUnitIdle);
618 case OMX_EventBufferFlag:
620 SendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL);
626 // Base Versions are not supported
627 TInt COmxProcessingUnit::CBody::Configure(const TPuConfig& /*aConfig*/)
629 return KErrNotSupported;
633 // Base Versions are not supported
634 TInt COmxProcessingUnit::CBody::GetConfig(TPuConfig& /*aConfig*/)
636 return KErrNotSupported;
640 TInt COmxProcessingUnit::CBody::Pause ()
645 void COmxProcessingUnit::CBody::Stop()
647 SendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL);
650 for (TInt i=0; i < iInputPorts.Count() && err == KErrNone; i++ )
652 iInputPorts[i]->MipDisconnectTunnel();
655 for (TInt i=0; i < iOutputPorts.Count() && err == KErrNone; i++ )
657 iOutputPorts[i]->MopDisconnectTunnel();
660 SetPuState(EProcessingUnitIdle);
663 TInt COmxProcessingUnit::CBody::CreateCustomInterface(TUid /*aUid*/)
665 return KErrNotSupported;
669 TAny* COmxProcessingUnit::CBody::CustomInterface(TUid /*aUid*/)
674 TInt COmxProcessingUnit::CBody::AddInputPort(MMdfInputPort* aInputPort)
676 if (iInputPorts.Find(aInputPort)>=0)
677 return KErrAlreadyExists;
678 return iInputPorts.Append(aInputPort);
681 TInt COmxProcessingUnit::CBody::AddOutputPort(MMdfOutputPort* aOutputPort)
683 if (iOutputPorts.Find(aOutputPort)>=0)
684 return KErrAlreadyExists;
685 return iOutputPorts.Append(aOutputPort);
688 MMdfProcessingUnitObserver* COmxProcessingUnit::CBody::Observer()
693 void COmxProcessingUnit::CBody::SetPuState(TProcessingUnitState aPuState)
698 TInt COmxProcessingUnit::CBody::GetComponentVersion(const TDesC8& /*aComponentName*/, OMX_VERSIONTYPE* /*aComponentVersion*/, OMX_VERSIONTYPE* /*aSpecVersion*/, OMX_UUIDTYPE* /*aComponentUUID*/)
700 return KErrNotSupported;
703 TInt COmxProcessingUnit::CBody::SendCommand(OMX_COMMANDTYPE aCmd, TUint aParam, TAny* aCmdData)
705 OMX_ERRORTYPE error = iHandle->SendCommand(static_cast<OMX_HANDLETYPE>(iHandle), aCmd, aParam, aCmdData);
706 return ConvertOmxErrorType(error);
710 TInt COmxProcessingUnit::CBody::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure)
712 OMX_ERRORTYPE error = iHandle->GetParameter(static_cast<OMX_HANDLETYPE>(iHandle), aParamIndex, aComponentParameterStructure);
713 return ConvertOmxErrorType(error);
717 TInt COmxProcessingUnit::CBody::SetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure)
719 OMX_ERRORTYPE error = iHandle->SetParameter(static_cast<OMX_HANDLETYPE>(iHandle), aIndex, aComponentParameterStructure);
720 return ConvertOmxErrorType(error);
723 TInt COmxProcessingUnit::CBody::GetConfig(OMX_INDEXTYPE aIndex, TAny* aValue)
725 OMX_ERRORTYPE error = iHandle->GetConfig(static_cast<OMX_HANDLETYPE>(iHandle), aIndex, aValue);
726 return ConvertOmxErrorType(error);
729 TInt COmxProcessingUnit::CBody::SetConfig(OMX_INDEXTYPE aIndex, TAny* aValue)
731 OMX_ERRORTYPE error = iHandle->SetConfig(static_cast<OMX_HANDLETYPE>(iHandle), aIndex, aValue);
732 return ConvertOmxErrorType(error);
735 TInt COmxProcessingUnit::CBody::GetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType)
737 HBufC8* buf = HBufC8::New(aParameterName.Length()+1);
744 // Create a zero terminated version of the paramter name
745 *buf = aParameterName;
746 TPtr8 ptr = buf->Des();
747 TUint8* cstring = const_cast<TUint8*>(ptr.PtrZ());
748 OMX_ERRORTYPE error = iHandle->GetExtensionIndex(static_cast<OMX_HANDLETYPE>(iHandle), reinterpret_cast<char*>(cstring), aIndexType);
749 // delete the created memory - note no leaving functions so CleanupStack not used
751 return ConvertOmxErrorType(error);
756 TInt COmxProcessingUnit::CBody::GetState(OMX_STATETYPE* aState)
758 OMX_ERRORTYPE error = iHandle->GetState(static_cast<OMX_HANDLETYPE>(iHandle), aState);
759 return ConvertOmxErrorType(error);
763 TInt COmxProcessingUnit::CBody::ComponentTunnelRequest(TUint aPortInput, OMX_HANDLETYPE aOutput, TUint aPortOutput, OMX_TUNNELSETUPTYPE* aTunnelSetup)
765 OMX_ERRORTYPE error = iHandle->ComponentTunnelRequest(static_cast<OMX_HANDLETYPE>(iHandle), aPortInput, aOutput, aPortOutput, aTunnelSetup);
766 return ConvertOmxErrorType(error);
769 TInt COmxProcessingUnit::CBody::UseBuffer(CMMFBuffer* aBuffer, TUint aPortIndex)
771 return iBufferManager->UseBuffer(*aBuffer, aPortIndex);
775 CMMFBuffer* COmxProcessingUnit::CBody::AllocateBufferL(TUint aPortIndex, TUint aSizeBytes)
777 return iBufferManager->AllocateBufferL(aPortIndex, aSizeBytes);
781 TInt COmxProcessingUnit::CBody::FreeBuffer(CMMFBuffer* aBuffer)
783 return iBufferManager->FreeBuffer(aBuffer);
786 TInt COmxProcessingUnit::CBody::EmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxInputPortCallbacks* aObserver)
788 return iBufferManager->EmptyThisBuffer(aBuffer, aObserver);
792 TInt COmxProcessingUnit::CBody::FillThisBuffer(CMMFBuffer* aBuffer, MOmxOutputPortCallbacks* aObserver)
794 return iBufferManager->FillThisBuffer(aBuffer, aObserver);
798 TInt COmxProcessingUnit::CBody::SetCallbacks(MOmxPuCallbacks& /*aPuCallbacks*/)
800 return KErrNotSupported;
803 // Callbacks implementation - calls back to COMxCallbacks class, which manages a queue
804 OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent,
805 OMX_OUT TAny* aAppData,
806 OMX_OUT OMX_EVENTTYPE aEvent,
807 OMX_OUT TUint32 aData1,
808 OMX_OUT TUint32 aData2,
809 OMX_OUT TAny* aExtra)
811 COmxCallbacks::TEventParams eventParams;
812 eventParams.iEvent = aEvent;
813 eventParams.iData1 = aData1;
814 eventParams.iData2 = aData2;
815 eventParams.iExtra = aExtra;
816 TInt error = static_cast<COmxCallbacks*>(aAppData)->EventHandler(aComponent, eventParams);
817 return ConvertSymbianErrorType(error);
820 OMX_ERRORTYPE EmptyBufferDone(
821 OMX_HANDLETYPE aComponent,
823 OMX_BUFFERHEADERTYPE* aBuffer)
825 COmxBufferManager::COmxBuffer* buffer = static_cast<COmxBufferManager::COmxBuffer*>(aBuffer->pAppPrivate);
826 TInt error = static_cast<COmxCallbacks*>(aAppData)->EmptyBufferDone(aComponent, buffer);
827 return ConvertSymbianErrorType(error);
830 OMX_ERRORTYPE FillBufferDone(
831 OMX_HANDLETYPE aComponent,
833 OMX_BUFFERHEADERTYPE* aBuffer)
835 COmxBufferManager::COmxBuffer* buffer = static_cast<COmxBufferManager::COmxBuffer*>(aBuffer->pAppPrivate);
836 TInt error = static_cast<COmxCallbacks*>(aAppData)->FillBufferDone(aComponent, buffer);
837 return ConvertSymbianErrorType(error);