Loading media/codec2/sfplugin/CCodec.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -1478,8 +1478,12 @@ void CCodec::configure(const sp<AMessage> &msg) { // 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}); config->subscribeToConfigUpdate( comp, { C2AndroidStreamAverageBlockQuantizationInfo::output::PARAM_TYPE, C2StreamPictureTypeInfo::output::PARAM_TYPE, }); break; case VIDEO_ENCODING_STATISTICS_LEVEL_NONE: break; Loading media/codec2/sfplugin/CCodecConfig.cpp +35 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "CCodecConfig" #include <initializer_list> #include <cutils/properties.h> #include <log/log.h> #include <utils/NativeHandle.h> Loading Loading @@ -1112,7 +1115,7 @@ status_t CCodecConfig::initialize( if (domain.value == C2Component::DOMAIN_VIDEO) { addLocalParam(new C2AndroidStreamAverageBlockQuantizationInfo::output(0u, 0), C2_PARAMKEY_AVERAGE_QP); addLocalParam(new C2StreamPictureTypeMaskInfo::output(0u, 0), addLocalParam(new C2StreamPictureTypeInfo::output(0u, 0), C2_PARAMKEY_PICTURE_TYPE); } } Loading Loading @@ -1149,6 +1152,17 @@ status_t CCodecConfig::initialize( } } // Parameters that are not subscribed initially, but can be subscribed // upon explicit request. static const std::initializer_list<C2Param::Index> kOptionalParams = { C2AndroidStreamAverageBlockQuantizationInfo::output::PARAM_TYPE, C2StreamPictureTypeInfo::output::PARAM_TYPE, }; for (const C2Param::Index &index : kOptionalParams) { mSubscribedIndices.erase(index); } subscribeToConfigUpdate(configurable, {}, C2_MAY_BLOCK); return OK; } Loading Loading @@ -1180,6 +1194,20 @@ status_t CCodecConfig::subscribeToConfigUpdate( ALOGV("Subscribed to %zu params", mSubscribedIndices.size()); mSubscribedIndicesSize = mSubscribedIndices.size(); } #if defined(LOG_NDEBUG) && !LOG_NDEBUG ALOGV("subscribed to %zu params:", mSubscribedIndices.size()); std::stringstream ss; for (const C2Param::Index &index : mSubscribedIndices) { ss << index << " "; if (ss.str().length() > 70) { ALOGV("%s", ss.str().c_str()); std::stringstream().swap(ss); } } if (!ss.str().empty()) { ALOGV("%s", ss.str().c_str()); } #endif return OK; } Loading @@ -1204,6 +1232,12 @@ bool CCodecConfig::updateConfiguration( bool changed = false; for (std::unique_ptr<C2Param> &p : configUpdate) { if (p && *p) { // Allow unsubscribed vendor parameters to go through --- it may be // later handled by the format shaper. if (!p->isVendor() && mSubscribedIndices.count(p->index()) == 0) { ALOGV("updateConfiguration: skipped unsubscribed param %08x", p->index()); continue; } auto insertion = mCurrentConfig.emplace(p->index(), nullptr); if (insertion.second || *insertion.first->second != *p) { if (mSupportedIndices.count(p->index()) || mLocalParams.count(p->index())) { Loading Loading
media/codec2/sfplugin/CCodec.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -1478,8 +1478,12 @@ void CCodec::configure(const sp<AMessage> &msg) { // 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}); config->subscribeToConfigUpdate( comp, { C2AndroidStreamAverageBlockQuantizationInfo::output::PARAM_TYPE, C2StreamPictureTypeInfo::output::PARAM_TYPE, }); break; case VIDEO_ENCODING_STATISTICS_LEVEL_NONE: break; Loading
media/codec2/sfplugin/CCodecConfig.cpp +35 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "CCodecConfig" #include <initializer_list> #include <cutils/properties.h> #include <log/log.h> #include <utils/NativeHandle.h> Loading Loading @@ -1112,7 +1115,7 @@ status_t CCodecConfig::initialize( if (domain.value == C2Component::DOMAIN_VIDEO) { addLocalParam(new C2AndroidStreamAverageBlockQuantizationInfo::output(0u, 0), C2_PARAMKEY_AVERAGE_QP); addLocalParam(new C2StreamPictureTypeMaskInfo::output(0u, 0), addLocalParam(new C2StreamPictureTypeInfo::output(0u, 0), C2_PARAMKEY_PICTURE_TYPE); } } Loading Loading @@ -1149,6 +1152,17 @@ status_t CCodecConfig::initialize( } } // Parameters that are not subscribed initially, but can be subscribed // upon explicit request. static const std::initializer_list<C2Param::Index> kOptionalParams = { C2AndroidStreamAverageBlockQuantizationInfo::output::PARAM_TYPE, C2StreamPictureTypeInfo::output::PARAM_TYPE, }; for (const C2Param::Index &index : kOptionalParams) { mSubscribedIndices.erase(index); } subscribeToConfigUpdate(configurable, {}, C2_MAY_BLOCK); return OK; } Loading Loading @@ -1180,6 +1194,20 @@ status_t CCodecConfig::subscribeToConfigUpdate( ALOGV("Subscribed to %zu params", mSubscribedIndices.size()); mSubscribedIndicesSize = mSubscribedIndices.size(); } #if defined(LOG_NDEBUG) && !LOG_NDEBUG ALOGV("subscribed to %zu params:", mSubscribedIndices.size()); std::stringstream ss; for (const C2Param::Index &index : mSubscribedIndices) { ss << index << " "; if (ss.str().length() > 70) { ALOGV("%s", ss.str().c_str()); std::stringstream().swap(ss); } } if (!ss.str().empty()) { ALOGV("%s", ss.str().c_str()); } #endif return OK; } Loading @@ -1204,6 +1232,12 @@ bool CCodecConfig::updateConfiguration( bool changed = false; for (std::unique_ptr<C2Param> &p : configUpdate) { if (p && *p) { // Allow unsubscribed vendor parameters to go through --- it may be // later handled by the format shaper. if (!p->isVendor() && mSubscribedIndices.count(p->index()) == 0) { ALOGV("updateConfiguration: skipped unsubscribed param %08x", p->index()); continue; } auto insertion = mCurrentConfig.emplace(p->index(), nullptr); if (insertion.second || *insertion.first->second != *p) { if (mSupportedIndices.count(p->index()) || mLocalParams.count(p->index())) { Loading