Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vts cases failure #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions c2_components/src/mfx_c2_decoder_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1254,20 +1254,22 @@ mfxStatus MfxC2DecoderComponent::InitDecoder(std::shared_ptr<C2BlockPool> c2_all
MfxFourCCToGralloc(m_mfxVideoParams.mfx.FrameInfo.FourCC),
mem_usage, &out_block);

if (res == C2_OK)
{
if (res == C2_OK) {
// Before android 15, it's using BUFFER QUEUE for surface allocation, check if
// surface is allocated by BUFFER QUEUE with igbp_id and igbp_slot
#if PLATFORM_SDK_VERSION <= 34
uint32_t width, height, format, stride, igbp_slot, generation;
uint64_t usage, igbp_id;
android::_UnwrapNativeCodec2GrallocMetadata(out_block->handle(), &width, &height, &format, &usage,
&stride, &generation, &igbp_id, &igbp_slot);
// For android 15, it's using IGBA instead of BQ, we can not check if
// surface is allocated by IGBA by igbp_id and igbp_slot
#if PLATFORM_SDK_VERSION <= 34
if ((!igbp_id && !igbp_slot) || (!igbp_id && igbp_slot == 0xffffffff))
{
if ((!igbp_id && !igbp_slot) || (!igbp_id && igbp_slot == 0xffffffff)) {
// No surface & BQ
m_mfxVideoParams.IOPattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
}
#else // For android 15, it's using IGBA and Ahwb buffer for surface allocation
if(!C2AllocatorAhwb::CheckHandle(out_block->handle())) {
m_mfxVideoParams.IOPattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
}
#endif
}
}
Expand Down