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