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

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

Snap for 11973804 from da6a7fa3 to 24Q3-release

Change-Id: I784103d08163465ae920931942283d3405fb0668
parents 63bba76c da6a7fa3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2633,6 +2633,15 @@ void CCodec::signalSetParameters(const sp<AMessage> &msg) {
    if (config->mInputSurface == nullptr
            && (property_get_bool("debug.stagefright.ccodec_delayed_params", false)
                    || comp->getName().find("c2.android.") == 0)) {
        std::vector<std::unique_ptr<C2Param>> localConfigUpdate;
        for (const std::unique_ptr<C2Param> &param : configUpdate) {
            if (param && param->coreIndex().coreIndex() == C2StreamSurfaceScalingInfo::CORE_INDEX) {
                localConfigUpdate.push_back(C2Param::Copy(*param));
            }
        }
        if (!localConfigUpdate.empty()) {
            (void)config->setParameters(comp, localConfigUpdate, C2_MAY_BLOCK);
        }
        mChannel->setParameters(configUpdate);
    } else {
        sp<AMessage> outputFormat = config->mOutputFormat;
+14 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <cstdint>
#include <cstring>
#include <optional>
#include <unordered_set>
#define LOG_TAG "AidlConversionEQ"
//#define LOG_NDEBUG 0

@@ -262,10 +263,21 @@ status_t AidlConversionEq::getParameter(EffectParamWriter& param) {
        }
        case EQ_PARAM_GET_NUM_OF_PRESETS: {
            Parameter aidlParam = VALUE_OR_RETURN_STATUS(getAidlParameter(Equalizer::presets));
            const auto& presets = VALUE_OR_RETURN_STATUS(GET_PARAMETER_SPECIFIC_FIELD(
            auto presets = VALUE_OR_RETURN_STATUS(GET_PARAMETER_SPECIFIC_FIELD(
                    aidlParam, Equalizer, equalizer, Equalizer::presets,
                    std::vector<Equalizer::Preset>));
            uint16_t num = presets.size();
            // it was assumed the presets index in the range of [0, NUM_OF_PRESETS - 1], so
            // filter out presets out of this range (one example is preset {-1, "custom"})
            std::erase_if(presets, [](const auto& preset) { return preset.index < 0; });
            // validate remaining indexes are unique [0, num - 1]
            std::unordered_set<uint16_t> uniqueIndices;
            const uint16_t num = presets.size();
            for (const auto& preset : presets) {
                if (preset.index >= num || 0 != uniqueIndices.count(preset.index)) {
                    return BAD_VALUE;
                }
                uniqueIndices.insert(preset.index);
            }
            return param.writeToValue(&num);
        }
        case EQ_PARAM_GET_PRESET_NAME: {
+0 −1
Original line number Diff line number Diff line
@@ -882,7 +882,6 @@ inline constexpr int32_t CONFIGURE_FLAG_USE_BLOCK_MODEL = 2;
inline constexpr int32_t CRYPTO_MODE_AES_CBC     = 2;
inline constexpr int32_t CRYPTO_MODE_AES_CTR     = 1;
inline constexpr int32_t CRYPTO_MODE_UNENCRYPTED = 0;
inline constexpr int32_t INFO_OUTPUT_BUFFERS_CHANGED = -3;
inline constexpr int32_t INFO_OUTPUT_FORMAT_CHANGED  = -2;
inline constexpr int32_t INFO_TRY_AGAIN_LATER        = -1;
inline constexpr int32_t VIDEO_SCALING_MODE_SCALE_TO_FIT               = 1;
+2 −2
Original line number Diff line number Diff line
@@ -392,7 +392,7 @@ TEST_F(ADataTest, AData_CopyMoveTest) {
    EXPECT_EQ(2L, _shared.use_count()); // still both u and _shared contains the object

    EXPECT_TRUE(u.clear());
    EXPECT_TRUE(_shared.unique()); // now only _shared contains the object
    EXPECT_EQ(1L, _shared.use_count()); // now only _shared contains the object

    EXPECT_TRUE(u.set(_constShared));
    EXPECT_EQ(2L, _constShared.use_count()); // even though it is const, we can add a use count
@@ -591,7 +591,7 @@ TEST_F(ADataTest, AData_RelaxedCopyMoveTest) {
    EXPECT_EQ(2L, _shared.use_count()); // still both u and _shared contains the object

    EXPECT_TRUE(u.clear());
    EXPECT_TRUE(_shared.unique()); // now only _shared contains the object
    EXPECT_EQ(1L, _shared.use_count()); // now only _shared contains the object

    EXPECT_TRUE(u.set(_constShared));
    EXPECT_EQ(2L, _constShared.use_count()); // even though it is const, we can add a use count
+0 −2
Original line number Diff line number Diff line
@@ -37,14 +37,12 @@ TEST(StaticStringViewTests, CreateTicket) {
    // const std::array<char,2> nonstatic = {'a', 'b'};
    // static_assert(can_assign<nonstatic>::value == false);
    static std::array<char, 2> nonconst = {'a', 'b'};
    static const std::array<char, 2> nonconstexpr = {'a', 'b'};
    static constexpr std::array<int, 2> nonchar = {1, 2};
    static constexpr size_t nonarray = 2;

    static_assert(CanCreate<nonconst>::value == false);
    static_assert(CanCreate<nonarray>::value == false);
    static_assert(CanCreate<nonchar>::value == false);
    static_assert(CanCreate<nonconstexpr>::value == false);

    static constexpr std::array<char, 2> scoped = {'a', 'b'};
    constexpr StaticStringView Ticket1 = StaticStringView::create<global>();
Loading