1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef DISTRIBUTED_CAMERA_H
17 #define DISTRIBUTED_CAMERA_H
18 
19 #include "camera_metadata_info.h"
20 
21 #include "v1_1/dcamera_types.h"
22 #include "v1_0/types.h"
23 
24 namespace OHOS {
25 namespace DistributedHardware {
26 using namespace OHOS::HDI::Camera::V1_0;
27 using namespace OHOS::HDI::DistributedCamera::V1_1;
28 using CameraAbility = OHOS::Camera::CameraMetadata;
29 using CameraSetting = OHOS::Camera::CameraMetadata;
30 using RetCode = uint32_t;
31 using MetaType = int32_t;
32 const std::string BASE_64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
33 
34 CamRetCode MapToExternalRetCode(DCamRetCode retCode);
35 
36 uint64_t GetCurrentLocalTimeStamp();
37 
38 void SplitString(const std::string &str, std::vector<std::string> &tokens, const std::string &delimiters);
39 
40 std::string Base64Encode(const unsigned char *toEncode, unsigned int len);
41 
42 std::string Base64Decode(const std::string& basicString);
43 
44 bool IsBase64(unsigned char c);
45 
46 bool IsDhBaseInfoInvalid(const DHBase& dhBase);
47 } // namespace DistributedHardware
48 } // namespace OHOS
49 #endif // DISTRIBUTED_CAMERA_H
50