• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  /*
2  * Copyright (c) 2024 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_INPUT_FUZZER_H
17 #define CAMERA_INPUT_FUZZER_H
18 
19 #include "hstream_capture_stub.h"
20 
21 namespace OHOS {
22 namespace CameraStandard {
23 class PictureIntf;
24 class HStreamCaptureStubFuzz : public HStreamCaptureStub {
25 public:
Capture(const std::shared_ptr<OHOS::Camera::CameraMetadata> & captureSettings)26     int32_t Capture(const std::shared_ptr<OHOS::Camera::CameraMetadata> &captureSettings) override
27     {
28         return 0;
29     }
CancelCapture()30     int32_t CancelCapture() override
31     {
32         return 0;
33     }
ConfirmCapture()34     int32_t ConfirmCapture() override
35     {
36         return 0;
37     }
SetCallback(sptr<IStreamCaptureCallback> & callback)38     int32_t SetCallback(sptr<IStreamCaptureCallback> &callback) override
39     {
40         return 0;
41     }
UnSetCallback()42     int32_t UnSetCallback() override
43     {
44         return 0;
45     }
Release()46     int32_t Release() override
47     {
48         return 0;
49     }
SetThumbnail(bool isEnabled,const sptr<OHOS::IBufferProducer> & producer)50     int32_t SetThumbnail(bool isEnabled, const sptr<OHOS::IBufferProducer> &producer) override
51     {
52         return 0;
53     }
EnableRawDelivery(bool enabled)54     int32_t EnableRawDelivery(bool enabled) override
55     {
56         return 0;
57     }
EnableMovingPhoto(bool enabled)58     int32_t EnableMovingPhoto(bool enabled) override
59     {
60         return 0;
61     }
SetBufferProducerInfo(const std::string bufName,const sptr<OHOS::IBufferProducer> & producer)62     int32_t SetBufferProducerInfo(const std::string bufName, const sptr<OHOS::IBufferProducer> &producer) override
63     {
64         return 0;
65     }
DeferImageDeliveryFor(int32_t type)66     int32_t DeferImageDeliveryFor(int32_t type) override
67     {
68         return 0;
69     }
IsDeferredPhotoEnabled()70     int32_t IsDeferredPhotoEnabled() override
71     {
72         return 0;
73     }
IsDeferredVideoEnabled()74     int32_t IsDeferredVideoEnabled() override
75     {
76         return 0;
77     }
SetMovingPhotoVideoCodecType(int32_t videoCodecType)78     int32_t SetMovingPhotoVideoCodecType(int32_t videoCodecType) override
79     {
80         return 0;
81     }
SetCameraPhotoRotation(bool isEnable)82     int32_t SetCameraPhotoRotation(bool isEnable) override
83     {
84         return 0;
85     }
UpdateMediaLibraryPhotoAssetProxy(sptr<CameraPhotoProxy> photoProxy)86     int32_t UpdateMediaLibraryPhotoAssetProxy(sptr<CameraPhotoProxy> photoProxy) override
87     {
88         return 0;
89     }
AcquireBufferToPrepareProxy(int32_t captureId)90     int32_t AcquireBufferToPrepareProxy(int32_t captureId) override
91     {
92         return 0;
93     }
OperatePermissionCheck(uint32_t interfaceCode)94     int32_t OperatePermissionCheck(uint32_t interfaceCode) override
95     {
96         return 0;
97     }
98 
EnableOfflinePhoto(bool isEnable)99     int32_t EnableOfflinePhoto(bool isEnable)override
100     {
101         return 0;
102     }
103 
CreateMediaLibrary(sptr<CameraPhotoProxy> & photoProxy,std::string & uri,int32_t & cameraShotType,std::string & burstKey,int64_t timestamp)104     int32_t CreateMediaLibrary(sptr<CameraPhotoProxy> &photoProxy,
105         std::string &uri, int32_t &cameraShotType, std::string &burstKey, int64_t timestamp) override
106     {
107         return 0;
108     }
CreateMediaLibrary(std::shared_ptr<PictureIntf> picture,sptr<CameraPhotoProxy> & photoProxy,std::string & uri,int32_t & cameraShotType,std::string & burstKey,int64_t timestamp)109     int32_t CreateMediaLibrary(std::shared_ptr<PictureIntf> picture, sptr<CameraPhotoProxy> &photoProxy,
110         std::string &uri, int32_t &cameraShotType, std::string &burstKey, int64_t timestamp) override
111     {
112         return 0;
113     }
114 };
115 class HStreamCaptureStubFuzzer {
116 public:
117 static std::shared_ptr<HStreamCaptureStubFuzz> fuzz_;
118 static void HStreamCaptureStubFuzzTest1();
119 static void HStreamCaptureStubFuzzTest2();
120 static void HStreamCaptureStubFuzzTest3();
121 static void HStreamCaptureStubFuzzTest4();
122 static void HStreamCaptureStubFuzzTest5();
123 static void HStreamCaptureStubFuzzTest6();
124 static void HStreamCaptureStubFuzzTest7();
125 static void HStreamCaptureStubFuzzTest8();
126 static void HStreamCaptureStubFuzzTest9();
127 static void HStreamCaptureStubFuzzTest10();
128 };
129 } //CameraStandard
130 } //OHOS
131 #endif //CAMERA_INPUT_FUZZER_H