• 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 HDI_STREAM_OPERATOR_CLIENT_PROXY_H
17 #define HDI_STREAM_OPERATOR_CLIENT_PROXY_H
18 
19 #include <iremote_proxy.h>
20 #include "istream_operator.h"
21 #include "cmd_common.h"
22 
23 namespace OHOS::Camera {
24 class StreamOperatorProxy : public IRemoteProxy<IStreamOperator> {
25 public:
StreamOperatorProxy(const sptr<IRemoteObject> & impl)26     explicit StreamOperatorProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy<IStreamOperator>(impl) {}
27     virtual ~StreamOperatorProxy() = default;
28 
29     virtual CamRetCode IsStreamsSupported(
30         OperationMode mode,
31         const std::shared_ptr<CameraMetadata> &modeSetting,
32         const std::vector<std::shared_ptr<StreamInfo>>& pInfo,
33         StreamSupportType &pType) override;
34     virtual CamRetCode CreateStreams(
35         const std::vector<std::shared_ptr<StreamInfo>> &streamInfos) override;
36     virtual CamRetCode ReleaseStreams(const std::vector<int> &streamIds) override;
37     virtual CamRetCode CommitStreams(OperationMode mode,
38         const std::shared_ptr<CameraMetadata> &modeSetting) override;
39     virtual CamRetCode GetStreamAttributes(
40         std::vector<std::shared_ptr<StreamAttribute>> &attributes) override;
41     virtual CamRetCode AttachBufferQueue(int streamId,
42         const OHOS::sptr<OHOS::IBufferProducer> &producer) override;
43     virtual CamRetCode DetachBufferQueue(int streamId) override;
44     virtual CamRetCode Capture(int captureId,
45         const std::shared_ptr<CaptureInfo> &pInfo,  bool isStreaming) override;
46     virtual CamRetCode CancelCapture(int captureId) override;
47     virtual CamRetCode ChangeToOfflineStream(const std::vector<int> &streamIds,
48         OHOS::sptr<IStreamOperatorCallback> &callback,
49         OHOS::sptr<IOfflineStreamOperator> &offlineOperator) override;
50 
51 private:
52     static inline BrokerDelegator<StreamOperatorProxy> delegator_;
53 };
54 }
55 #endif // HDI_STREAM_OPERATOR_CLIENT_PROXY_H