diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/stagefright/foundation/ALooperRoster.h | 13 | ||||
-rw-r--r-- | include/media/stagefright/foundation/AMessage.h | 11 | ||||
-rw-r--r-- | include/media/stagefright/openmax/OMX_IVCommon.h | 2 |
3 files changed, 24 insertions, 2 deletions
diff --git a/include/media/stagefright/foundation/ALooperRoster.h b/include/media/stagefright/foundation/ALooperRoster.h index c1bd4ed..2e5fd73 100644 --- a/include/media/stagefright/foundation/ALooperRoster.h +++ b/include/media/stagefright/foundation/ALooperRoster.h @@ -31,9 +31,14 @@ struct ALooperRoster { void unregisterHandler(ALooper::handler_id handlerID); - void postMessage(const sp<AMessage> &msg, int64_t delayUs = 0); + status_t postMessage(const sp<AMessage> &msg, int64_t delayUs = 0); void deliverMessage(const sp<AMessage> &msg); + status_t postAndAwaitResponse( + const sp<AMessage> &msg, sp<AMessage> *response); + + void postReply(uint32_t replyID, const sp<AMessage> &reply); + sp<ALooper> findLooper(ALooper::handler_id handlerID); private: @@ -45,6 +50,12 @@ private: Mutex mLock; KeyedVector<ALooper::handler_id, HandlerInfo> mHandlers; ALooper::handler_id mNextHandlerID; + uint32_t mNextReplyID; + Condition mRepliesCondition; + + KeyedVector<uint32_t, sp<AMessage> > mReplies; + + status_t postMessage_l(const sp<AMessage> &msg, int64_t delayUs); DISALLOW_EVIL_CONSTRUCTORS(ALooperRoster); }; diff --git a/include/media/stagefright/foundation/AMessage.h b/include/media/stagefright/foundation/AMessage.h index 72dc730..7ec54aa 100644 --- a/include/media/stagefright/foundation/AMessage.h +++ b/include/media/stagefright/foundation/AMessage.h @@ -72,6 +72,17 @@ struct AMessage : public RefBase { void post(int64_t delayUs = 0); + // Posts the message to its target and waits for a response (or error) + // before returning. + status_t postAndAwaitResponse(sp<AMessage> *response); + + // If this returns true, the sender of this message is synchronously + // awaiting a response, the "replyID" can be used to send the response + // via "postReply" below. + bool senderAwaitsResponse(uint32_t *replyID) const; + + void postReply(uint32_t replyID); + // Performs a deep-copy of "this", contained messages are in turn "dup'ed". // Warning: RefBase items, i.e. "objects" are _not_ copied but only have // their refcount incremented. diff --git a/include/media/stagefright/openmax/OMX_IVCommon.h b/include/media/stagefright/openmax/OMX_IVCommon.h index 65b6339..8bb4ded 100644 --- a/include/media/stagefright/openmax/OMX_IVCommon.h +++ b/include/media/stagefright/openmax/OMX_IVCommon.h @@ -156,7 +156,7 @@ typedef enum OMX_COLOR_FORMATTYPE { * Android-specific OMX IL colorformats. Change this enum to * an acceptable range once that is done. * */ - OMX_COLOR_FormatAndroidOpaque = 0x7F000001, + OMX_COLOR_FormatAndroidOpaque = 0x7F000789, OMX_TI_COLOR_FormatYUV420PackedSemiPlanar = 0x7F000100, OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00, OMX_COLOR_FormatMax = 0x7FFFFFFF |