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 CAPTURE_OUTPUT_FUZZER_H 17 #define CAPTURE_OUTPUT_FUZZER_H 18 19 #include "capture_output.h" 20 #include <fuzzer/FuzzedDataProvider.h> 21 22 namespace OHOS { 23 namespace CameraStandard { 24 25 class CaptureOutputTest : public CaptureOutput { 26 public: CaptureOutputTest(CaptureOutputType outputType,StreamType streamType,sptr<IBufferProducer> bufferProducer,sptr<IStreamCommon> stream)27 CaptureOutputTest(CaptureOutputType outputType, 28 StreamType streamType, sptr<IBufferProducer> bufferProducer, 29 sptr<IStreamCommon> stream): CaptureOutput(outputType, streamType, bufferProducer, stream){}; Release()30 int32_t Release() override 31 { 32 return 0; 33 } CameraServerDied(pid_t pid)34 void CameraServerDied(pid_t pid) override {} CreateStream()35 int32_t CreateStream() override 36 { 37 return 0; 38 } CaptureOutputTest1()39 void CaptureOutputTest1() 40 { 41 CaptureOutput::GetOutputTypeString(); 42 } 43 }; 44 45 class CaptureOutputFuzzer { 46 public: 47 static std::shared_ptr<CaptureOutput> fuzz_; 48 static CaptureOutputTest captureOutputTest; 49 static void CaptureOutputFuzzTest(FuzzedDataProvider& fdp); 50 }; 51 } //CameraStandard 52 } //OHOS 53 #endif //CAPTURE_OUTPUT_FUZZER_H