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

Commit 3dc64d70 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ifee8731e,Idf67d9ce into main

* changes:
  Checking API_SAME_INPUT_BUFFER support for large audio frame
  Changing interface creation for Large audio frame
parents 6c356f0e 044ca630
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -212,12 +212,20 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
    if (c2interface == nullptr) {
        return nullptr;
    }
    // Framework support for Large audio frame feature depends on:
    // 1. All feature flags enabled on platform
    // 2. The capability of the implementation to use the same input buffer
    //    for different C2Work (C2Config::api_feature_t::API_SAME_INPUT_BUFFER)
    // 3. Implementation does not inherently support C2LargeFrame::output::PARAM_TYPE param.
    if (MultiAccessUnitHelper::isEnabledOnPlatform()) {
        c2_status_t err = C2_OK;
        C2ComponentDomainSetting domain;
        std::vector<std::unique_ptr<C2Param>> heapParams;
        err = c2interface->query_vb({&domain}, {}, C2_MAY_BLOCK, &heapParams);
        if (err == C2_OK && (domain.value == C2Component::DOMAIN_AUDIO)) {
        C2ApiFeaturesSetting features = (C2Config::api_feature_t)0;
        err = c2interface->query_vb({&domain, &features}, {}, C2_MAY_BLOCK, &heapParams);
        if (err == C2_OK
                && (domain.value == C2Component::DOMAIN_AUDIO)
                && ((features.value & C2Config::api_feature_t::API_SAME_INPUT_BUFFER) != 0)) {
            std::vector<std::shared_ptr<C2ParamDescriptor>> params;
            bool isComponentSupportsLargeAudioFrame = false;
            c2interface->querySupportedParams_nb(&params);
@@ -232,9 +240,11 @@ 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,
                        std::static_pointer_cast<C2ReflectorHelper>(mParamReflectors[0]));
                        multiAccessReflector);
                mParamReflectors.push_back(multiAccessReflector);
            }
        }
    }
+14 −3
Original line number Diff line number Diff line
@@ -207,12 +207,20 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
    if (c2interface == nullptr) {
        return nullptr;
    }
    // Framework support for Large audio frame feature depends on:
    // 1. All feature flags enabled on platform
    // 2. The capability of the implementation to use the same input buffer
    //    for different C2Work (C2Config::api_feature_t::API_SAME_INPUT_BUFFER)
    // 3. Implementation does not inherently support C2LargeFrame::output::PARAM_TYPE param.
    if (MultiAccessUnitHelper::isEnabledOnPlatform()) {
        c2_status_t err = C2_OK;
        C2ComponentDomainSetting domain;
        std::vector<std::unique_ptr<C2Param>> heapParams;
        err = c2interface->query_vb({&domain}, {}, C2_MAY_BLOCK, &heapParams);
        if (err == C2_OK && (domain.value == C2Component::DOMAIN_AUDIO)) {
        C2ApiFeaturesSetting features = (C2Config::api_feature_t)0;
        err = c2interface->query_vb({&domain, &features}, {}, C2_MAY_BLOCK, &heapParams);
        if (err == C2_OK
                && (domain.value == C2Component::DOMAIN_AUDIO)
                && ((features.value & C2Config::api_feature_t::API_SAME_INPUT_BUFFER) != 0)) {
            std::vector<std::shared_ptr<C2ParamDescriptor>> params;
            bool isComponentSupportsLargeAudioFrame = false;
            c2interface->querySupportedParams_nb(&params);
@@ -223,9 +231,12 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
                }
            }
            if (!isComponentSupportsLargeAudioFrame) {
                std::shared_ptr<C2ReflectorHelper> multiAccessReflector(new C2ReflectorHelper());
                multiAccessUnitIntf = std::make_shared<MultiAccessUnitInterface>(
                        c2interface,
                        std::static_pointer_cast<C2ReflectorHelper>(mParamReflectors[0]));
                        multiAccessReflector);
                mParamReflectors.push_back(multiAccessReflector);

            }
        }
    }
