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 STREAM_REPEAT_STUB_FUZZER_H
17 #define STREAM_REPEAT_STUB_FUZZER_H
18 
19 #include "hstream_repeat_stub.h"
20 
21 namespace OHOS {
22 namespace CameraStandard {
23 namespace StreamRepeatStubFuzzer {
24 
25 class HStreamRepeatStubMock : public HStreamRepeatStub {
26 public:
RemoveSketchStreamRepeat()27     int32_t RemoveSketchStreamRepeat() override
28     {
29         return 0;
30     }
SetFrameRate(int32_t minFrameRate,int32_t maxFrameRate)31     int32_t SetFrameRate(int32_t minFrameRate, int32_t maxFrameRate) override
32     {
33         return 0;
34     }
35     int32_t SetCameraRotation(bool isEnable = false, int32_t rotation = 0) override
36     {
37         return 0;
38     }
39     int32_t EnableSecure(bool isEnable = false) override
40     {
41         return 0;
42     }
SetMirror(bool isEnable)43     int32_t SetMirror(bool isEnable) override
44     {
45         return 0;
46     }
OperatePermissionCheck(uint32_t interfaceCode)47     int32_t OperatePermissionCheck(uint32_t interfaceCode) override
48     {
49         return 0;
50     }
Start()51     int32_t Start() override
52     {
53         return 0;
54     }
Stop()55     int32_t Stop() override
56     {
57         return 0;
58     }
SetCallback(sptr<IStreamRepeatCallback> & callback)59     int32_t SetCallback(sptr<IStreamRepeatCallback>& callback) override
60     {
61         return 0;
62     }
Release()63     int32_t Release() override
64     {
65         return 0;
66     }
AddDeferredSurface(const sptr<OHOS::IBufferProducer> & producer)67     int32_t AddDeferredSurface(const sptr<OHOS::IBufferProducer>& producer) override
68     {
69         return 0;
70     }
ForkSketchStreamRepeat(int32_t width,int32_t height,sptr<IStreamRepeat> & sketchStream,float sketchRatio)71     int32_t ForkSketchStreamRepeat(int32_t width, int32_t height,
72         sptr<IStreamRepeat>& sketchStream, float sketchRatio) override
73     {
74         return 0;
75     }
UpdateSketchRatio(float sketchRatio)76     int32_t UpdateSketchRatio(float sketchRatio) override
77     {
78         return 0;
79     }
AttachMetaSurface(const sptr<OHOS::IBufferProducer> & producer,int32_t videoMetaType)80     int32_t AttachMetaSurface(const sptr<OHOS::IBufferProducer>& producer, int32_t videoMetaType) override
81     {
82         return 0;
83     }
84 };
85 
86 void Test(uint8_t *rawData, size_t size);
87 void Test_OnRemoteRequest(uint8_t *rawData, size_t size);
88 
89 void CheckPermission();
90 
91 }
92 }
93 }
94 #endif