From dea55e3d0722c258ff91243d827578fcee6701e5 Mon Sep 17 00:00:00 2001 From: Abhay Singh Gill Date: Sat, 2 Aug 2025 12:50:11 +0530 Subject: [PATCH] Revert "MultiAccessUnit reflector helper allocated once per ComponentStore" Breaks dolby decoders This reverts commit 07b6b1570b4d4b77bfd5ec12aa56dda2e449ee6b. --- media/codec2/hal/aidl/ComponentStore.cpp | 10 ++-------- .../hal/aidl/include/codec2/aidl/ComponentStore.h | 3 --- media/codec2/hal/hidl/1.0/utils/ComponentStore.cpp | 12 +++--------- .../utils/include/codec2/hidl/1.0/ComponentStore.h | 3 --- media/codec2/hal/hidl/1.1/utils/ComponentStore.cpp | 12 +++--------- .../utils/include/codec2/hidl/1.1/ComponentStore.h | 3 --- media/codec2/hal/hidl/1.2/utils/ComponentStore.cpp | 11 ++--------- .../utils/include/codec2/hidl/1.2/ComponentStore.h | 3 --- 8 files changed, 10 insertions(+), 47 deletions(-) diff --git a/media/codec2/hal/aidl/ComponentStore.cpp b/media/codec2/hal/aidl/ComponentStore.cpp index 90d57eb3c3..adb0b6a376 100644 --- a/media/codec2/hal/aidl/ComponentStore.cpp +++ b/media/codec2/hal/aidl/ComponentStore.cpp @@ -156,13 +156,6 @@ ComponentStore::ComponentStore(const std::shared_ptr& store) mParamReflectors.push_back(paramReflector); } #endif - // MultiAccessUnit reflector helper is allocated once per store. - // All components in this store can reuse this reflector helper. - if (MultiAccessUnitHelper::isEnabledOnPlatform()) { - std::shared_ptr helper = std::make_shared(); - mParamReflectors.push_back(helper); - mMultiAccessUnitReflector = helper; - } // Retrieve supported parameters from store using namespace std::placeholders; @@ -253,7 +246,8 @@ std::shared_ptr ComponentStore::tryCreateMultiAccessUn std::shared_ptr multiAccessReflector(new C2ReflectorHelper()); multiAccessUnitIntf = std::make_shared( c2interface, - mMultiAccessUnitReflector); + multiAccessReflector); + mParamReflectors.push_back(multiAccessReflector); } } } diff --git a/media/codec2/hal/aidl/include/codec2/aidl/ComponentStore.h b/media/codec2/hal/aidl/include/codec2/aidl/ComponentStore.h index bb4c596cba..0e8ac41dce 100644 --- a/media/codec2/hal/aidl/include/codec2/aidl/ComponentStore.h +++ b/media/codec2/hal/aidl/include/codec2/aidl/ComponentStore.h @@ -127,9 +127,6 @@ struct ComponentStore : public BnComponentStore { std::shared_ptr mStore; std::vector> mParamReflectors; - // Reflector helper for MultiAccessUnitHelper - std::shared_ptr mMultiAccessUnitReflector; - std::map> mStructDescriptors; std::set mUnsupportedStructDescriptors; std::set mLoadedInterfaces; diff --git a/media/codec2/hal/hidl/1.0/utils/ComponentStore.cpp b/media/codec2/hal/hidl/1.0/utils/ComponentStore.cpp index 7e79147c91..238f78f227 100644 --- a/media/codec2/hal/hidl/1.0/utils/ComponentStore.cpp +++ b/media/codec2/hal/hidl/1.0/utils/ComponentStore.cpp @@ -146,14 +146,6 @@ ComponentStore::ComponentStore(const std::shared_ptr& store) } #endif - // MultiAccessUnit reflector helper is allocated once per store. - // All components in this store can reuse this reflector helper. - if (MultiAccessUnitHelper::isEnabledOnPlatform()) { - std::shared_ptr helper = std::make_shared(); - mParamReflectors.push_back(helper); - mMultiAccessUnitReflector = helper; - } - // Retrieve supported parameters from store using namespace std::placeholders; mInit = mConfigurable->init(mParameterCache); @@ -239,7 +231,9 @@ std::shared_ptr ComponentStore::tryCreateMultiAccessUn std::shared_ptr multiAccessReflector(new C2ReflectorHelper()); multiAccessUnitIntf = std::make_shared( c2interface, - mMultiAccessUnitReflector); + multiAccessReflector); + mParamReflectors.push_back(multiAccessReflector); + } } } diff --git a/media/codec2/hal/hidl/1.0/utils/include/codec2/hidl/1.0/ComponentStore.h b/media/codec2/hal/hidl/1.0/utils/include/codec2/hidl/1.0/ComponentStore.h index 028238bd24..07ffa219ec 100644 --- a/media/codec2/hal/hidl/1.0/utils/include/codec2/hidl/1.0/ComponentStore.h +++ b/media/codec2/hal/hidl/1.0/utils/include/codec2/hidl/1.0/ComponentStore.h @@ -131,9 +131,6 @@ struct ComponentStore : public IComponentStore { std::shared_ptr mStore; std::vector> mParamReflectors; - // Reflector helper for MultiAccessUnitHelper - std::shared_ptr mMultiAccessUnitReflector; - std::map> mStructDescriptors; std::set mUnsupportedStructDescriptors; std::set mLoadedInterfaces; diff --git a/media/codec2/hal/hidl/1.1/utils/ComponentStore.cpp b/media/codec2/hal/hidl/1.1/utils/ComponentStore.cpp index 1125479dac..a715fdc7f6 100644 --- a/media/codec2/hal/hidl/1.1/utils/ComponentStore.cpp +++ b/media/codec2/hal/hidl/1.1/utils/ComponentStore.cpp @@ -146,14 +146,6 @@ ComponentStore::ComponentStore(const std::shared_ptr& store) } #endif - // MultiAccessUnit reflector helper is allocated once per store. - // All components in this store can reuse this reflector helper. - if (MultiAccessUnitHelper::isEnabledOnPlatform()) { - std::shared_ptr helper = std::make_shared(); - mParamReflectors.push_back(helper); - mMultiAccessUnitReflector = helper; - } - // Retrieve supported parameters from store using namespace std::placeholders; mInit = mConfigurable->init(mParameterCache); @@ -235,11 +227,13 @@ std::shared_ptr ComponentStore::tryCreateMultiAccessUn break; } } + if (!isComponentSupportsLargeAudioFrame) { std::shared_ptr multiAccessReflector(new C2ReflectorHelper()); multiAccessUnitIntf = std::make_shared( c2interface, - mMultiAccessUnitReflector); + multiAccessReflector); + mParamReflectors.push_back(multiAccessReflector); } } } diff --git a/media/codec2/hal/hidl/1.1/utils/include/codec2/hidl/1.1/ComponentStore.h b/media/codec2/hal/hidl/1.1/utils/include/codec2/hidl/1.1/ComponentStore.h index b0231151b3..5dcb359d4d 100644 --- a/media/codec2/hal/hidl/1.1/utils/include/codec2/hidl/1.1/ComponentStore.h +++ b/media/codec2/hal/hidl/1.1/utils/include/codec2/hidl/1.1/ComponentStore.h @@ -139,9 +139,6 @@ struct ComponentStore : public IComponentStore { std::shared_ptr mStore; std::vector> mParamReflectors; - // Reflector helper for MultiAccessUnitHelper - std::shared_ptr mMultiAccessUnitReflector; - std::map> mStructDescriptors; std::set mUnsupportedStructDescriptors; std::set mLoadedInterfaces; diff --git a/media/codec2/hal/hidl/1.2/utils/ComponentStore.cpp b/media/codec2/hal/hidl/1.2/utils/ComponentStore.cpp index b0bf06289f..ca047b043a 100644 --- a/media/codec2/hal/hidl/1.2/utils/ComponentStore.cpp +++ b/media/codec2/hal/hidl/1.2/utils/ComponentStore.cpp @@ -146,14 +146,6 @@ ComponentStore::ComponentStore(const std::shared_ptr& store) } #endif - // MultiAccessUnit reflector helper is allocated once per store. - // All components in this store can reuse this reflector helper. - if (MultiAccessUnitHelper::isEnabledOnPlatform()) { - std::shared_ptr helper = std::make_shared(); - mParamReflectors.push_back(helper); - mMultiAccessUnitReflector = helper; - } - // Retrieve supported parameters from store using namespace std::placeholders; mInit = mConfigurable->init(mParameterCache); @@ -239,7 +231,8 @@ std::shared_ptr ComponentStore::tryCreateMultiAccessUn std::shared_ptr multiAccessReflector(new C2ReflectorHelper()); multiAccessUnitIntf = std::make_shared( c2interface, - mMultiAccessUnitReflector); + multiAccessReflector); + mParamReflectors.push_back(multiAccessReflector); } } } diff --git a/media/codec2/hal/hidl/1.2/utils/include/codec2/hidl/1.2/ComponentStore.h b/media/codec2/hal/hidl/1.2/utils/include/codec2/hidl/1.2/ComponentStore.h index a7e043bc5f..16a524093c 100644 --- a/media/codec2/hal/hidl/1.2/utils/include/codec2/hidl/1.2/ComponentStore.h +++ b/media/codec2/hal/hidl/1.2/utils/include/codec2/hidl/1.2/ComponentStore.h @@ -146,9 +146,6 @@ struct ComponentStore : public IComponentStore { std::shared_ptr mStore; std::vector> mParamReflectors; - // Reflector helper for MultiAccessUnitHelper - std::shared_ptr mMultiAccessUnitReflector; - std::map> mStructDescriptors; std::set mUnsupportedStructDescriptors; std::set mLoadedInterfaces;