summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-02-29 09:20:24 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-29 09:20:25 -0800
commit5687da3359c7939dbd982de9fa2e5f19e41ae411 (patch)
treed576294f7567041ffca6ed4443a0cb3132f55ac0 /include
parent41acadea86b763f4cc6f7aeb292f943d4570ac90 (diff)
parentc95c2ddcdfc974f42408a377fbe2de51b94a8c94 (diff)
downloadframeworks_av-5687da3359c7939dbd982de9fa2e5f19e41ae411.zip
frameworks_av-5687da3359c7939dbd982de9fa2e5f19e41ae411.tar.gz
frameworks_av-5687da3359c7939dbd982de9fa2e5f19e41ae411.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.h10
-rw-r--r--include/media/stagefright/MediaCodec.h9
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',