pv omx线程模型

OMX_EmptyThisBuffer
--------------
#define OMX_EmptyThisBuffer(                                \
        hComponent,                                         \
        pBuffer)                                            \
    ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer(      \
        hComponent,                                         \
        pBuffer)
-------------       
hComponent->EmptyThisBuffer这个函数指针在component中赋值
如omx_mpeg4_component.cpp
    iOmxComponent.EmptyThisBuffer = OpenmaxMpeg4AO::BaseComponentProxyEmptyThisBuffer;

OmxComponentBase::BaseComponentProxyEmptyThisBuffer调用
(pOpenmaxAOType->ipComponentProxy))->ProxyEmptyThisBuffer
也就是ProxyApplication_OMX的ProxyEmptyThisBuffer,
ProxyEmptyThisBuffer中ipProxy->SendCommand(iProxyId, EMPTY_BUF, (OsclAny*) Msg)
 case EMPTY_BUF:ComponentEmptyThisBuffer是函数指针在component中赋值
((ProxyApplication_OMX*)ipComponentProxy)->ComponentEmptyThisBuffer = BaseComponentEmptyThisBuffer;

也就是说BaseComponentEmptyThisBuffer在Proxy的线程中执行


ProxyApplication_OMX 是应用与CPVInterfaceProxy_OMX之间的proxy

CPVInterfaceProxy_OMX是ProxyApplication_OMX与component之间的proxy

CPVInterfaceProxy_OMX实现了一个线程,SendCommand,SendNotification是两个重要的接口,
其内部有两个handler也是两个AO,CPVInterfaceProxyHandler_OMX,CPVInterfaceProxyNotifier_OMX
CPVInterfaceProxy_OMX::SendCommand将命令传给CPVInterfaceProxyHandler_OMX,CPVInterfaceProxyHandler_OMX调用PVProxiedInterfaceServer_OMX,这个VProxiedInterfaceServer_OMX也就是ProxyApplication_OMX,其中的HanleCommand会执行。
SendNotification过程与此相似,目前好像没有使用。
component的回调是直接调用client的函数
回调函数:ipCallbacks->EventHandler,ipCallbacks->EmptyBufferDone,ipCallbacks->FillBufferDone

在component的线程中执行

component没有单独创建线程其是个AO,也在上面创建的线程中运行

你可能感兴趣的:(pv omx线程模型)