summaryrefslogtreecommitdiffstats
path: root/include/media/stagefright/MediaCodec.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/stagefright/MediaCodec.h')
-rw-r--r--include/media/stagefright/MediaCodec.h46
1 files changed, 45 insertions, 1 deletions
diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h
index d055341..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>
@@ -30,8 +31,12 @@ struct AMessage;
struct AReplyToken;
struct AString;
struct CodecBase;
-struct ICrypto;
struct IBatteryStats;
+struct ICrypto;
+struct IMemory;
+struct MemoryDealer;
+class IResourceManagerClient;
+class IResourceManagerService;
struct SoftwareRenderer;
struct Surface;
@@ -127,6 +132,8 @@ struct MediaCodec : public AHandler {
status_t getOutputFormat(sp<AMessage> *format) const;
status_t getInputFormat(sp<AMessage> *format) const;
+ status_t getWidevineLegacyBuffers(Vector<sp<ABuffer> > *buffers) const;
+
status_t getInputBuffers(Vector<sp<ABuffer> > *buffers) const;
status_t getOutputBuffers(Vector<sp<ABuffer> > *buffers) const;
@@ -214,11 +221,36 @@ private:
uint32_t mBufferID;
sp<ABuffer> mData;
sp<ABuffer> mEncryptedData;
+ sp<IMemory> mSharedEncryptedBuffer;
sp<AMessage> mNotify;
sp<AMessage> mFormat;
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;
@@ -232,15 +264,24 @@ private:
sp<AMessage> mOutputFormat;
sp<AMessage> mInputFormat;
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
@@ -308,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.
*/