From 4b710f086070fabe022b3a1f474bfcbec842b8fc Mon Sep 17 00:00:00 2001 From: Ronghua Wu Date: Mon, 14 Sep 2015 15:44:04 -0700 Subject: libstagefright: don't reclaim codec when there's buffer owned by client. Notify the client and try to reclaim again in 0.5s. Bug: 23703241 Bug: 23949540 Change-Id: I1afe50c71635645668bfb73ffa0d801765b5ae3c --- include/media/stagefright/MediaCodec.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index c10963d..cdfa159 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -176,7 +176,7 @@ protected: private: // used by ResourceManagerClient - status_t reclaim(); + status_t reclaim(bool force = false); friend struct ResourceManagerClient; private: @@ -385,6 +385,9 @@ private: uint64_t getGraphicBufferSize(); void addResource(const String8 &type, const String8 &subtype, uint64_t value); + bool hasPendingBuffer(int portIndex); + bool hasPendingBuffer(); + /* called to get the last codec error when the sticky flag is set. * if no such codec error is found, returns UNKNOWN_ERROR. */ -- cgit v1.1 From 2482595baadd16f20d3992c8c9d6a14061836872 Mon Sep 17 00:00:00 2001 From: Wei Jia Date: Mon, 28 Sep 2015 11:32:23 -0700 Subject: DO NOT MERGE - OMX: allow only secure codec to remotely call allocateBuffer. Bug: 24310423 Change-Id: Iebcfc58b447f925ec2134898060af2ef227266a3 (cherry picked from commit 8dde7269a5356503d2b283234b6cb46d0c3f214e) --- include/media/IOMX.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/media/IOMX.h b/include/media/IOMX.h index 627f23b..595e51f 100644 --- a/include/media/IOMX.h +++ b/include/media/IOMX.h @@ -207,6 +207,12 @@ public: virtual status_t onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags = 0); + +protected: + // check if the codec is secure. + virtual bool isSecure(IOMX::node_id node) { + return false; + } }; class BnOMXObserver : public BnInterface { -- cgit v1.1 From 77c185d5499d6174e7a97b3e1512994d3a803151 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Mon, 12 Oct 2015 17:10:31 -0700 Subject: stagefright: check bounds for MediaCodecList.getCodecInfo Bug: 24445127 Change-Id: I1c6cb9e2518b852d48d5d0d625b54409bd4e13ec --- include/media/stagefright/MediaCodecList.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/media/stagefright/MediaCodecList.h b/include/media/stagefright/MediaCodecList.h index 8605d99..67754f9 100644 --- a/include/media/stagefright/MediaCodecList.h +++ b/include/media/stagefright/MediaCodecList.h @@ -45,6 +45,10 @@ struct MediaCodecList : public BnMediaCodecList { virtual size_t countCodecs() const; virtual sp getCodecInfo(size_t index) const { + if (index >= mCodecInfos.size()) { + ALOGE("b/24445127"); + return NULL; + } return mCodecInfos.itemAt(index); } -- cgit v1.1