aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbohu <bohu@google.com>2022-06-02 00:22:15 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-06-02 00:22:15 +0000
commit1e3b4e245dbc13e2b148955bc143c9928fb5413f (patch)
tree89b828e5e0d47ac119133be71e80b618684fda20
parentc7abd21161ad886baca7a28288d7658c54592e54 (diff)
parent942dd778ecd7bf5bbfece1a73fe7c62ed93498d5 (diff)
downloadgoldfish-opengl-1e3b4e245dbc13e2b148955bc143c9928fb5413f.tar.gz
codecs: use bit field to check graphic or linear buffer am: 942dd778ec
Original change: https://googleplex-android-review.googlesource.com/c/device/generic/goldfish-opengl/+/18702522 Change-Id: I9ea08f9ddad01e10a7e7c977a0c29d19a3fa5d7b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp5
-rw-r--r--system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp5
-rw-r--r--system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp5
3 files changed, 9 insertions, 6 deletions
diff --git a/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp b/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp
index 8e871458..90b56532 100644
--- a/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp
+++ b/system/codecs/c2/decoders/avcdec/C2GoldfishAvcDec.cpp
@@ -670,10 +670,11 @@ 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);
+ const bool isGraphic = (pool->getAllocatorId() & C2Allocator::GRAPHIC);
+ DDD("buffer id %d", (int)(pool->getAllocatorId()));
if (isGraphic) {
DDD("decoding to host color buffer");
- mEnableAndroidNativeBuffers = false;
+ mEnableAndroidNativeBuffers = true;
} else {
DDD("decoding to guest byte buffer");
mEnableAndroidNativeBuffers = false;
diff --git a/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp b/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp
index 7aac56f8..7008bd5d 100644
--- a/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp
+++ b/system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp
@@ -661,10 +661,11 @@ 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);
+ const bool isGraphic = (pool->getAllocatorId() & C2Allocator::GRAPHIC);
+ DDD("buffer id %d", (int)(pool->getAllocatorId()));
if (isGraphic) {
DDD("decoding to host color buffer");
- mEnableAndroidNativeBuffers = false;
+ mEnableAndroidNativeBuffers = true;
} else {
DDD("decoding to guest byte buffer");
mEnableAndroidNativeBuffers = false;
diff --git a/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp b/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp
index bb61cf94..99f0469a 100644
--- a/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp
+++ b/system/codecs/c2/decoders/vpxdec/C2GoldfishVpxDec.cpp
@@ -465,10 +465,11 @@ 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);
+ const bool isGraphic = (pool->getAllocatorId() & C2Allocator::GRAPHIC);
+ DDD("buffer id %d", (int)(pool->getAllocatorId()));
if (isGraphic) {
DDD("decoding to host color buffer");
- mEnableAndroidNativeBuffers = false;
+ mEnableAndroidNativeBuffers = true;
} else {
DDD("decoding to guest byte buffer");
mEnableAndroidNativeBuffers = false;