aboutsummaryrefslogtreecommitdiff
path: root/system/codecs/c2/decoders/hevcdec
diff options
context:
space:
mode:
authorbohu <bohu@google.com>2022-06-01 15:47:34 -0700
committerBo Hu <bohu@google.com>2022-06-01 22:54:56 +0000
commit942dd778ecd7bf5bbfece1a73fe7c62ed93498d5 (patch)
tree89b828e5e0d47ac119133be71e80b618684fda20 /system/codecs/c2/decoders/hevcdec
parent38858f07809b4f089c4ba710f9b31eddfc83c1f3 (diff)
downloadgoldfish-opengl-942dd778ecd7bf5bbfece1a73fe7c62ed93498d5.tar.gz
codecs: use bit field to check graphic or linear buffer
The pool id now has other bits irrelevant to graphic or linear type. Just checking the bit field is the right way. Also fixed a typo that has been forcing hardware decoder to decode to bytebuffer. Bug: 232881288 Bug: 234447627 Test: atest android.media.decoder.cts.ImageReaderDecoderTest some of them should use host color buffer and some of them should use byte buffer Change-Id: I0eaef4eedb1a65e64ec70e440f09640df4de77f9
Diffstat (limited to 'system/codecs/c2/decoders/hevcdec')
-rw-r--r--system/codecs/c2/decoders/hevcdec/C2GoldfishHevcDec.cpp5
1 files changed, 3 insertions, 2 deletions
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;