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

Commit d0e4453b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "CCodecBufferChannel: remove rendering depth" into main am: 055f8d2e am: 5e7432c9

parents 2260c5b6 5e7432c9
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -125,6 +125,13 @@ flag {
  bug: "325549730"
  bug: "325549730"
}
}


flag {
  name: "rendering_depth_removal"
  namespace: "codec_fwk"
  description: "Feature flag for removing rendering depth"
  bug: "275527219"
}

flag {
flag {
  name: "secure_codecs_require_crypto"
  name: "secure_codecs_require_crypto"
  namespace: "codec_fwk"
  namespace: "codec_fwk"
+1 −0
Original line number Original line Diff line number Diff line
@@ -50,6 +50,7 @@ cc_library_shared {
    ],
    ],


    static_libs: [
    static_libs: [
        "libPlatformProperties",
        "libSurfaceFlingerProperties",
        "libSurfaceFlingerProperties",
        "aconfig_mediacodec_flags_c_lib",
        "aconfig_mediacodec_flags_c_lib",
        "android.media.codec-aconfig-cc",
        "android.media.codec-aconfig-cc",
+13 −2
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@


#include <android/hardware/cas/native/1.0/IDescrambler.h>
#include <android/hardware/cas/native/1.0/IDescrambler.h>
#include <android/hardware/drm/1.0/types.h>
#include <android/hardware/drm/1.0/types.h>
#include <android/sysprop/MediaProperties.sysprop.h>
#include <android-base/parseint.h>
#include <android-base/parseint.h>
#include <android-base/properties.h>
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/stringprintf.h>
@@ -207,8 +208,18 @@ CCodecBufferChannel::CCodecBufferChannel(
        Mutexed<BlockPools>::Locked pools(mBlockPools);
        Mutexed<BlockPools>::Locked pools(mBlockPools);
        pools->outputPoolId = C2BlockPool::BASIC_LINEAR;
        pools->outputPoolId = C2BlockPool::BASIC_LINEAR;
    }
    }
    std::string value = GetServerConfigurableFlag("media_native", "ccodec_rendering_depth", "3");
    if (android::media::codec::provider_->rendering_depth_removal()) {
        constexpr int kAndroidApi202404 = 202404;
        int vendorVersion = ::android::base::GetIntProperty("ro.vendor.api_level", -1);
        using ::android::sysprop::MediaProperties::codec2_remove_rendering_depth;
        if (vendorVersion > kAndroidApi202404 || codec2_remove_rendering_depth().value_or(false)) {
            mRenderingDepth = 0;
        }
    } else {
        std::string value = GetServerConfigurableFlag(
                "media_native", "ccodec_rendering_depth", "3");
        android::base::ParseInt(value, &mRenderingDepth);
        android::base::ParseInt(value, &mRenderingDepth);
    }
    mOutputSurface.lock()->maxDequeueBuffers = kSmoothnessFactor + mRenderingDepth;
    mOutputSurface.lock()->maxDequeueBuffers = kSmoothnessFactor + mRenderingDepth;
}
}