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 #if defined(VIDEO_SUPPORT) 16 17 #ifndef HISTREAMER_PLUGIN_CODEC_PORT_H 18 #define HISTREAMER_PLUGIN_CODEC_PORT_H 19 #include "codec_component_if.h" 20 #include "foundation/osal/thread/condition_variable.h" 21 #include "foundation/osal/thread/mutex.h" 22 #include "plugin/common/plugin_types.h" 23 #include "plugin/common/plugin_meta.h" 24 #include "OMX_Component.h" 25 26 namespace OHOS { 27 namespace Media { 28 namespace Plugin { 29 namespace CodecAdapter { 30 struct PortInfo { 31 uint32_t bufferCount{}; 32 uint32_t bufferSize{}; 33 bool enabled{false}; 34 }; 35 36 class CodecPort { 37 public: 38 CodecPort(CodecComponentType* component, uint32_t portIndex, const CompVerInfo& verInfo); 39 ~CodecPort() = default; 40 Status Config(Meta& meta); 41 Status QueryParam(PortInfo& portInfo); 42 private: 43 CodecComponentType* codecComp_ {nullptr}; 44 OMX_PARAM_PORTDEFINITIONTYPE portDef_ {}; 45 CompVerInfo verInfo_ {}; 46 }; 47 } // namespace CodecAdapter 48 } // namespace Plugin 49 } // namespace Media 50 } // namespace OHOS 51 #endif // HISTREAMER_PLUGIN_CODEC_PORT_H 52 #endif