1/* 2 * Copyright (c) 2022 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/** 17 * @addtogroup Codec 18 * @{ 19 * 20 * @brief Defines APIs of the Codec module. 21 * 22 * The Codec module provides APIs for initializing the custom data and audio and video codecs, 23 * setting codec parameters, and controlling and transferring data. 24 * 25 * @since 3.2 26 * @version 1.0 27 */ 28 29/** 30 * @file ICodecComponentManager.idl 31 * 32 * @brief Declares the APIs for managing Codec components. 33 * 34 * You can use the APIs to obtain the component encoding and decoding capabilities, and create or destroy components. 35 * 36 * @since 3.2 37 * @version 1.0 38 */ 39 40/** 41 * @brief Defines the path for the package of the Codec module APIs. 42 * 43 * @since 3.2 44 * @version 1.0 45 */ 46package ohos.hdi.codec.v1_0; 47 48import ohos.hdi.codec.v1_0.CodecTypes; 49import ohos.hdi.codec.v1_0.ICodecComponent; 50 51/** 52 * @brief Defines the APIs for managing the codec components. 53 * 54 * The APIs can be used to: 55 * - Obtain the number of codec components and codec capabilities. 56 * - Create or destroy a codec component. 57 */ 58 59interface ICodecComponentManager { 60 61 /** 62 * @brief Obtains the number of codec components. 63 * 64 * Codec capabilities can be further obtained based on the number of codec components. 65 * 66 * @param count Indicates the number of codec components obtained. 67 * 68 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 69 * @return Returns <b>HDF_ERR_INVALID_PARAM</b> if the operation fails due to invalid parameters. 70 * @return Returns <b>HDF_FAILURE</b> if the execution fails. 71 * @return Returns other values if the underlying layer returns a failure. For details about the 72 * error codes, see <b>OMX_ERRORTYPE</b> defined by OpenMAX IL. 73 * 74 * @since 3.2 75 */ 76 GetComponentNum([out] int count); 77 78 /** 79 * @brief Obtains codec capabilities. 80 * 81 * You can use this API to obtain the encoding and decoding capabilities provided by the Codec module. 82 * For details, see {@link CodecCompCapability}. 83 * 84 * @param capList Indicates the codec capabilities {@link CodecCompCapability} obtained. 85 * @param count Indicates the number of codec components, which is obtained by {@link GetComponentNum}. 86 * 87 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 88 * @return Returns <b>HDF_ERR_INVALID_PARAM</b> if the operation fails due to invalid parameters. 89 * @return Returns <b>HDF_FAILURE</b> if the execution fails. 90 * @return Returns other values if the underlying layer returns a failure. For details about the error codes, 91 * see <b>OMX_ERRORTYPE</b> defined by OpenMAX IL. 92 * 93 * @since 3.2 94 */ 95 GetComponentCapabilityList([out] struct CodecCompCapability[] capList, [in] int count); 96 97 /** 98 * @brief Creates a codec component instance. 99 * 100 * 101 * 102 * @param component Indicates the pointer to the Codec component created. 103 * @param componentId Indicates the ID of the component created. 104 * @param compName Indicates the component name. 105 * @param appData Indicates the pointer to an application-defined value that will be returned by the callback. 106 * @param callbacks Indicates the pointer to the OMX_CALLBACKTYPE structure. For details, 107 * see {@link ICodecCallback}. 108 * 109 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 110 * @return Returns <b>HDF_ERR_INVALID_PARAM</b> if the operation fails due to invalid parameters. 111 * @return Returns <b>HDF_FAILURE</b> if the execution fails. 112 * @return Returns other values if the underlying layer returns a failure. For details about the error codes, 113 * see <b>OMX_ERRORTYPE</b> defined by OpenMAX IL. 114 * 115 * @since 3.2 116 */ 117 CreateComponent([out] ICodecComponent component, [out] unsigned int componentId, [in] String compName, 118 [in] long appData, [in] ICodecCallback callbacks); 119 120 /** 121 * @brief Destroys a codec component instance. 122 * 123 * 124 * 125 * @param componentId Indicates the ID of the codec component to destroy. 126 * 127 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 128 * @return Returns <b>HDF_ERR_INVALID_PARAM</b> if the operation fails due to invalid parameters. 129 * @return Returns <b>HDF_FAILURE</b> if the execution fails. 130 * @return Returns other values if the underlying layer returns a failure. For details about the 131 * error codes, see <b>OMX_ERRORTYPE</b> defined by OpenMAX IL. 132 * 133 * @since 3.2 134 */ 135 DestoryComponent([in] unsigned int componentId); 136}