+13 −3
Original line number Diff line number Diff line
@@ -207,12 +207,20 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
    if (c2interface == nullptr) {
        return nullptr;
    }
    // Framework support for Large audio frame feature depends on:
    // 1. All feature flags enabled on platform
    // 2. The capability of the implementation to use the same input buffer
    //    for different C2Work (C2Config::api_feature_t::API_SAME_INPUT_BUFFER)
    // 3. Implementation does not inherently support C2LargeFrame::output::PARAM_TYPE param.
    if (MultiAccessUnitHelper::isEnabledOnPlatform()) {
        c2_status_t err = C2_OK;
        C2ComponentDomainSetting domain;
        std::vector<std::unique_ptr<C2Param>> heapParams;
        err = c2interface->query_vb({&domain}, {}, C2_MAY_BLOCK, &heapParams);
        if (err == C2_OK && (domain.value == C2Component::DOMAIN_AUDIO)) {
        C2ApiFeaturesSetting features = (C2Config::api_feature_t)0;
        err = c2interface->query_vb({&domain, &features}, {}, C2_MAY_BLOCK, &heapParams);
        if (err == C2_OK
                && (domain.value == C2Component::DOMAIN_AUDIO)
                && ((features.value & C2Config::api_feature_t::API_SAME_INPUT_BUFFER) != 0)) {
            std::vector<std::shared_ptr<C2ParamDescriptor>> params;
            bool isComponentSupportsLargeAudioFrame = false;
            c2interface->querySupportedParams_nb(&params);
@@ -224,9 +232,11 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
            }

            if (!isComponentSupportsLargeAudioFrame) {
                std::shared_ptr<C2ReflectorHelper> multiAccessReflector(new C2ReflectorHelper());
                multiAccessUnitIntf = std::make_shared<MultiAccessUnitInterface>(
                        c2interface,
                        std::static_pointer_cast<C2ReflectorHelper>(mParamReflectors[0]));
                        multiAccessReflector);
                mParamReflectors.push_back(multiAccessReflector);
            }
        }
    }
+13 −3
Original line number Diff line number Diff line
@@ -207,12 +207,20 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
    if (c2interface == nullptr) {
        return nullptr;
    }
    // Framework support for Large audio frame feature depends on:
    // 1. All feature flags enabled on platform
    // 2. The capability of the implementation to use the same input buffer
    //    for different C2Work (C2Config::api_feature_t::API_SAME_INPUT_BUFFER)
    // 3. Implementation does not inherently support C2LargeFrame::output::PARAM_TYPE param.
    if (MultiAccessUnitHelper::isEnabledOnPlatform()) {
        c2_status_t err = C2_OK;
        C2ComponentDomainSetting domain;
        std::vector<std::unique_ptr<C2Param>> heapParams;
        err = c2interface->query_vb({&domain}, {}, C2_MAY_BLOCK, &heapParams);
        if (err == C2_OK && (domain.value == C2Component::DOMAIN_AUDIO)) {
        C2ApiFeaturesSetting features = (C2Config::api_feature_t)0;
        err = c2interface->query_vb({&domain, &features}, {}, C2_MAY_BLOCK, &heapParams);
        if (err == C2_OK
                && (domain.value == C2Component::DOMAIN_AUDIO)
                && ((features.value & C2Config::api_feature_t::API_SAME_INPUT_BUFFER) != 0)) {
            std::vector<std::shared_ptr<C2ParamDescriptor>> params;
            bool isComponentSupportsLargeAudioFrame = false;
            c2interface->querySupportedParams_nb(&params);
@@ -223,9 +231,11 @@ std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUn
                }
            }
            if (!isComponentSupportsLargeAudioFrame) {
                std::shared_ptr<C2ReflectorHelper> multiAccessReflector(new C2ReflectorHelper());
                multiAccessUnitIntf = std::make_shared<MultiAccessUnitInterface>(
                        c2interface,
                        std::static_pointer_cast<C2ReflectorHelper>(mParamReflectors[0]));
                        multiAccessReflector);
                mParamReflectors.push_back(multiAccessReflector);
            }
        }
    }