diff options
author | Steve Kondik <steve@cyngn.com> | 2016-01-05 16:45:30 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-01-05 16:50:35 -0800 |
commit | af4528b74642910c023cdbede1cb8b184fa9fa92 (patch) | |
tree | 380da6ed6a686cf0fc18aabd22c0398abc14c4d1 | |
parent | 81955306d4d9465b12528da1e56c17eb938e7564 (diff) | |
download | frameworks_av-af4528b74642910c023cdbede1cb8b184fa9fa92.zip frameworks_av-af4528b74642910c023cdbede1cb8b184fa9fa92.tar.gz frameworks_av-af4528b74642910c023cdbede1cb8b184fa9fa92.tar.bz2 |
stagefright: Add deferred release option
* Fill in stub methods to improve video encoding performance.
Change-Id: I2bbf192e022043d161429c6cabf4a7d740802d20
-rw-r--r-- | include/media/stagefright/MetaData.h | 4 | ||||
-rw-r--r-- | media/libavextensions/stagefright/AVExtensions.h | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h index 0dd5995..2a3df22 100644 --- a/include/media/stagefright/MetaData.h +++ b/include/media/stagefright/MetaData.h @@ -205,6 +205,10 @@ enum { kKeyPCMFormat = 'pfmt', kKeyArbitraryMode = 'ArbM', + + // Indicate if it is OK to hold on to the MediaBuffer and not + // release it immediately + kKeyCanDeferRelease = 'drel', // bool (int32_t) }; enum { diff --git a/media/libavextensions/stagefright/AVExtensions.h b/media/libavextensions/stagefright/AVExtensions.h index 968eb6d..b0e4bb5 100644 --- a/media/libavextensions/stagefright/AVExtensions.h +++ b/media/libavextensions/stagefright/AVExtensions.h @@ -36,10 +36,10 @@ #include <media/mediarecorder.h> #include <media/IOMX.h> #include <media/AudioParameter.h> +#include <media/stagefright/MetaData.h> namespace android { -class MetaData; class MediaExtractor; class MPEG4Writer; struct ABuffer; @@ -160,8 +160,14 @@ struct AVUtils { virtual bool useQCHWEncoder(const sp<AMessage> &, AString &) { return false; } - virtual bool canDeferRelease(const sp<MetaData> &/*meta*/) { return false; } - virtual void setDeferRelease(sp<MetaData> &/*meta*/) {} + virtual bool canDeferRelease(const sp<MetaData> &meta) { + int32_t deferRelease = false; + return meta->findInt32(kKeyCanDeferRelease, &deferRelease) && deferRelease; + } + + virtual void setDeferRelease(sp<MetaData> &meta) { + meta->setInt32(kKeyCanDeferRelease, true); + } struct HEVCMuxer { |