• 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 STREAM_OPERATOR_STREAM_OPERATOR_H
17 #define STREAM_OPERATOR_STREAM_OPERATOR_H
18 
19 #include "istream_operator.h"
20 #include "stream_operator_c_if.h"
21 #include "stream_operator_stub.h"
22 
23 namespace OHOS::Camera {
24 class StreamOperator : public StreamOperatorStub {
25 public:
26     void Init(StreamOperatorCIF* op);
27     CamRetCode IsStreamsSupported(OperationMode mode,
28         const std::shared_ptr<CameraMetadata> &modeSetting,
29         const std::shared_ptr<StreamInfo> &pInfo,
30         StreamSupportType &pType) override;
31     CamRetCode CreateStreams(const std::vector<std::shared_ptr<StreamInfo>> &streamInfos) override;
32     CamRetCode ReleaseStreams(const std::vector<int> &streamIds) override;
33     CamRetCode CommitStreams(OperationMode mode,
34         const std::shared_ptr<CameraMetadata> &modeSetting) override;
35     CamRetCode GetStreamAttributes(std::vector<std::shared_ptr<StreamAttribute>> &attributes) override;
36     CamRetCode AttachBufferQueue(int streamId, const OHOS::sptr<OHOS::IBufferProducer> &producer) override;
37     CamRetCode DetachBufferQueue(int streamId) override;
38     CamRetCode Capture(int captureId, const std::shared_ptr<CaptureInfo> &pInfo,  bool isStreaming) override;
39     CamRetCode CancelCapture(int captureId) override;
40     CamRetCode ChangeToOfflineStream(const std::vector<int> &streamIds,
41         OHOS::sptr<IStreamOperatorCallback> &callback,
42         OHOS::sptr<IOfflineStreamOperator> &offlineOperator) override;
43 
44 public:
45     StreamOperator();
46     virtual ~StreamOperator();
47     StreamOperator(const StreamOperator &other) = delete;
48     StreamOperator(StreamOperator &&other) = delete;
49     StreamOperator& operator=(const StreamOperator &other) = delete;
50     StreamOperator& operator=(StreamOperator &&other) = delete;
51 
52 private:
53     StreamOperatorCIF* operator_ = nullptr;
54 };
55 } // end namespace OHOS::Camera
56 #endif // STREAM_OPERATOR_STREAM_OPERATOR_H
57