1 /* 2 * Copyright (c) 2023-2023 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 HISTREAMER_PIPELINE_FILTER_PLUGIN_SETTINGS_H 17 #define HISTREAMER_PIPELINE_FILTER_PLUGIN_SETTINGS_H 18 19 #include <functional> 20 #include <tuple> 21 22 #include "pipeline/core/filter_type.h" 23 #include "plugin/common/plugin_tags.h" 24 #include "plugin/common/plugin_types.h" 25 26 namespace OHOS { 27 namespace Media { 28 namespace Pipeline { 29 constexpr uint8_t PARAM_GET = 0x01; 30 constexpr uint8_t PARAM_SET = 0x02; 31 using PluginParaAllowedMap = std::map<Plugin::Tag, 32 std::pair<std::function<bool(Plugin::Tag, const Plugin::ValueType&)>, uint8_t>>; 33 34 class PluginParameterTable { 35 public: 36 static PluginParameterTable& GetInstance(); 37 PluginParameterTable(); 38 const PluginParaAllowedMap& FindAllowedParameterMap(FilterType category); 39 40 private: 41 void Init(); 42 std::map<FilterType, PluginParaAllowedMap> table_; 43 void InitAudioTable(); 44 void InitMuxerTable(); 45 void InitVideoTable(); 46 }; 47 } // Pipeline 48 } // Media 49 } // OHOS 50 #endif // HISTREAMER_PIPELINE_FILTER_PLUGIN_SETTINGS_H 51