• 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 DEFERREDPROCESSING_FUZZER_H
17 #define DEFERREDPROCESSING_FUZZER_H
18 
19 #include "deferred_video_processor.h"
20 #include "video_job_repository.h"
21 #include "video_strategy_center.h"
22 #include "video_post_processor.h"
23 #include <memory>
24 #include <fuzzer/FuzzedDataProvider.h>
25 
26 namespace OHOS {
27 namespace CameraStandard {
28 using namespace DeferredProcessing;
29 class IVideoProcessCallbacksFuzz : public IVideoProcessCallbacks {
30 public:
OnProcessDone(const int32_t userId,const std::string & videoId,const sptr<IPCFileDescriptor> & ipcFd)31     void OnProcessDone(const int32_t userId,
32         const std::string& videoId, const sptr<IPCFileDescriptor>& ipcFd) override {}
OnError(const int32_t userId,const std::string & videoId,DpsError errorCode)33     void OnError(const int32_t userId, const std::string& videoId, DpsError errorCode) override {}
OnStateChanged(const int32_t userId,DpsStatus statusCode)34     void OnStateChanged(const int32_t userId, DpsStatus statusCode) override {}
35 };
36 
37 class DeferredVideoProcessorFuzzer {
38 public:
39 static std::shared_ptr<DeferredProcessing::DeferredVideoProcessor> fuzz_;
40 static std::shared_ptr<DeferredProcessing::VideoStrategyCenter> center_;
41 
42 static void DeferredVideoProcessorFuzzTest(FuzzedDataProvider& fdp);
43 };
44 
45 } //CameraStandard
46 } //OHOS
47 #endif //DEFERREDPROCESSING_FUZZER_H