• 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_SESSION_STUB_FUZZER_H
17 #define DEFERREDPROCESSING_SESSION_STUB_FUZZER_H
18 
19 #include <iostream>
20 #include "deferred_video_processing_session.h"
21 #include "ideferred_video_processing_session_callback.h"
22 #include "deferred_photo_processing_session_stub.h"
23 #include "dp_power_manager.h"
24 
25 namespace OHOS {
26 namespace CameraStandard {
27 using namespace DeferredProcessing;
28 
29 class DeferredPhotoProcessingSessionStubFuzz : public DeferredPhotoProcessingSessionStub {
30 public:
BeginSynchronize()31     int32_t BeginSynchronize() override
32     {
33         return 0;
34     }
EndSynchronize()35     int32_t EndSynchronize() override
36     {
37         return 0;
38     }
39     int32_t AddImage(
40         const std::string& imageId,
41         DpsMetadata& metadata,
42         const bool discardable = false) override
43     {
44         return 0;
45     }
46     int32_t RemoveImage(const std::string& imageId, const bool restorable = false) override
47     {
48         return 0;
49     }
RestoreImage(const std::string & imageId)50     int32_t RestoreImage(const std::string& imageId) override
51     {
52         return 0;
53     }
ProcessImage(const std::string & appName,const std::string & imageId)54     int32_t ProcessImage(const std::string& appName, const std::string& imageId) override
55     {
56         return 0;
57     }
CancelProcessImage(const std::string & imageId)58     int32_t CancelProcessImage(const std::string& imageId) override
59     {
60         return 0;
61     }
62 };
63 
64 class DeferredPhotoProcessingSessionStubFuzzer {
65 public:
66 static std::shared_ptr<DeferredPhotoProcessingSessionStubFuzz> fuzz_;
67 static std::shared_ptr<DPSProwerManager> manager_;
68 static void OnRemoteRequest(int32_t code);
69 static void FuzzTest();
70 };
71 } //CameraStandard
72 } //OHOS
73 #endif //DEFERREDPROCESSING_SESSION_STUB_FUZZER_H