• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  /*
2  * Copyright (c) 2023 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 PHOTO_OUTPUT_FUZZER_H
17 #define PHOTO_OUTPUT_FUZZER_H
18 
19 #include "output/photo_output.h"
20 
21 namespace OHOS {
22 namespace CameraStandard {
23 namespace PhotoOutputFuzzer {
24 
25 class PhotoStateCallbackMock : public PhotoStateCallback {
26 public:
OnCaptureStarted(const int32_t captureID)27     void OnCaptureStarted(const int32_t captureID) const override {}
OnCaptureStarted(const int32_t captureID,uint32_t exposureTime)28     void OnCaptureStarted(const int32_t captureID, uint32_t exposureTime) const override {}
OnCaptureEnded(const int32_t captureID,const int32_t frameCount)29     void OnCaptureEnded(const int32_t captureID, const int32_t frameCount) const override {}
OnFrameShutter(const int32_t captureId,const uint64_t timestamp)30     void OnFrameShutter(const int32_t captureId, const uint64_t timestamp) const override {}
OnFrameShutterEnd(const int32_t captureId,const uint64_t timestamp)31     void OnFrameShutterEnd(const int32_t captureId, const uint64_t timestamp) const override {}
OnCaptureReady(const int32_t captureId,const uint64_t timestamp)32     void OnCaptureReady(const int32_t captureId, const uint64_t timestamp) const override {}
OnEstimatedCaptureDuration(const int32_t duration)33     void OnEstimatedCaptureDuration(const int32_t duration) const override {}
OnCaptureError(const int32_t captureId,const int32_t errorCode)34     void OnCaptureError(const int32_t captureId, const int32_t errorCode) const override {}
OnOfflineDeliveryFinished(const int32_t captureId)35     void OnOfflineDeliveryFinished(const int32_t captureId) const override {}
36 };
37 
38 class IBufferConsumerListenerMock : public IBufferConsumerListener {
39 public:
OnBufferAvailable()40     void OnBufferAvailable() override {}
41 };
42 
43 void Test(uint8_t *rawData, size_t size);
44 void TestOutput1(sptr<PhotoOutput> output, uint8_t *rawData, size_t size);
45 void TestOutput2(sptr<PhotoOutput> output, uint8_t *rawData, size_t size);
46 void CaptureSetting(std::shared_ptr<PhotoCaptureSetting> setting, uint8_t *rawData, size_t size);
47 void CaptureCallback(sptr<HStreamCaptureCallbackImpl> callback, uint8_t *rawData, size_t size);
48 
49 }
50 } //CameraStandard
51 } //OHOS
52 #endif //PHOTO_OUTPUT_FUZZER_H