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