diff options
author | Andreas Huber <andih@google.com> | 2012-02-29 09:20:24 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-29 09:20:25 -0800 |
commit | 0c9aa1b6fca0210353af8a153cbb0380dc83ed2d (patch) | |
tree | ce80a6e2ddbb81f96aae6d5ac0139c504b859c13 /include | |
parent | b290caafa7ea4e13aae8af7877df4e4891ef46b3 (diff) | |
parent | 4484bdd2f99a753b0801f0c13ca8a2b7bc38695a (diff) | |
download | frameworks_base-0c9aa1b6fca0210353af8a153cbb0380dc83ed2d.zip frameworks_base-0c9aa1b6fca0210353af8a153cbb0380dc83ed2d.tar.gz frameworks_base-0c9aa1b6fca0210353af8a153cbb0380dc83ed2d.tar.bz2 |
Merge "Separate the notion of "stop" from that of "release", i.e."
Diffstat (limited to 'include')
-rw-r--r-- | include/media/stagefright/ACodec.h | 10 | ||||
-rw-r--r-- | include/media/stagefright/MediaCodec.h | 9 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index 70799a6..6735aff 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -49,7 +49,7 @@ struct ACodec : public AHierarchicalStateMachine { void initiateSetup(const sp<AMessage> &msg); void signalFlush(); void signalResume(); - void initiateShutdown(); + void initiateShutdown(bool keepComponentAllocated = false); void initiateAllocateComponent(const sp<AMessage> &msg); void initiateConfigureComponent(const sp<AMessage> &msg); @@ -61,6 +61,7 @@ protected: private: struct BaseState; struct UninitializedState; + struct LoadedState; struct LoadedToIdleState; struct IdleToExecutingState; struct ExecutingState; @@ -107,6 +108,7 @@ private: sp<AMessage> mNotify; sp<UninitializedState> mUninitializedState; + sp<LoadedState> mLoadedState; sp<LoadedToIdleState> mLoadedToIdleState; sp<IdleToExecutingState> mIdleToExecutingState; sp<ExecutingState> mExecutingState; @@ -131,6 +133,12 @@ private: bool mSentFormat; bool mIsEncoder; + bool mShutdownInProgress; + + // If "mKeepComponentAllocated" we only transition back to Loaded state + // and do not release the component instance. + bool mKeepComponentAllocated; + status_t allocateBuffersOnPort(OMX_U32 portIndex); status_t freeBuffersOnPort(OMX_U32 portIndex); status_t freeBuffer(OMX_U32 portIndex, size_t i); diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 8c11c9c..72ac56a 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -53,8 +53,15 @@ struct MediaCodec : public AHandler { uint32_t flags); status_t start(); + + // Returns to a state in which the component remains allocated but + // unconfigured. status_t stop(); + // Client MUST call release before releasing final reference to this + // object. + status_t release(); + status_t flush(); status_t queueInputBuffer( @@ -97,6 +104,7 @@ private: STARTED, FLUSHING, STOPPING, + RELEASING, }; enum { @@ -109,6 +117,7 @@ private: kWhatConfigure = 'conf', kWhatStart = 'strt', kWhatStop = 'stop', + kWhatRelease = 'rele', kWhatDequeueInputBuffer = 'deqI', kWhatQueueInputBuffer = 'queI', kWhatDequeueOutputBuffer = 'deqO', |