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

Commit 91873b54 authored by Yushin Cho's avatar Yushin Cho
Browse files

enc stat: map encoding stat level to enc stats

Bug: 205793764
Bug: 203696003
Test: cts
Change-Id: I88fb84f95b4ea3c9f297025e3886f35169a01610
parent 317de2c0
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -1443,6 +1443,27 @@ void CCodec::configure(const sp<AMessage> &msg) {
            config->mOutputFormat->setInt32("android._tunneled", 1);
        }

        // Convert an encoding statistics level to corresponding encoding statistics
        // kinds
        int32_t encodingStatisticsLevel = VIDEO_ENCODING_STATISTICS_LEVEL_NONE;
        if ((config->mDomain & Config::IS_ENCODER)
            && (config->mDomain & Config::IS_VIDEO)
            && msg->findInt32(KEY_VIDEO_ENCODING_STATISTICS_LEVEL, &encodingStatisticsLevel)) {
            // Higher level include all the enc stats belong to lower level.
            switch (encodingStatisticsLevel) {
                // case VIDEO_ENCODING_STATISTICS_LEVEL_2: // reserved for the future level 2
                                                           // with more enc stat kinds
                // Future extended encoding statistics for the level 2 should be added here
                case VIDEO_ENCODING_STATISTICS_LEVEL_1:
                    config->subscribeToConfigUpdate(comp,
                        {kParamIndexAverageBlockQuantization, kParamIndexPictureType});
                    break;
                case VIDEO_ENCODING_STATISTICS_LEVEL_NONE:
                    break;
            }
        }
        ALOGD("encoding statistics level = %d", encodingStatisticsLevel);

        ALOGD("setup formats input: %s",
                config->mInputFormat->debugString().c_str());
        ALOGD("setup formats output: %s",
+5 −5
Original line number Diff line number Diff line
@@ -363,11 +363,6 @@ struct CCodecConfig {
            const std::vector<std::string> &names,
            c2_blocking_t blocking = C2_DONT_BLOCK);

private:

    /// initializes the standard MediaCodec to Codec 2.0 params mapping
    void initializeStandardParams();

    /// Adds indices to the subscribed indices, and updated subscription to component
    /// \param blocking blocking mode to use with the component
    status_t subscribeToConfigUpdate(
@@ -375,6 +370,11 @@ private:
            const std::vector<C2Param::Index> &indices,
            c2_blocking_t blocking = C2_DONT_BLOCK);

private:

    /// initializes the standard MediaCodec to Codec 2.0 params mapping
    void initializeStandardParams();

    /// Gets SDK format from codec 2.0 reflected configuration
    /// \param domain input/output bitmask
    sp<AMessage> getFormatForDomain(