• 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  *     http://www.apache.org/licenses/LICENSE-2.0
7  * Unless required by applicable law or agreed to in writing, software
8  * distributed under the License is distributed on an "AS IS" BASIS,
9  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10  * See the License for the specific language governing permissions and
11  * limitations under the License.
12  */
13 
14 #ifndef STREAM_PIPELINE_BUILDER_H
15 #define STREAM_PIPELINE_BUILDER_H
16 #include "stream_pipeline_data_structure.h"
17 #include "host_stream_mgr.h"
18 #include "config_parser.h"
19 #include "no_copyable.h"
20 #include <set>
21 
22 namespace OHOS::Camera {
23 class StreamPipelineBuilder : public NoCopyable, ConfigParser {
24 public:
25     std::shared_ptr<Pipeline> BuildOperation(const std::shared_ptr<PipelineSpec>& pipelineSpec);
26     static std::unique_ptr<StreamPipelineBuilder> Create(const std::shared_ptr<HostStreamMgr>& streamMgr);
27     virtual std::shared_ptr<Pipeline> Build(const std::shared_ptr<PipelineSpec>& pipelineSpec,
28                                             const std::string &cameraId);
29     virtual RetCode Destroy(int32_t streamType = -1);
30     StreamPipelineBuilder(const std::shared_ptr<HostStreamMgr>& streamMgr, const std::shared_ptr<Pipeline>& p);
31     virtual ~StreamPipelineBuilder() = default;
32 protected:
33     std::shared_ptr<HostStreamMgr> hostStreamMgr_ = nullptr;
34     std::shared_ptr<Pipeline> pipeline_ = nullptr;
35 private:
36     void SetMaxSize(const std::set<std::vector<int32_t>>& sizeSet);
37 };
38 }
39 #endif
40