!713 修改codec_benchmark_manager_test和codec_benchmark_omx_test代码

Merge pull request !713 from hechunrui/hcr
This commit is contained in:
openharmony_ci 2023-06-08 02:51:05 +00:00 committed by Gitee
commit 45dd6c6f17
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 8 additions and 8 deletions

View File

@ -112,7 +112,7 @@ BENCHMARK_F(CodecBenchmarkManagerTest, DestoryComponent)(benchmark::State &state
ASSERT_EQ(ret, HDF_SUCCESS);
for (auto _ : state) {
if (componentId != 0) {
manager_->DestoryComponent(componentId);
manager_->DestroyComponent(componentId);
}
}
}

View File

@ -58,7 +58,7 @@ static IDisplayBuffer *gralloc_ = nullptr;
static sptr<ICodecComponent> component_ = nullptr;
static sptr<ICodecCallback> callback_ = nullptr;
static sptr<ICodecComponentManager> manager_ = nullptr;
static OHOS::HDI::Codec::V1_0::OMX_VERSIONTYPE version_;
static OHOS::HDI::Codec::V1_0::CodecVersionType version_;
static inline std::string compName_ = "";
class CodecBenchmarkOmxTest : public benchmark::Fixture {
@ -138,7 +138,7 @@ public:
void TearDown(benchmark::State &state)
{
if (manager_ != nullptr && component_ != nullptr) {
manager_->DestoryComponent(componentId_);
manager_->DestroyComponent(componentId_);
}
component_ = nullptr;
callback_ = nullptr;
@ -280,8 +280,8 @@ BENCHMARK_F(CodecBenchmarkOmxTest, ComponentTunnelRequest)(benchmark::State &sta
int32_t ret;
const int32_t tunneledComp = TUNNELECOMP;
const uint32_t tunneledPort = TUNNELEDPORT;
OHOS::HDI::Codec::V1_0::OMX_TUNNELSETUPTYPE tunnelSetup;
tunnelSetup.eSupplier = OHOS::HDI::Codec::V1_0::OMX_BufferSupplyInput;
OHOS::HDI::Codec::V1_0::CodecTunnelSetupType tunnelSetup;
tunnelSetup.supplier = OHOS::HDI::Codec::V1_0::CODEC_BUFFER_SUPPLY_INPUT;
for (auto _ : state) {
ret = component_->ComponentTunnelRequest(outputIndex, tunneledComp, tunneledPort,
tunnelSetup, tunnelSetup);
@ -300,9 +300,9 @@ BENCHMARK_F(CodecBenchmarkOmxTest, SendCommand)(benchmark::State &state)
for (auto _ : state) {
Init();
ret = component_->SendCommand(CODEC_COMMAND_STATE_SET, CODEC_STATE_IDLE, cmdData);
manager_->DestoryComponent(componentId_);
manager_->DestroyComponent(componentId_);
if (manager_ != nullptr && component_ != nullptr) {
manager_->DestoryComponent(componentId_);
manager_->DestroyComponent(componentId_);
}
component_ = nullptr;
callback_ = nullptr;
@ -460,7 +460,7 @@ BENCHMARK_F(CodecBenchmarkOmxTest, ComponentDeInit)(benchmark::State &state)
} while (state != CODEC_STATE_LOADED);
ret = component_->ComponentDeInit();
if (manager_ != nullptr && component_ != nullptr) {
manager_->DestoryComponent(componentId_);
manager_->DestroyComponent(componentId_);
}
component_ = nullptr;
callback_ = nullptr;