• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 OHOS_MOCK_DCAMERA_SINK_DATA_PROCESS_H
17 #define OHOS_MOCK_DCAMERA_SINK_DATA_PROCESS_H
18 
19 #include <cstdint>
20 #include <memory>
21 
22 #include "event.h"
23 #include "event_bus.h"
24 
25 #include "data_buffer.h"
26 #include "data_process_listener.h"
27 #include "dcamera_capture_info_cmd.h"
28 #include "dcamera_index.h"
29 #include "dcamera_photo_output_event.h"
30 #include "dcamera_video_output_event.h"
31 #include "icamera_channel.h"
32 #include "icamera_channel_listener.h"
33 #include "icamera_sink_data_process.h"
34 
35 namespace OHOS {
36 namespace DistributedHardware {
37 class MockDCameraSinkDataProcess : public ICameraSinkDataProcess, public EventSender,
38     public DistributedHardware::EventBusHandler<DCameraPhotoOutputEvent>,
39     public DistributedHardware::EventBusHandler<DCameraVideoOutputEvent>,
40     public std::enable_shared_from_this<MockDCameraSinkDataProcess> {
41 public:
MockDCameraSinkDataProcess(const std::shared_ptr<ICameraChannel> & channel)42     explicit MockDCameraSinkDataProcess(const std::shared_ptr<ICameraChannel>& channel)
43     {
44     }
45 
~MockDCameraSinkDataProcess()46     ~MockDCameraSinkDataProcess()
47     {
48     }
49 
StartCapture(std::shared_ptr<DCameraCaptureInfo> & captureInfo)50     int32_t StartCapture(std::shared_ptr<DCameraCaptureInfo>& captureInfo)
51     {
52         return DCAMERA_OK;
53     }
StopCapture()54     int32_t StopCapture()
55     {
56         return DCAMERA_OK;
57     }
FeedStream(std::shared_ptr<DataBuffer> & dataBuffer)58     int32_t FeedStream(std::shared_ptr<DataBuffer>& dataBuffer)
59     {
60         return DCAMERA_OK;
61     }
Init()62     void Init()
63     {
64     }
OnEvent(DCameraPhotoOutputEvent & event)65     void OnEvent(DCameraPhotoOutputEvent& event)
66     {
67     }
OnEvent(DCameraVideoOutputEvent & event)68     void OnEvent(DCameraVideoOutputEvent& event)
69     {
70     }
OnProcessedVideoBuffer(const std::shared_ptr<DataBuffer> & videoResult)71     void OnProcessedVideoBuffer(const std::shared_ptr<DataBuffer>& videoResult)
72     {
73     }
OnError(DataProcessErrorType errorType)74     void OnError(DataProcessErrorType errorType)
75     {
76     }
77 };
78 } // namespace DistributedHardware
79 } // namespace OHOS
80 #endif // OHOS_MOCK_DCAMERA_SINK_DATA_PROCESS_H
81