diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-05-12 19:03:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-05-12 19:03:29 +0000 |
commit | e32f7cf3965f7a887eba847c2a935b777cf9430e (patch) | |
tree | 3722ff2491b1ea752f5b42ab884a74d1b383f8b2 | |
parent | 17ff054dc721fa34e39aecb780499476ff759ccc (diff) | |
parent | 501e616107faf20c35ec2731471a6b381f014e50 (diff) | |
download | goldfish-opengl-e32f7cf3965f7a887eba847c2a935b777cf9430e.tar.gz |
Merge "codecs: correctly determine render to host mode" into udc-dev
-rw-r--r-- | system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp | 7 | ||||
-rw-r--r-- | system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp | 7 | ||||
-rw-r--r-- | system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp b/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp index cbc70690..544225b3 100644 --- a/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp +++ b/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp @@ -615,6 +615,9 @@ void C2GoldfishAvcDec::resetPlugin() { mSignalledOutputEos = false; gettimeofday(&mTimeStart, nullptr); gettimeofday(&mTimeEnd, nullptr); + if (mOutBlock) { + mOutBlock.reset(); + } } void C2GoldfishAvcDec::deleteContext() { @@ -745,8 +748,8 @@ C2GoldfishAvcDec::ensureDecoderState(const std::shared_ptr<C2BlockPool> &pool) { void C2GoldfishAvcDec::checkMode(const std::shared_ptr<C2BlockPool> &pool) { mWidth = mIntf->width(); mHeight = mIntf->height(); - const bool isGraphic = (pool->getAllocatorId() & C2Allocator::GRAPHIC); - DDD("buffer id %d", (int)(pool->getAllocatorId())); + const bool isGraphic = (pool->getLocalId() == C2PlatformAllocatorStore::GRALLOC); + DDD("buffer pool id %x", (int)(pool->getLocalId())); if (isGraphic) { DDD("decoding to host color buffer"); mEnableAndroidNativeBuffers = true; diff --git a/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp b/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp index 13e9515d..9c6014b1 100644 --- a/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp +++ b/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp @@ -563,6 +563,9 @@ void C2GoldfishHevcDec::resetPlugin() { mSignalledOutputEos = false; gettimeofday(&mTimeStart, nullptr); gettimeofday(&mTimeEnd, nullptr); + if (mOutBlock) { + mOutBlock.reset(); + } } void C2GoldfishHevcDec::deleteContext() { @@ -693,8 +696,8 @@ C2GoldfishHevcDec::ensureDecoderState(const std::shared_ptr<C2BlockPool> &pool) void C2GoldfishHevcDec::checkMode(const std::shared_ptr<C2BlockPool> &pool) { mWidth = mIntf->width(); mHeight = mIntf->height(); - const bool isGraphic = (pool->getAllocatorId() & C2Allocator::GRAPHIC); - DDD("buffer id %d", (int)(pool->getAllocatorId())); + const bool isGraphic = (pool->getLocalId() == C2PlatformAllocatorStore::GRALLOC); + DDD("buffer pool id %x", (int)(pool->getLocalId())); if (isGraphic) { DDD("decoding to host color buffer"); mEnableAndroidNativeBuffers = true; diff --git a/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp b/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp index be6428e9..ed2189da 100644 --- a/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp +++ b/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp @@ -495,8 +495,8 @@ void C2GoldfishVpxDec::checkContext(const std::shared_ptr<C2BlockPool> &pool) { mCtx = new vpx_codec_ctx_t; mCtx->vpversion = mMode == MODE_VP8 ? 8 : 9; - const bool isGraphic = (pool->getAllocatorId() & C2Allocator::GRAPHIC); - DDD("buffer id %d", (int)(pool->getAllocatorId())); + const bool isGraphic = (pool->getLocalId() == C2PlatformAllocatorStore::GRALLOC); + DDD("buffer pool id %x", (int)(pool->getLocalId())); if (isGraphic) { DDD("decoding to host color buffer"); mEnableAndroidNativeBuffers = true; |