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 21 namespace OHOS::Camera { 22 class StreamPipelineBuilder : public NoCopyable, ConfigParser { 23 public: 24 std::shared_ptr<Pipeline> BuildOperation(const std::shared_ptr<PipelineSpec>& pipelineSpec); 25 static std::unique_ptr<StreamPipelineBuilder> Create(const std::shared_ptr<HostStreamMgr>& streamMgr); 26 virtual std::shared_ptr<Pipeline> Build(const std::shared_ptr<PipelineSpec>& pipelineSpec); 27 virtual RetCode Destroy(int32_t streamType = -1); 28 StreamPipelineBuilder(const std::shared_ptr<HostStreamMgr>& streamMgr, const std::shared_ptr<Pipeline>& p); 29 virtual ~StreamPipelineBuilder() = default; 30 protected: 31 std::shared_ptr<HostStreamMgr> hostStreamMgr_ = nullptr; 32 std::shared_ptr<Pipeline> pipeline_ = nullptr; 33 }; 34 } 35 #endif 36