1 /*
2  * Copyright (c) 2021-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_DEVICE_FUZZER_H
17 #define CAMERA_DEVICE_FUZZER_H
18 
19 #define FUZZ_PROJECT_NAME "defferred_delivery_image_fuzzer"
20 #include "common.h"
21 #include "v1_2/image_process_service_proxy.h"
22 #include "v1_2/iimage_process_session.h"
23 #include "v1_2/iimage_process_callback.h"
24 namespace OHOS {
25     std::shared_ptr<OHOS::Camera::CameraManager> cameraTest_ = nullptr;
26     sptr<OHOS::HDI::Camera::V1_2::IImageProcessService> imageProcessService_ = nullptr;
27     sptr<OHOS::HDI::Camera::V1_2::IImageProcessSession> imageProcessSession_ = nullptr;
28     std::vector<std::string> pendingImageIds_;
29     class TestImageProcessCallback : public OHOS::HDI::Camera::V1_2::IImageProcessCallback {
30     public:
31         TestImageProcessCallback() = default;
32         virtual ~TestImageProcessCallback() = default;
OnProcessDone(const std::string & imageId,const OHOS::HDI::Camera::V1_2::ImageBufferInfo & buffer)33         int32_t OnProcessDone(const std::string& imageId,
34             const OHOS::HDI::Camera::V1_2::ImageBufferInfo& buffer) override
35         {
36             return 0;
37         };
OnStatusChanged(OHOS::HDI::Camera::V1_2::SessionStatus status)38         int32_t OnStatusChanged(OHOS::HDI::Camera::V1_2::SessionStatus status) override
39         {
40             return 0;
41         };
OnError(const std::string & imageId,OHOS::HDI::Camera::V1_2::ErrorCode errorCode)42         int32_t OnError(const std::string& imageId, OHOS::HDI::Camera::V1_2::ErrorCode errorCode) override
43         {
44             return 0;
45         };
46     };
47     sptr<TestImageProcessCallback> imageProcessCallback_;
48 }
49 #endif
50