• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 OHOS_DCAMERA_CHANNEL_SINK_IMPL_H
17 #define OHOS_DCAMERA_CHANNEL_SINK_IMPL_H
18 
19 #include "icamera_channel.h"
20 
21 #include "dcamera_softbus_session.h"
22 
23 namespace OHOS {
24 namespace DistributedHardware {
25 class DCameraChannelSinkImpl : public ICameraChannel {
26 public:
27     DCameraChannelSinkImpl();
28     ~DCameraChannelSinkImpl() override;
29     int32_t OpenSession() override;
30     int32_t CloseSession() override;
31     int32_t CreateSession(std::vector<DCameraIndex>& camIndexs, std::string sessionFlag, DCameraSessionMode sessionMode,
32         std::shared_ptr<ICameraChannelListener>& listener) override;
33     int32_t ReleaseSession() override;
34     int32_t SendData(std::shared_ptr<DataBuffer>& buffer) override;
35 
36 private:
37     std::shared_ptr<ICameraChannelListener> listener_;
38     std::vector<DCameraIndex> camIndexs_;
39     std::shared_ptr<DCameraSoftbusSession> softbusSession_;
40     std::string mySessionName_;
41     DCameraSessionMode mode_ = DCAMERA_SESSION_MODE_CTRL;
42     const std::string SESSION_HEAD = "ohos.dhardware.dcamera_";
43 };
44 } // namespace DistributedHardware
45 } // namespace OHOS
46 #endif // OHOS_DCAMERA_CHANNEL_SINK_IMPL_H