11c1b0f19Sopenharmony_ci/*
21c1b0f19Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
31c1b0f19Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
41c1b0f19Sopenharmony_ci * you may not use this file except in compliance with the License.
51c1b0f19Sopenharmony_ci * You may obtain a copy of the License at
61c1b0f19Sopenharmony_ci *
71c1b0f19Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
81c1b0f19Sopenharmony_ci *
91c1b0f19Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
101c1b0f19Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
111c1b0f19Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121c1b0f19Sopenharmony_ci * See the License for the specific language governing permissions and
131c1b0f19Sopenharmony_ci * limitations under the License.
141c1b0f19Sopenharmony_ci */
151c1b0f19Sopenharmony_ci
161c1b0f19Sopenharmony_ci#ifndef OHOS_DCAMERA_HITRACE_ADAPTER_H
171c1b0f19Sopenharmony_ci#define OHOS_DCAMERA_HITRACE_ADAPTER_H
181c1b0f19Sopenharmony_ci
191c1b0f19Sopenharmony_ci#include <cstdint>
201c1b0f19Sopenharmony_ci#include <string>
211c1b0f19Sopenharmony_ci
221c1b0f19Sopenharmony_ci#include "hitrace_meter.h"
231c1b0f19Sopenharmony_ci
241c1b0f19Sopenharmony_ci#define DCAMERA_SYNC_TRACE(value) HITRACE_METER_NAME(DCAMERA_HITRACE_LABEL, value)
251c1b0f19Sopenharmony_ci
261c1b0f19Sopenharmony_cinamespace OHOS {
271c1b0f19Sopenharmony_cinamespace DistributedHardware {
281c1b0f19Sopenharmony_ciconstexpr uint64_t DCAMERA_HITRACE_LABEL = HITRACE_TAG_DISTRIBUTED_CAMERA;
291c1b0f19Sopenharmony_ciconst std::string DCAMERA_LOAD_HDF = "DCAMERA_LOAD_HDF";
301c1b0f19Sopenharmony_ciconst std::string DCAMERA_REGISTER_CAMERA = "DCAMERA_REGISTER_CAMERA";
311c1b0f19Sopenharmony_ciconst std::string DCAMERA_UNREGISTER_CAMERA = "DCAMERA_UNREGISTER_CAMERA";
321c1b0f19Sopenharmony_ciconst std::string DCAMERA_SOURCE_CREATE_PIPELINE = "DCAMERA_SOURCE_CREATE_PIPELINE";
331c1b0f19Sopenharmony_ciconst std::string DCAMERA_SOURCE_DESTORY_PIPELINE = "DCAMERA_SOURCE_DESTORY_PIPELINE";
341c1b0f19Sopenharmony_ciconst std::string DCAMERA_SINK_CREATE_PIPELINE = "DCAMERA_SINK_CREATE_PIPELINE";
351c1b0f19Sopenharmony_ciconst std::string DCAMERA_SINK_DESTORY_PIPELINE = "DCAMERA_SINK_DESTORY_PIPELINE";
361c1b0f19Sopenharmony_ciconst std::string DCAMERA_OPEN_CHANNEL_CONTROL = "DCAMERA_OPEN_CHANNEL_CONTROL";
371c1b0f19Sopenharmony_ciconst std::string DCAMERA_OPEN_DATA_CONTINUE = "DCAMERA_OPEN_DATA_CONTINUE";
381c1b0f19Sopenharmony_ciconst std::string DCAMERA_OPEN_DATA_SNAPSHOT = "DCAMERA_OPEN_DATA_SNAPSHOT";
391c1b0f19Sopenharmony_ciconst std::string DCAMERA_CONTINUE_FIRST_FRAME = "DCAMERA_CONTINUE_FIRST_FRAME";
401c1b0f19Sopenharmony_ciconst std::string DCAMERA_SNAPSHOT_FIRST_FRAME = "DCAMERA_SNAPSHOT_FIRST_FRAME";
411c1b0f19Sopenharmony_cienum DcameraTaskId {
421c1b0f19Sopenharmony_ci    DCAMERA_OPEN_CHANNEL_TASKID = 0,
431c1b0f19Sopenharmony_ci    DCAMERA_OPEN_DATA_CONTINUE_TASKID = 1,
441c1b0f19Sopenharmony_ci    DCAMERA_OPEN_DATA_SNAPSHOT_TASKID = 2,
451c1b0f19Sopenharmony_ci    DCAMERA_CONTINUE_FIRST_FRAME_TASKID = 3,
461c1b0f19Sopenharmony_ci    DCAMERA_SNAPSHOT_FIRST_FRAME_TASKID = 4,
471c1b0f19Sopenharmony_ci};
481c1b0f19Sopenharmony_ci
491c1b0f19Sopenharmony_civoid DcameraStartAsyncTrace(const std::string& str, int32_t taskId);
501c1b0f19Sopenharmony_civoid DcameraFinishAsyncTrace(const std::string& str, int32_t taskId);
511c1b0f19Sopenharmony_ci} // namespace DistributedHardware
521c1b0f19Sopenharmony_ci} // namespace OHOS
531c1b0f19Sopenharmony_ci#endif // OHOS_DCAMERA_HITRACE_ADAPTER_H