1 /* 2 * Copyright (c) 2022 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 VCODECFILE_FUZZER_H 17 #define VCODECFILE_FUZZER_H 18 19 #define FUZZ_PROJECT_NAME "vcodecfile_fuzzer" 20 #include "vdec_mock.h" 21 #include "venc_mock.h" 22 23 namespace OHOS { 24 namespace Media { 25 bool FuzzVCodecFile(uint8_t *data, size_t size); 26 27 class VCodecFileFuzzer : public NoCopyable { 28 public: 29 VCodecFileFuzzer(); 30 ~VCodecFileFuzzer(); 31 bool FuzzVideoFile(uint8_t *data, size_t size); 32 protected: 33 std::shared_ptr<VDecMock> videoDec_ = nullptr; 34 std::shared_ptr<VDecCallbackTest> vdecCallback_ = nullptr; 35 std::shared_ptr<VEncMock> videoEnc_ = nullptr; 36 std::shared_ptr<VEncCallbackTest> vencCallback_ = nullptr; 37 }; 38 } 39 } 40 #endif 41 42