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 RECORDER_PIPELINE_LINK_HELPER_H 17 #define RECORDER_PIPELINE_LINK_HELPER_H 18 19 #include <gst/gstelement.h> 20 #include <gst/gstpad.h> 21 #include "recorder_element.h" 22 #include "recorder_pipeline.h" 23 24 namespace OHOS { 25 namespace Media { 26 class RecorderPipelineLinkHelper : public NoCopyable { 27 public: 28 RecorderPipelineLinkHelper(const std::shared_ptr<RecorderPipeline> &pipeline, 29 const std::shared_ptr<RecorderPipelineDesc> &desc); 30 ~RecorderPipelineLinkHelper(); 31 32 int32_t ExecuteLink(); 33 34 private: 35 GstPad *GetGstPad(const std::shared_ptr<RecorderElement> &elem, bool isStaticPad, const std::string &padName); 36 int32_t ExecuteOneLink(const std::shared_ptr<RecorderElement> &srcElem, 37 const RecorderPipelineDesc::LinkDesc &linkDesc); 38 void Clear(); 39 40 std::shared_ptr<RecorderPipeline> pipeline_; 41 std::shared_ptr<RecorderPipelineDesc> desc_; 42 std::map<GstElement *, std::vector<GstPad *>> requestedPads_; 43 }; 44 } // namespace Media 45 } // namespace OHOS 46 #endif 47