1c5e268c6Sopenharmony_ci/*
2c5e268c6Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License.
5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at
6c5e268c6Sopenharmony_ci *
7c5e268c6Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8c5e268c6Sopenharmony_ci *
9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and
13c5e268c6Sopenharmony_ci * limitations under the License.
14c5e268c6Sopenharmony_ci */
15c5e268c6Sopenharmony_ci
16c5e268c6Sopenharmony_ci/**
17c5e268c6Sopenharmony_ci * @addtogroup Codec
18c5e268c6Sopenharmony_ci * @{
19c5e268c6Sopenharmony_ci *
20c5e268c6Sopenharmony_ci * @brief Defines APIs of the Codec module.
21c5e268c6Sopenharmony_ci *
22c5e268c6Sopenharmony_ci * The Codec module provides APIs for initializing the custom data and audio and video codecs,
23c5e268c6Sopenharmony_ci * setting codec parameters, and controlling and transferring data.
24c5e268c6Sopenharmony_ci *
25c5e268c6Sopenharmony_ci * @since 4.1
26c5e268c6Sopenharmony_ci * @version 2.0
27c5e268c6Sopenharmony_ci */
28c5e268c6Sopenharmony_ci
29c5e268c6Sopenharmony_ci/**
30c5e268c6Sopenharmony_ci * @file ICodecComponentManager.idl
31c5e268c6Sopenharmony_ci *
32c5e268c6Sopenharmony_ci * @brief Declares the APIs for managing Codec components.
33c5e268c6Sopenharmony_ci *
34c5e268c6Sopenharmony_ci * You can use the APIs to obtain the component encoding and decoding capabilities, and create or destroy components.
35c5e268c6Sopenharmony_ci *
36c5e268c6Sopenharmony_ci * @since 4.1
37c5e268c6Sopenharmony_ci * @version 2.0
38c5e268c6Sopenharmony_ci */
39c5e268c6Sopenharmony_ci
40c5e268c6Sopenharmony_ci/**
41c5e268c6Sopenharmony_ci * @brief Defines the path for the package of the Codec module APIs.
42c5e268c6Sopenharmony_ci *
43c5e268c6Sopenharmony_ci * @since 4.1
44c5e268c6Sopenharmony_ci * @version 2.0
45c5e268c6Sopenharmony_ci */
46c5e268c6Sopenharmony_cipackage ohos.hdi.codec.v2_0;
47c5e268c6Sopenharmony_ci
48c5e268c6Sopenharmony_ciimport ohos.hdi.codec.v2_0.CodecTypes;
49c5e268c6Sopenharmony_ciimport ohos.hdi.codec.v2_0.ICodecComponent;
50c5e268c6Sopenharmony_ciimport ohos.hdi.codec.v2_0.ICodecCallback;
51c5e268c6Sopenharmony_ci
52c5e268c6Sopenharmony_ci/**
53c5e268c6Sopenharmony_ci * @brief Defines the APIs for managing the codec components.
54c5e268c6Sopenharmony_ci *
55c5e268c6Sopenharmony_ci * The APIs can be used to:
56c5e268c6Sopenharmony_ci * - Obtain the number of codec components and codec capabilities.
57c5e268c6Sopenharmony_ci * - Create or destroy a codec component.
58c5e268c6Sopenharmony_ci */
59c5e268c6Sopenharmony_ci
60c5e268c6Sopenharmony_ciinterface ICodecComponentManager {
61c5e268c6Sopenharmony_ci
62c5e268c6Sopenharmony_ci    /**
63c5e268c6Sopenharmony_ci     * @brief Obtains the number of codec components.
64c5e268c6Sopenharmony_ci     *
65c5e268c6Sopenharmony_ci     * Codec capabilities can be further obtained based on the number of codec components.
66c5e268c6Sopenharmony_ci     *
67c5e268c6Sopenharmony_ci     * @param count Indicates the number of codec components obtained.
68c5e268c6Sopenharmony_ci     *
69c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
70c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_ERR_INVALID_PARAM</b> if the operation fails due to invalid parameters.
71c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
72c5e268c6Sopenharmony_ci     * @return Returns other values if the underlying layer returns a failure. For details about the
73c5e268c6Sopenharmony_ci     * error codes, see <b>OMX_ERRORTYPE</b> defined by OpenMAX IL.
74c5e268c6Sopenharmony_ci     *
75c5e268c6Sopenharmony_ci     * @since 4.1
76c5e268c6Sopenharmony_ci     */
77c5e268c6Sopenharmony_ci    GetComponentNum([out] int count);
78c5e268c6Sopenharmony_ci	
79c5e268c6Sopenharmony_ci    /**
80c5e268c6Sopenharmony_ci     * @brief Obtains codec capabilities.
81c5e268c6Sopenharmony_ci     *
82c5e268c6Sopenharmony_ci     * You can use this API to obtain the encoding and decoding capabilities provided by the Codec module.
83c5e268c6Sopenharmony_ci     * For details, see {@link CodecCompCapability}.
84c5e268c6Sopenharmony_ci     *
85c5e268c6Sopenharmony_ci     * @param capList Indicates the codec capabilities {@link CodecCompCapability} obtained.
86c5e268c6Sopenharmony_ci     * @param count Indicates the number of codec components, which is obtained by {@link GetComponentNum}.
87c5e268c6Sopenharmony_ci     *
88c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
89c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_ERR_INVALID_PARAM</b> if the operation fails due to invalid parameters.
90c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
91c5e268c6Sopenharmony_ci     * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
92c5e268c6Sopenharmony_ci     * see <b>OMX_ERRORTYPE</b> defined by OpenMAX IL.
93c5e268c6Sopenharmony_ci     *
94c5e268c6Sopenharmony_ci     * @since 4.1
95c5e268c6Sopenharmony_ci     */
96c5e268c6Sopenharmony_ci    GetComponentCapabilityList([out] struct CodecCompCapability[] capList, [in] int count);
97c5e268c6Sopenharmony_ci	
98c5e268c6Sopenharmony_ci    /**
99c5e268c6Sopenharmony_ci     * @brief Creates a codec component instance.
100c5e268c6Sopenharmony_ci     *
101c5e268c6Sopenharmony_ci     * 
102c5e268c6Sopenharmony_ci     *
103c5e268c6Sopenharmony_ci     * @param component Indicates the pointer to the Codec component created.
104c5e268c6Sopenharmony_ci     * @param componentId Indicates the ID of the component created.
105c5e268c6Sopenharmony_ci     * @param compName Indicates the component name.
106c5e268c6Sopenharmony_ci     * @param appData Indicates the pointer to an application-defined value that will be returned by the callback.
107c5e268c6Sopenharmony_ci     * @param callbacks Indicates the pointer to the OMX_CALLBACKTYPE structure. For details,
108c5e268c6Sopenharmony_ci     * see {@link ICodecCallback}.
109c5e268c6Sopenharmony_ci     *
110c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
111c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_ERR_INVALID_PARAM</b> if the operation fails due to invalid parameters.
112c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
113c5e268c6Sopenharmony_ci     * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
114c5e268c6Sopenharmony_ci     * see <b>OMX_ERRORTYPE</b> defined by OpenMAX IL.
115c5e268c6Sopenharmony_ci     *
116c5e268c6Sopenharmony_ci     * @since 4.1
117c5e268c6Sopenharmony_ci     */
118c5e268c6Sopenharmony_ci    CreateComponent([out] ICodecComponent component, [out] unsigned int componentId, [in] String compName,
119c5e268c6Sopenharmony_ci        [in] long appData, [in] ICodecCallback callbacks);
120c5e268c6Sopenharmony_ci	
121c5e268c6Sopenharmony_ci	/**
122c5e268c6Sopenharmony_ci     * @brief Destroys a codec component instance.
123c5e268c6Sopenharmony_ci     *
124c5e268c6Sopenharmony_ci     *
125c5e268c6Sopenharmony_ci     *
126c5e268c6Sopenharmony_ci     * @param componentId Indicates the ID of the codec component to destroy.
127c5e268c6Sopenharmony_ci     *
128c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
129c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_ERR_INVALID_PARAM</b> if the operation fails due to invalid parameters.
130c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
131c5e268c6Sopenharmony_ci     * @return Returns other values if the underlying layer returns a failure. For details about the
132c5e268c6Sopenharmony_ci     * error codes, see <b>OMX_ERRORTYPE</b> defined by OpenMAX IL.
133c5e268c6Sopenharmony_ci     *
134c5e268c6Sopenharmony_ci     * @since 4.1
135c5e268c6Sopenharmony_ci     */
136c5e268c6Sopenharmony_ci    DestroyComponent([in] unsigned int componentId);
137c5e268c6Sopenharmony_ci}