Files
liushang 761822fbfb init vpe code
Signed-off-by: liushang <liushang2@huawei.com>
2025-02-27 19:09:30 +08:00

53 lines
1.4 KiB
C++

/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "vpe_trace.h"
#include <unistd.h>
#include "hitrace_meter.h"
namespace OHOS {
namespace Media {
namespace VideoProcessingEngine {
VPETrace::VPETrace(const std::string& funcName)
{
StartTrace(HITRACE_TAG_ZMEDIA, funcName);
isSync_ = true;
}
void VPETrace::TraceBegin(const std::string& funcName, int32_t taskId)
{
StartAsyncTrace(HITRACE_TAG_ZMEDIA, funcName, taskId);
}
void VPETrace::TraceEnd(const std::string& funcName, int32_t taskId)
{
FinishAsyncTrace(HITRACE_TAG_ZMEDIA, funcName, taskId);
}
void VPETrace::CounterTrace(const std::string& varName, int32_t val)
{
CountTrace(HITRACE_TAG_ZMEDIA, varName, val);
}
VPETrace::~VPETrace()
{
if (isSync_) {
FinishTrace(HITRACE_TAG_ZMEDIA);
}
}
} // namespace VideoProcessingEngine
} // namespace Media
} // namespace OHOS