diff options
| author | 2025-02-24 02:45:01 -0800 | |
|---|---|---|
| committer | 2025-02-24 02:45:01 -0800 | |
| commit | e7400713aece81522a25dcff6ff04986685ca725 (patch) | |
| tree | 796313bb29079e8154570befaffb28616def095a | |
| parent | 332641fc24cb79a58e658a25d5963f3059d66837 (diff) | |
| parent | cfe728f0b9a15b2c2da274d68af8724eef64bd08 (diff) | |
Merge "Remove false warning message while extracting memory" into main
| -rw-r--r-- | media/jni/android_media_MediaCodec.cpp | 11 |
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; |