1 /* 2 * Copyright (c) 2021-2024 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 OHOS_DCAMERA_PIPELINE_EVENT_H 17 #define OHOS_DCAMERA_PIPELINE_EVENT_H 18 19 #include <vector> 20 21 #include "data_buffer.h" 22 #include "image_common_type.h" 23 24 namespace OHOS { 25 namespace DistributedHardware { 26 enum class PipelineAction : int32_t { 27 NO_ACTION = 0, 28 }; 29 30 class PipelineConfig { 31 public: PipelineConfig()32 PipelineConfig() : pipelineType_(PipelineType::VIDEO) {} PipelineConfig(PipelineType pipelineType,const std::string & pipelineOwner,const std::vector<std::shared_ptr<DataBuffer>> & multiDataBuffers)33 PipelineConfig(PipelineType pipelineType, const std::string& pipelineOwner, 34 const std::vector<std::shared_ptr<DataBuffer>>& multiDataBuffers) 35 : pipelineType_(pipelineType), pipelineOwner_(pipelineOwner), multiDataBuffers_(multiDataBuffers) {} 36 ~PipelineConfig() = default; 37 SetPipelineType(PipelineType pipelineType)38 void SetPipelineType(PipelineType pipelineType) 39 { 40 pipelineType_ = pipelineType; 41 } 42 GetPipelineType()43 PipelineType GetPipelineType() const 44 { 45 return pipelineType_; 46 } 47 SetPipelineOwner(std::string pipelineOwner)48 void SetPipelineOwner(std::string pipelineOwner) 49 { 50 pipelineOwner_ = pipelineOwner; 51 } 52 GetPipelineOwner()53 std::string GetPipelineOwner() const 54 { 55 return pipelineOwner_; 56 } 57 SetDataBuffers(std::vector<std::shared_ptr<DataBuffer>> & multiDataBuffers)58 void SetDataBuffers(std::vector<std::shared_ptr<DataBuffer>>& multiDataBuffers) 59 { 60 multiDataBuffers_ = multiDataBuffers; 61 } 62 GetDataBuffers()63 std::vector<std::shared_ptr<DataBuffer>> GetDataBuffers() const 64 { 65 return multiDataBuffers_; 66 } 67 68 private: 69 PipelineType pipelineType_; 70 std::string pipelineOwner_; 71 std::vector<std::shared_ptr<DataBuffer>> multiDataBuffers_; 72 }; 73 } // namespace DistributedHardware 74 } // namespace OHOS 75 #endif // OHOS_DCAMERA_PIPELINE_EVENT_H 76