summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-02-24 03:45:09 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-02-24 03:45:09 -0800
commit899253a888c35f7bc947a8928f23ff11b5306ea5 (patch)
treee135d8c1d7f2a9df373e41ee59759c595af86675
parent91237b59f2a8d68f83db0eff9d1971b6175c02b7 (diff)
parent1110775fc337dfc577c3e69a5d8e84a12852efdc (diff)
Merge "Remove false warning message while extracting memory" into main am: e7400713ae am: 1110775fc3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3503697 Change-Id: I0f52c43de8227fc67d99134f8f001c23997a46a2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--media/jni/android_media_MediaCodec.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 61c287b9633c..ae54c18eb135 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -2990,11 +2990,16 @@ static void extractMemoryFromContext(
}
*memory = context->toHidlMemory();
}
- if (context->mBlock == nullptr || context->mReadWriteMapping == nullptr) {
- ALOGW("extractMemoryFromContext: Cannot extract memory as C2Block is not created/mapped");
+ if (context->mBlock == nullptr) {
+ // this should be ok as we may only have IMemory/hidlMemory
+ // e.g. video codecs may only have IMemory and no mBlock
return;
}
- if (context->mReadWriteMapping->error() != C2_OK) {
+
+ // if we have mBlock and memory, then we will copy data from mBlock to hidlMemory
+ // e.g. audio codecs may only have mBlock and wanted to decrypt using hidlMemory
+ // and also wanted to re-use mBlock
+ if (context->mReadWriteMapping == nullptr || context->mReadWriteMapping->error() != C2_OK) {
ALOGW("extractMemoryFromContext: failed to map C2Block (%d)",
context->mReadWriteMapping->error());
return;