Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07b6b157 authored by Arun Johnson's avatar Arun Johnson
Browse files

MultiAccessUnit reflector helper allocated once per ComponentStore

Bug: 365014948
Flag: EXEMPT bugfix

Test: atest android.mediav2.cts.CodecDecoderMultiAccessUnitTest
Test: atest android.mediav2.cts.CodecEncoderMultiAccessUnitTest
Test: atest android.mediav2.cts.CodecDecoderBlockModelMultiAccessUnitTest
Test: atest android.media.drmframework.cts.CodecDecoderMultiAccessUnitDrmTest
Change-Id: Icdf64821f81f09726467500667978dce6aa32857
parent a601eccb
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -153,6 +153,13 @@ ComponentStore::ComponentStore(const std::shared_ptr<C2ComponentStore>& 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<C2ReflectorHelper> helper = std::make_shared<C2ReflectorHelper>();
        mParamReflectors.push_back(helper);
        mMultiAccessUnitReflector = helper;
    }

    // Retrieve supported parameters from store
    using namespace std::placeholders;
@@ -240,11 +247,9 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
                // param reflectors. Currently filters work on video domain only,
                // and the MultiAccessUnitHelper is only enabled on audio domain;
                // thus we pass the component's param reflector, which is mParamReflectors[0].
                std::shared_ptr<C2ReflectorHelper> multiAccessReflector(new C2ReflectorHelper());
                multiAccessUnitIntf = std::make_shared<MultiAccessUnitInterface>(
                        c2interface,
                        multiAccessReflector);
                mParamReflectors.push_back(multiAccessReflector);
                        mMultiAccessUnitReflector);
            }
        }
    }
+3 −0
Original line number Diff line number Diff line
@@ -120,6 +120,9 @@ protected:
    std::shared_ptr<C2ComponentStore> mStore;
    std::vector<std::shared_ptr<C2ParamReflector>> mParamReflectors;

    // Reflector helper for MultiAccessUnitHelper
    std::shared_ptr<C2ReflectorHelper> mMultiAccessUnitReflector;

    std::map<C2Param::CoreIndex, std::shared_ptr<C2StructDescriptor>> mStructDescriptors;
    std::set<C2Param::CoreIndex> mUnsupportedStructDescriptors;
    std::set<C2String> mLoadedInterfaces;
+9 −4
Original line number Diff line number Diff line
@@ -149,6 +149,14 @@ ComponentStore::ComponentStore(const std::shared_ptr<C2ComponentStore>& 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<C2ReflectorHelper> helper = std::make_shared<C2ReflectorHelper>();
        mParamReflectors.push_back(helper);
        mMultiAccessUnitReflector = helper;
    }

    // Retrieve supported parameters from store
    using namespace std::placeholders;
    mInit = mConfigurable->init(mParameterCache);
@@ -231,12 +239,9 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
                }
            }
            if (!isComponentSupportsLargeAudioFrame) {
                std::shared_ptr<C2ReflectorHelper> multiAccessReflector(new C2ReflectorHelper());
                multiAccessUnitIntf = std::make_shared<MultiAccessUnitInterface>(
                        c2interface,
                        multiAccessReflector);
                mParamReflectors.push_back(multiAccessReflector);

                        mMultiAccessUnitReflector);
            }
        }
    }
+3 −0
Original line number Diff line number Diff line
@@ -124,6 +124,9 @@ protected:
    std::shared_ptr<C2ComponentStore> mStore;
    std::vector<std::shared_ptr<C2ParamReflector>> mParamReflectors;

    // Reflector helper for MultiAccessUnitHelper
    std::shared_ptr<C2ReflectorHelper> mMultiAccessUnitReflector;

    std::map<C2Param::CoreIndex, std::shared_ptr<C2StructDescriptor>> mStructDescriptors;
    std::set<C2Param::CoreIndex> mUnsupportedStructDescriptors;
    std::set<C2String> mLoadedInterfaces;
+9 −4
Original line number Diff line number Diff line
@@ -149,6 +149,14 @@ ComponentStore::ComponentStore(const std::shared_ptr<C2ComponentStore>& 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<C2ReflectorHelper> helper = std::make_shared<C2ReflectorHelper>();
        mParamReflectors.push_back(helper);
        mMultiAccessUnitReflector = helper;
    }

    // Retrieve supported parameters from store
    using namespace std::placeholders;
    mInit = mConfigurable->init(mParameterCache);
@@ -230,13 +238,10 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
                    break;
                }
            }

            if (!isComponentSupportsLargeAudioFrame) {
                std::shared_ptr<C2ReflectorHelper> multiAccessReflector(new C2ReflectorHelper());
                multiAccessUnitIntf = std::make_shared<MultiAccessUnitInterface>(
                        c2interface,
                        multiAccessReflector);
                mParamReflectors.push_back(multiAccessReflector);
                        mMultiAccessUnitReflector);
            }
        }
    }
Loading