1 /* 2 * Copyright (c) 2021-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 HISTREAMER_PIPELINE_CORE_FILTER_CALLBACK_H 17 #define HISTREAMER_PIPELINE_CORE_FILTER_CALLBACK_H 18 19 #include <string> 20 #include <vector> 21 22 #include "plugin/common/any.h" 23 #include "error_code.h" 24 25 namespace OHOS { 26 namespace Media { 27 namespace Pipeline { 28 class Filter; 29 30 // FilterCallback用于同步处理完再返回的场景 31 // Filter Callback Types 32 enum class FilterCallbackType { PORT_ADDED, PORT_REMOVE }; 33 34 enum class PortType { IN, OUT }; 35 36 struct PortDesc { 37 std::string name; 38 bool isPcm; 39 }; 40 41 struct PortInfo { 42 PortType type; 43 std::vector<PortDesc> ports; 44 }; 45 46 class FilterCallback { 47 public: 48 virtual ~FilterCallback() = default; 49 virtual ErrorCode OnCallback(const FilterCallbackType& type, Filter* filter, const Plugin::Any& parameter) = 0; 50 }; 51 } // namespace Pipeline 52 } // namespace Media 53 } // namespace OHOS 54 55 #endif // HISTREAMER_PIPELINE_CORE_FILTER_CALLBACK_H 56