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_HISYSEVENT_ADAPTER_H 171c1b0f19Sopenharmony_ci#define OHOS_DCAMERA_HISYSEVENT_ADAPTER_H 181c1b0f19Sopenharmony_ci 191c1b0f19Sopenharmony_ci#include <string> 201c1b0f19Sopenharmony_ci 211c1b0f19Sopenharmony_cinamespace OHOS { 221c1b0f19Sopenharmony_cinamespace DistributedHardware { 231c1b0f19Sopenharmony_ciconst std::string DCAMERA_INIT_FAIL = "DCAMERA_INIT_FAIL"; 241c1b0f19Sopenharmony_ciconst std::string DCAMERA_REGISTER_FAIL = "DCAMERA_REGISTER_FAIL"; 251c1b0f19Sopenharmony_ciconst std::string DCAMERA_OPT_FAIL = "DCAMERA_OPT_FAIL"; 261c1b0f19Sopenharmony_ci 271c1b0f19Sopenharmony_ciconst std::string INIT_SA_EVENT = "DCAMERA_INIT"; 281c1b0f19Sopenharmony_ciconst std::string RELEASE_SA_EVENT = "DCAMERA_EXIT"; 291c1b0f19Sopenharmony_ciconst std::string REGIST_CAMERA_EVENT = "DCAMERA_REGISTER"; 301c1b0f19Sopenharmony_ciconst std::string UNREGIST_CAMERA_EVENT = "DCAMERA_UNREGISTER"; 311c1b0f19Sopenharmony_ciconst std::string OPEN_CAMERA_EVENT = "DCAMERA_OPEN"; 321c1b0f19Sopenharmony_ciconst std::string CLOSE_CAMERA_EVENT = "DCAMERA_CLOSE"; 331c1b0f19Sopenharmony_ciconst std::string START_CAPTURE_EVENT = "DCAMERA_CAPTURE"; 341c1b0f19Sopenharmony_ci 351c1b0f19Sopenharmony_cienum DcameraHisyseventErrno : int32_t { 361c1b0f19Sopenharmony_ci DCAMERA_SA_ERROR = 0, 371c1b0f19Sopenharmony_ci DCAMERA_HDF_ERROR = 1, 381c1b0f19Sopenharmony_ci DCAMERA_CREATE_SESSIONSVR_ERROR = 2, 391c1b0f19Sopenharmony_ci DCAMERA_OPEN_SESSION_ERROR = 3, 401c1b0f19Sopenharmony_ci DCAMERA_SINK_OPEN_CAM_ERROR = 4, 411c1b0f19Sopenharmony_ci DCAMERA_ENCODE_ERROR = 5, 421c1b0f19Sopenharmony_ci DCAMERA_DECODE_ERROR = 6, 431c1b0f19Sopenharmony_ci}; 441c1b0f19Sopenharmony_ci 451c1b0f19Sopenharmony_ciusing EventCaptureInfo = struct _EventCaptureInfo { 461c1b0f19Sopenharmony_ci int32_t width_; 471c1b0f19Sopenharmony_ci int32_t height_; 481c1b0f19Sopenharmony_ci int32_t format_; 491c1b0f19Sopenharmony_ci bool isCapture_; 501c1b0f19Sopenharmony_ci int32_t encodeType_; 511c1b0f19Sopenharmony_ci int32_t type_; 521c1b0f19Sopenharmony_ci}; 531c1b0f19Sopenharmony_ci 541c1b0f19Sopenharmony_civoid ReportDcamerInitFail(const std::string& eventName, int32_t errCode, const std::string& errMsg); 551c1b0f19Sopenharmony_civoid ReportRegisterCameraFail(const std::string& eventName, const std::string& devId, const std::string& dhId, 561c1b0f19Sopenharmony_ci std::string version, const std::string& errMsg); 571c1b0f19Sopenharmony_civoid ReportDcamerOptFail(const std::string& eventName, int32_t errCode, const std::string& errMsg); 581c1b0f19Sopenharmony_ci 591c1b0f19Sopenharmony_civoid ReportSaEvent(const std::string& eventName, int32_t saId, const std::string& errMsg); 601c1b0f19Sopenharmony_civoid ReportRegisterCameraEvent(const std::string& eventName, const std::string& devId, const std::string& dhId, 611c1b0f19Sopenharmony_ci std::string version, const std::string& errMsg); 621c1b0f19Sopenharmony_civoid ReportCameraOperaterEvent(const std::string& eventName, const std::string& devId, const std::string& dhId, 631c1b0f19Sopenharmony_ci const std::string& errMsg); 641c1b0f19Sopenharmony_civoid ReportStartCaptureEvent(const std::string& eventName, EventCaptureInfo& capture, const std::string& errMsg); 651c1b0f19Sopenharmony_ci 661c1b0f19Sopenharmony_cistd::string CreateMsg(const char *format, ...); 671c1b0f19Sopenharmony_ci} // namespace DistributedHardware 681c1b0f19Sopenharmony_ci} // namespace OHOS 691c1b0f19Sopenharmony_ci#endif // OHOS_DCAMERA_HISYSEVENT_ADAPTER_H