diff options
author | James Dong <jdong@google.com> | 2010-06-14 17:28:05 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-06-14 17:28:05 -0700 |
commit | 78d26445a7dfe8f49d7005185f28b01cffe80adf (patch) | |
tree | 58ce3489a9162ef429d42fd553db9676b7b4f68b /media/libstagefright/include | |
parent | 8aa8fe5ea704b05d8f0ab3d7bf18de18151f1b50 (diff) | |
download | frameworks_av-78d26445a7dfe8f49d7005185f28b01cffe80adf.zip frameworks_av-78d26445a7dfe8f49d7005185f28b01cffe80adf.tar.gz frameworks_av-78d26445a7dfe8f49d7005185f28b01cffe80adf.tar.bz2 |
This patch enables each omx instance to have a separate message dispatcher, and
thus eliminates the sharing of the message dispatches between omx instances.
If the omx audio and video encoders share the same dispatcher, when the audio read
blocks in the AudioSource, the message dispatcher thread gets blocked. As a result,
the message for the omx video encoder can not be dispatched, hence gets blocked too.
If the blocking time is long enough, the video frame rate decreases significantly.
This is the case when we read 2048 bytes by default each time. Reading smaller blocks
of audio data helps mitigate the above-mentioned problem, but it is not an ideal
solution for two reasons: a) it is not efficient, and thus can cause a lot of overhead
passing buffers between the frame work and the omx encoders; b) also, the audio record
thread can overflow as a result, which lead to the loss of recorded audio frames.
This patch affects both authoring engine and the playback engine.
Change-Id: I26dfde7ac46c8752cf1793ce1bfcc7be7724580e
Diffstat (limited to 'media/libstagefright/include')
-rw-r--r-- | media/libstagefright/include/OMX.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/media/libstagefright/include/OMX.h b/media/libstagefright/include/OMX.h index ea131e8..c99da59 100644 --- a/media/libstagefright/include/OMX.h +++ b/media/libstagefright/include/OMX.h @@ -102,7 +102,7 @@ public: OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData); - + OMX_ERRORTYPE OnEmptyBufferDone( node_id node, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer); @@ -115,20 +115,19 @@ protected: virtual ~OMX(); private: - Mutex mLock; - - OMXMaster *mMaster; - struct CallbackDispatcher; - sp<CallbackDispatcher> mDispatcher; + Mutex mLock; + OMXMaster *mMaster; int32_t mNodeCounter; KeyedVector<wp<IBinder>, OMXNodeInstance *> mLiveNodes; KeyedVector<node_id, OMXNodeInstance *> mNodeIDToInstance; + KeyedVector<node_id, sp<CallbackDispatcher> > mDispatchers; node_id makeNodeID(OMXNodeInstance *instance); OMXNodeInstance *findInstance(node_id node); + sp<CallbackDispatcher> findDispatcher(node_id node); void invalidateNodeID_l(node_id node); |