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

Commit 2a6a2257 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8665969 from e054011b to tm-release

Change-Id: I8db6fe53ebcbec034fefd3a972518a87ef074832
parents 0ee330f8 e054011b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ cc_library_shared {
        "media_ndk_headers",
    ],

    static_libs: [
        "SurfaceFlingerProperties",
    ],

    shared_libs: [
        "android.hardware.cas.native@1.0",
        "android.hardware.drm@1.0",
+48 −2
Original line number Diff line number Diff line
@@ -615,10 +615,30 @@ void CCodecConfig::initializeStandardParams() {
    add(ConfigMapper("csd-0",           C2_PARAMKEY_INIT_DATA,       "value")
        .limitTo(D::OUTPUT & D::READ));

    add(ConfigMapper(KEY_HDR10_PLUS_INFO, C2_PARAMKEY_INPUT_HDR10_PLUS_INFO, "value")
    deprecated(ConfigMapper(KEY_HDR10_PLUS_INFO, C2_PARAMKEY_INPUT_HDR10_PLUS_INFO, "value")
        .limitTo(D::VIDEO & D::PARAM & D::INPUT));

    add(ConfigMapper(KEY_HDR10_PLUS_INFO, C2_PARAMKEY_OUTPUT_HDR10_PLUS_INFO, "value")
    deprecated(ConfigMapper(KEY_HDR10_PLUS_INFO, C2_PARAMKEY_OUTPUT_HDR10_PLUS_INFO, "value")
        .limitTo(D::VIDEO & D::OUTPUT));

    add(ConfigMapper(
            std::string(C2_PARAMKEY_INPUT_HDR_DYNAMIC_INFO) + ".type",
            C2_PARAMKEY_INPUT_HDR_DYNAMIC_INFO, "type")
        .limitTo(D::VIDEO & D::PARAM & D::INPUT));

    add(ConfigMapper(
            std::string(C2_PARAMKEY_INPUT_HDR_DYNAMIC_INFO) + ".data",
            C2_PARAMKEY_INPUT_HDR_DYNAMIC_INFO, "data")
        .limitTo(D::VIDEO & D::PARAM & D::INPUT));

    add(ConfigMapper(
            std::string(C2_PARAMKEY_OUTPUT_HDR_DYNAMIC_INFO) + ".type",
            C2_PARAMKEY_OUTPUT_HDR_DYNAMIC_INFO, "type")
        .limitTo(D::VIDEO & D::OUTPUT));

    add(ConfigMapper(
            std::string(C2_PARAMKEY_OUTPUT_HDR_DYNAMIC_INFO) + ".data",
            C2_PARAMKEY_OUTPUT_HDR_DYNAMIC_INFO, "data")
        .limitTo(D::VIDEO & D::OUTPUT));

    add(ConfigMapper(C2_PARAMKEY_TEMPORAL_LAYERING, C2_PARAMKEY_TEMPORAL_LAYERING, "")
@@ -1570,6 +1590,22 @@ sp<AMessage> CCodecConfig::getFormatForDomain(
            msg->removeEntryAt(msg->findEntryByName("cta861.max-cll"));
            msg->removeEntryAt(msg->findEntryByName("cta861.max-fall"));
        }

        // HDR dynamic info
        std::string keyPrefix = input ? C2_PARAMKEY_INPUT_HDR_DYNAMIC_INFO
                                      : C2_PARAMKEY_OUTPUT_HDR_DYNAMIC_INFO;
        std::string typeKey = keyPrefix + ".type";
        std::string dataKey = keyPrefix + ".data";
        int32_t type;
        sp<ABuffer> data;
        if (msg->findInt32(typeKey.c_str(), &type)
                && msg->findBuffer(dataKey.c_str(), &data)) {
            if (type == HDR_DYNAMIC_METADATA_TYPE_SMPTE_2094_40) {
                msg->setBuffer(KEY_HDR10_PLUS_INFO, data);
                msg->removeEntryAt(msg->findEntryByName(typeKey.c_str()));
                msg->removeEntryAt(msg->findEntryByName(dataKey.c_str()));
            }
        }
    }

    ALOGV("converted to SDK values as %s", msg->debugString().c_str());
@@ -1771,6 +1807,16 @@ ReflectedParamUpdater::Dict CCodecConfig::getReflectedFormat(
                params->setFloat("cta861.max-fall", meta->sType1.mMaxFrameAverageLightLevel);
            }
        }

        sp<ABuffer> hdrDynamicInfo;
        if (params->findBuffer(KEY_HDR10_PLUS_INFO, &hdrDynamicInfo)) {
            for (const std::string &prefix : { C2_PARAMKEY_INPUT_HDR_DYNAMIC_INFO,
                                               C2_PARAMKEY_OUTPUT_HDR_DYNAMIC_INFO }) {
                params->setInt32((prefix + ".type").c_str(),
                                 HDR_DYNAMIC_METADATA_TYPE_SMPTE_2094_40);
                params->setBuffer((prefix + ".data").c_str(), hdrDynamicInfo);
            }
        }
    }

    // this is to verify that we set proper signedness for standard parameters
+9 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <OMX_Video.h>
#include <OMX_VideoExt.h>
#include <OMX_AsString.h>
#include <SurfaceFlingerProperties.sysprop.h>

#include <android/hardware/media/omx/1.0/IOmx.h>
#include <android/hardware/media/omx/1.0/IOmxObserver.h>
@@ -159,6 +160,12 @@ bool addSupportedProfileLevels(
    // TODO: directly check this from the component interface
    supports10Bit = (supportsHdr || supportsHdr10Plus);

    // If the device doesn't support HDR display, then no codec on the device
    // can advertise support for HDR profiles.
    // Default to true to maintain backward compatibility
    auto ret = sysprop::SurfaceFlingerProperties::has_HDR_display();
    bool hasHDRDisplay = ret.has_value() ? *ret : true;

    bool added = false;

    for (C2Value::Primitive profile : profileQuery[0].values.values) {
@@ -184,8 +191,8 @@ bool addSupportedProfileLevels(
        if (mapper && mapper->mapProfile(pl.profile, &sdkProfile)
                && mapper->mapLevel(pl.level, &sdkLevel)) {
            caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel);
            // also list HDR profiles if component supports HDR
            if (supportsHdr) {
            // also list HDR profiles if component supports HDR and device has HDR display
            if (supportsHdr && hasHDRDisplay) {
                auto hdrMapper = C2Mapper::GetHdrProfileLevelMapper(trait.mediaType);
                if (hdrMapper && hdrMapper->mapProfile(pl.profile, &sdkProfile)) {
                    caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel);
+1 −1
Original line number Diff line number Diff line
@@ -3974,7 +3974,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
            if (mTunneled && (mTunnelPeekState == TunnelPeekState::kLegacyMode)) {
                sp<AMessage> params = new AMessage;
                params->setInt32("android._tunnel-peek-set-legacy", 1);
                setParameters(params);
                onSetParameters(params);
            }

            int32_t background = 0;
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ namespace SessionConfigurationUtils {
int32_t PERF_CLASS_LEVEL =
        property_get_int32("ro.odm.build.media_performance_class", 0);

bool IS_PERF_CLASS = (PERF_CLASS_LEVEL == SDK_VERSION_S);
bool IS_PERF_CLASS = (PERF_CLASS_LEVEL >= SDK_VERSION_S);

camera3::Size getMaxJpegResolution(const CameraMetadata &metadata,
        bool ultraHighResolution) {