1 /*
2  * Copyright (c) 2023 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 CAMERA_EXAMPLE_VENDOR_TAGS_H
17 #define CAMERA_EXAMPLE_VENDOR_TAGS_H
18 
19 #include "camera_vendor_tag.h"
20 #include <cstdint>
21 #include "camera_device_ability_items.h"
22 
23 namespace OHOS::Camera {
24 // Define example vendor tag section, start with OHOS_VENDOR_SECTION.
25 enum ExampleVendorSection {
26     EXAMPLE_VENDOR_SENSOR = OHOS_VENDOR_SECTION,
27     EXAMPLE_VENDOR_SECTION_END
28 };
29 
30 constexpr int EXAMPLE_SECTION_COUNT = EXAMPLE_VENDOR_SECTION_END - OHOS_VENDOR_SECTION;
31 
32 enum vendor_extension_section_ranges {
33     EXAMPLE_VENDOR_SENSOR_START = EXAMPLE_VENDOR_SENSOR << 16
34 };
35 
36 // Define example vendor tags here.
37 enum ExampleVendorTags {
38     EXAMPLE_VENDOR_SENSOR_MODE = EXAMPLE_VENDOR_SENSOR_START,
39     EXAMPLE_VENDOR_SENSOR_EXPOSURE,
40     EXAMPLE_VENDOR_SENSOR_END,
41 };
42 
43 class CameraVendorTagExample : public CameraVendorTag {
44 public:
CameraVendorTagExample()45     CameraVendorTagExample() {}
46     virtual ~CameraVendorTagExample() = default;
47     uint32_t GetVendorTagCount() override;
48     const char* GetVendorTagName(const uint32_t tag) override;
49     int32_t GetVendorTagType(const uint32_t tag) override;
50     void GetAllVendorTags(std::vector<vendorTag_t>& tagVec) override;
51 };
52 
CreateVendorTagImpl()53 extern "C" CameraVendorTagExample* CreateVendorTagImpl()
54 {
55     return new CameraVendorTagExample();
56 }
57 }
58 #endif /* CAMERA_EXAMPLE_VENDOR_TAGS_H */
59