diff options
author | Ronghua Wu <ronghuawu@google.com> | 2015-03-13 10:47:08 -0700 |
---|---|---|
committer | Ronghua Wu <ronghuawu@google.com> | 2015-04-14 14:16:12 -0700 |
commit | 67e7f543c7f1c4fe4ee1989ceb0aebe44a63b49e (patch) | |
tree | 7de894fc9626b36de6eed70812962380ca217f22 /include | |
parent | 9e6955a19bf77ebf27b770e910efbe1ebf1ceac0 (diff) | |
download | frameworks_av-67e7f543c7f1c4fe4ee1989ceb0aebe44a63b49e.zip frameworks_av-67e7f543c7f1c4fe4ee1989ceb0aebe44a63b49e.tar.gz frameworks_av-67e7f543c7f1c4fe4ee1989ceb0aebe44a63b49e.tar.bz2 |
media: use ResourceManagerService with MediaCodec
Bug: 19620911
Change-Id: I235a97e5195b28645b7834dda0dd77307d93f4a8
Diffstat (limited to 'include')
-rw-r--r-- | include/media/stagefright/MediaCodec.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 3e3c276..012a8f4 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -20,6 +20,7 @@ #include <gui/IGraphicBufferProducer.h> #include <media/hardware/CryptoAPI.h> +#include <media/MediaResource.h> #include <media/stagefright/foundation/AHandler.h> #include <utils/Vector.h> @@ -34,6 +35,8 @@ struct IBatteryStats; struct ICrypto; struct IMemory; struct MemoryDealer; +class IResourceManagerClient; +class IResourceManagerService; struct SoftwareRenderer; struct Surface; @@ -230,6 +233,30 @@ private: bool mOwnedByClient; }; + struct ResourceManagerServiceProxy : public IBinder::DeathRecipient { + ResourceManagerServiceProxy(); + ~ResourceManagerServiceProxy(); + + void init(); + + // implements DeathRecipient + virtual void binderDied(const wp<IBinder>& /*who*/); + + void addResource( + int pid, + int64_t clientId, + const sp<IResourceManagerClient> client, + const Vector<MediaResource> &resources); + + void removeResource(int64_t clientId); + + bool reclaimResource(int callingPid, const Vector<MediaResource> &resources); + + private: + Mutex mLock; + sp<IResourceManagerService> mService; + }; + State mState; sp<ALooper> mLooper; sp<ALooper> mCodecLooper; @@ -245,14 +272,22 @@ private: sp<AMessage> mCallback; sp<MemoryDealer> mDealer; + sp<IResourceManagerClient> mResourceManagerClient; + sp<ResourceManagerServiceProxy> mResourceManagerService; + bool mBatteryStatNotified; bool mIsVideo; + int32_t mVideoWidth; + int32_t mVideoHeight; // initial create parameters AString mInitName; bool mInitNameIsType; bool mInitIsEncoder; + // configure parameter + sp<AMessage> mConfigureMsg; + // Used only to synchronize asynchronous getBufferAndFormat // across all the other (synchronous) buffer state change // operations, such as de/queueIn/OutputBuffer, start and @@ -320,6 +355,9 @@ private: void updateBatteryStat(); bool isExecuting() const; + uint64_t getGraphicBufferSize(); + void addResource(const char *type, uint64_t value); + /* called to get the last codec error when the sticky flag is set. * if no such codec error is found, returns UNKNOWN_ERROR. */ |