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 ISTREAM_PIPELINE_CORE_H 15 #define ISTREAM_PIPELINE_CORE_H 16 #include <stdint.h> 17 #include <memory> 18 #include "host_stream_mgr.h" 19 #include "no_copyable.h" 20 #include "idevice_manager.h" 21 #include "offline_pipeline.h" 22 #include "camera_metadata_info.h" 23 #include "stream.h" 24 25 namespace OHOS::Camera { 26 27 struct NodeContext { 28 std::shared_ptr<HostStreamMgr> streamMgr_ = nullptr; 29 }; 30 31 class IStreamPipelineCore : public NoCopyable { 32 public: 33 static std::shared_ptr<IStreamPipelineCore> Create(const std::shared_ptr<NodeContext>& c); 34 virtual RetCode Init(const std::string &cameraId) = 0; 35 virtual RetCode PreConfig(const ModeMeta& meta) = 0; 36 virtual RetCode CreatePipeline(const int32_t& mode) = 0; 37 virtual RetCode DestroyPipeline(const std::vector<int32_t>& ids) = 0; 38 virtual RetCode Prepare(const std::vector<int32_t>& ids) = 0; 39 virtual RetCode Start(const std::vector<int32_t>& ids) = 0; 40 virtual RetCode SetCallback(const MetaDataCb cb) = 0; 41 virtual RetCode Flush(const std::vector<int32_t>& ids) = 0; 42 virtual RetCode Stop(const std::vector<int32_t>& ids) = 0; 43 virtual RetCode Config(const std::vector<int32_t>& ids, const CaptureMeta& meta) = 0; 44 virtual ~IStreamPipelineCore() = default; 45 virtual std::shared_ptr<OfflinePipeline> GetOfflinePipeline(const int32_t id) = 0; 46 virtual RetCode Capture(const std::vector<int32_t>& ids, const int32_t captureId) = 0; 47 virtual RetCode CancelCapture(const std::vector<int32_t>& ids) = 0; 48 virtual VdiOperationMode GetCurrentMode() const = 0; 49 virtual DynamicStreamSwitchMode CheckStreamsSupported(VdiOperationMode mode, 50 const ModeMeta& meta, const std::vector<StreamConfiguration>& configs) = 0; 51 }; 52 } 53 #endif 54