mirror of
https://gitee.com/openharmony/xts_hats
synced 2025-03-03 07:57:33 +00:00
!713 修改codec_benchmark_manager_test和codec_benchmark_omx_test代码
Merge pull request !713 from hechunrui/hcr
This commit is contained in:
commit
45dd6c6f17
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user