Loading media/codec2/sfplugin/CCodec.cpp +37 −2 Original line number Diff line number Diff line Loading @@ -2619,7 +2619,10 @@ public: std::vector<std::unique_ptr<C2Param>> params; err = intf->query( {&mApiFeatures}, {C2PortAllocatorsTuning::input::PARAM_TYPE}, { C2StreamBufferTypeSetting::input::PARAM_TYPE, C2PortAllocatorsTuning::input::PARAM_TYPE }, C2_MAY_BLOCK, ¶ms); if (err != C2_OK && err != C2_BAD_INDEX) { Loading @@ -2632,7 +2635,10 @@ public: if (!param) { continue; } if (param->type() == C2PortAllocatorsTuning::input::PARAM_TYPE) { if (param->type() == C2StreamBufferTypeSetting::input::PARAM_TYPE) { mInputStreamFormat.reset( C2StreamBufferTypeSetting::input::From(param)); } else if (param->type() == C2PortAllocatorsTuning::input::PARAM_TYPE) { mInputAllocators.reset( C2PortAllocatorsTuning::input::From(param)); } Loading @@ -2652,6 +2658,16 @@ public: return mApiFeatures; } const C2StreamBufferTypeSetting::input &getInputStreamFormat() const { static std::unique_ptr<C2StreamBufferTypeSetting::input> sInvalidated = []{ std::unique_ptr<C2StreamBufferTypeSetting::input> param; param.reset(new C2StreamBufferTypeSetting::input(0u, C2BufferData::INVALID)); param->invalidate(); return param; }(); return mInputStreamFormat ? *mInputStreamFormat : *sInvalidated; } const C2PortAllocatorsTuning::input &getInputAllocators() const { static std::unique_ptr<C2PortAllocatorsTuning::input> sInvalidated = []{ std::unique_ptr<C2PortAllocatorsTuning::input> param = Loading @@ -2667,6 +2683,7 @@ private: std::vector<C2FieldSupportedValuesQuery> mFields; C2ApiFeaturesSetting mApiFeatures; std::unique_ptr<C2StreamBufferTypeSetting::input> mInputStreamFormat; std::unique_ptr<C2PortAllocatorsTuning::input> mInputAllocators; }; Loading Loading @@ -2708,6 +2725,24 @@ static status_t GetCommonAllocatorIds( if (intfCache.initCheck() != OK) { continue; } const C2StreamBufferTypeSetting::input &streamFormat = intfCache.getInputStreamFormat(); if (streamFormat) { C2Allocator::type_t allocatorType = C2Allocator::LINEAR; if (streamFormat.value == C2BufferData::GRAPHIC || streamFormat.value == C2BufferData::GRAPHIC_CHUNKS) { allocatorType = C2Allocator::GRAPHIC; } if (type != allocatorType) { // requested type is not supported at input allocators ids->clear(); ids->insert(defaultAllocatorId); ALOGV("name(%s) does not support a type(0x%x) as input allocator." " uses default allocator id(%d)", name.c_str(), type, defaultAllocatorId); break; } } const C2PortAllocatorsTuning::input &allocators = intfCache.getInputAllocators(); if (firstIteration) { firstIteration = false; Loading Loading
media/codec2/sfplugin/CCodec.cpp +37 −2 Original line number Diff line number Diff line Loading @@ -2619,7 +2619,10 @@ public: std::vector<std::unique_ptr<C2Param>> params; err = intf->query( {&mApiFeatures}, {C2PortAllocatorsTuning::input::PARAM_TYPE}, { C2StreamBufferTypeSetting::input::PARAM_TYPE, C2PortAllocatorsTuning::input::PARAM_TYPE }, C2_MAY_BLOCK, ¶ms); if (err != C2_OK && err != C2_BAD_INDEX) { Loading @@ -2632,7 +2635,10 @@ public: if (!param) { continue; } if (param->type() == C2PortAllocatorsTuning::input::PARAM_TYPE) { if (param->type() == C2StreamBufferTypeSetting::input::PARAM_TYPE) { mInputStreamFormat.reset( C2StreamBufferTypeSetting::input::From(param)); } else if (param->type() == C2PortAllocatorsTuning::input::PARAM_TYPE) { mInputAllocators.reset( C2PortAllocatorsTuning::input::From(param)); } Loading @@ -2652,6 +2658,16 @@ public: return mApiFeatures; } const C2StreamBufferTypeSetting::input &getInputStreamFormat() const { static std::unique_ptr<C2StreamBufferTypeSetting::input> sInvalidated = []{ std::unique_ptr<C2StreamBufferTypeSetting::input> param; param.reset(new C2StreamBufferTypeSetting::input(0u, C2BufferData::INVALID)); param->invalidate(); return param; }(); return mInputStreamFormat ? *mInputStreamFormat : *sInvalidated; } const C2PortAllocatorsTuning::input &getInputAllocators() const { static std::unique_ptr<C2PortAllocatorsTuning::input> sInvalidated = []{ std::unique_ptr<C2PortAllocatorsTuning::input> param = Loading @@ -2667,6 +2683,7 @@ private: std::vector<C2FieldSupportedValuesQuery> mFields; C2ApiFeaturesSetting mApiFeatures; std::unique_ptr<C2StreamBufferTypeSetting::input> mInputStreamFormat; std::unique_ptr<C2PortAllocatorsTuning::input> mInputAllocators; }; Loading Loading @@ -2708,6 +2725,24 @@ static status_t GetCommonAllocatorIds( if (intfCache.initCheck() != OK) { continue; } const C2StreamBufferTypeSetting::input &streamFormat = intfCache.getInputStreamFormat(); if (streamFormat) { C2Allocator::type_t allocatorType = C2Allocator::LINEAR; if (streamFormat.value == C2BufferData::GRAPHIC || streamFormat.value == C2BufferData::GRAPHIC_CHUNKS) { allocatorType = C2Allocator::GRAPHIC; } if (type != allocatorType) { // requested type is not supported at input allocators ids->clear(); ids->insert(defaultAllocatorId); ALOGV("name(%s) does not support a type(0x%x) as input allocator." " uses default allocator id(%d)", name.c_str(), type, defaultAllocatorId); break; } } const C2PortAllocatorsTuning::input &allocators = intfCache.getInputAllocators(); if (firstIteration) { firstIteration = false; Loading