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

Commit 044ca630 authored by Arun Johnson's avatar Arun Johnson
Browse files

Checking API_SAME_INPUT_BUFFER support for large audio frame

Large audio frame support will be exposed only if the
implementation supports the following
1. feature API_SAME_INPUT_BUFFER
2. Param C2LargeFrame

Bug: 352550763

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: Ifee8731e3b33082ec45c5d42d281572fc0714828
parent 122d0b63
Loading
Loading
Loading
Loading
+10 −2
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);
+10 −2
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);
+10 −2
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);
+10 −2
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);