diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/mediametadataretriever.h | 1 | ||||
-rw-r--r-- | include/media/stagefright/MediaCodec.h | 46 | ||||
-rw-r--r-- | include/media/stagefright/MetaData.h | 3 |
3 files changed, 43 insertions, 7 deletions
diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h index b35cf32..7191965 100644 --- a/include/media/mediametadataretriever.h +++ b/include/media/mediametadataretriever.h @@ -57,6 +57,7 @@ enum { METADATA_KEY_IS_DRM = 22, METADATA_KEY_LOCATION = 23, METADATA_KEY_VIDEO_ROTATION = 24, + METADATA_KEY_CAPTURE_FRAMERATE = 25, // Add more here... }; diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 3e3c276..d98fa1a 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; @@ -53,13 +56,7 @@ struct MediaCodec : public AHandler { CB_OUTPUT_AVAILABLE = 2, CB_ERROR = 3, CB_OUTPUT_FORMAT_CHANGED = 4, - CB_CODEC_RELEASED = 5, - }; - - // used by CB_CODEC_RELEASED to tell the upper layer the cause of the release. - enum ReleaseReason { - REASON_UNKNOWN = 0, - REASON_RECLAIMED, // resources reclaimed by resource manager + CB_RESOURCE_RECLAIMED = 5, }; struct BatteryNotifier; @@ -230,6 +227,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 +266,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 +349,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. */ diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h index 087d016..8bdebf6 100644 --- a/include/media/stagefright/MetaData.h +++ b/include/media/stagefright/MetaData.h @@ -75,6 +75,8 @@ enum { kKeyDecoderComponent = 'decC', // cstring kKeyBufferID = 'bfID', kKeyMaxInputSize = 'inpS', + kKeyMaxWidth = 'maxW', + kKeyMaxHeight = 'maxH', kKeyThumbnailTime = 'thbT', // int64_t (usecs) kKeyTrackID = 'trID', kKeyIsDRM = 'idrm', // int32_t (bool) @@ -98,6 +100,7 @@ enum { kKeyCompilation = 'cpil', // cstring kKeyLocation = 'loc ', // cstring kKeyTimeScale = 'tmsl', // int32_t + kKeyCaptureFramerate = 'capF', // float (capture fps) // video profile and level kKeyVideoProfile = 'vprf', // int32_t |