1 /* 2 * Copyright (c) 2025 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 HSTREAM_REPEAT_CALLBACK_STUB_FUZZER_H 17 #define HSTREAM_REPEAT_CALLBACK_STUB_FUZZER_H 18 19 #include "stream_repeat_callback_stub.h" 20 #include <fuzzer/FuzzedDataProvider.h> 21 22 namespace OHOS { 23 namespace CameraStandard { 24 class HStreamRepeatCallbackStubFuzz : public StreamRepeatCallbackStub { 25 public: OnFrameStarted()26 int32_t OnFrameStarted() override 27 { 28 return 0; 29 } 30 OnFrameEnded(int32_t frameCount)31 int32_t OnFrameEnded(int32_t frameCount) override 32 { 33 return 0; 34 } 35 OnFrameError(int32_t errorCode)36 int32_t OnFrameError(int32_t errorCode) override 37 { 38 return 0; 39 } 40 OnSketchStatusChanged(SketchStatus status)41 int32_t OnSketchStatusChanged(SketchStatus status) override 42 { 43 return 0; 44 } 45 OnDeferredVideoEnhancementInfo(const CaptureEndedInfoExt & captureEndedInfo)46 int32_t OnDeferredVideoEnhancementInfo(const CaptureEndedInfoExt& captureEndedInfo) override 47 { 48 return 0; 49 } 50 }; 51 class HStreamRepeatCallbackStubFuzzer { 52 public: 53 static std::shared_ptr<HStreamRepeatCallbackStubFuzz> fuzz_; 54 static void HStreamRepeatCallbackStubFuzzTest1(); 55 static void HStreamRepeatCallbackStubFuzzTest2(FuzzedDataProvider &fdp); 56 static void HStreamRepeatCallbackStubFuzzTest3(FuzzedDataProvider &fdp); 57 static void HStreamRepeatCallbackStubFuzzTest4(FuzzedDataProvider &fdp); 58 }; 59 } // namespace CameraStandard 60 } // namespace OHOS 61 #endif // HSTREAM_REPEAT_CALLBACK_STUB_FUZZER_H