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