1 /* 2 * Copyright (c) 2022 Shenzhen Kaihong DID 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 HDI_CODECINTERNAL_H 17 #define HDI_CODECINTERNAL_H 18 19 #include <stdint.h> 20 #include "codec_callback_if.h" 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif /* __cplusplus */ 25 26 #define CODEC_HDI_OMX_SERVICE_NAME "codec_hdi_omx_service" 27 #define COMPONENT_MANAGER_SERVICE_DESC "ohos.hdi.codec_service" 28 enum ComponentDispatchCmd { 29 CMD_CODEC_GET_COMPONENT_NUM, 30 CMD_CODEC_GET_COMPONENT_CAPABILITY_LIST, 31 CMD_CREATE_COMPONENT, 32 CMD_DESTROY_COMPONENT, 33 CMD_GET_COMPONENT_VERSION, 34 CMD_SEND_COMMAND, 35 CMD_GET_PARAMETER, 36 CMD_SET_PARAMETER, 37 CMD_GET_CONFIG, 38 CMD_SET_CONFIG, 39 CMD_GET_EXTENSION_INDEX, 40 CMD_GET_STATE, 41 CMD_COMPONENT_TUNNEL_REQUEST, 42 CMD_USE_BUFFER, 43 CMD_ALLOCATE_BUFFER, 44 CMD_FREE_BUFFER, 45 CMD_EMPTY_THIS_BUFFER, 46 CMD_FILL_THIS_BUFFER, 47 CMD_SET_CALLBACKS, 48 CMD_COMPONENT_DE_INIT, 49 CMD_USE_EGL_IMAGE, 50 CMD_COMPONENT_ROLE_ENUM, 51 }; 52 53 enum CallbackDispatchCmd { 54 CMD_EVENT_HANDLER, 55 CMD_EMPTY_BUFFER_DONE, 56 CMD_FILL_BUFFER_DONE, 57 }; 58 59 struct OmxComponentManager { 60 int32_t (*CreateComponent)(OMX_HANDLETYPE *compHandle, char *compName, void *appData, 61 int32_t appDataSize, struct CodecCallbackType *callbacks); 62 int32_t (*DestroyComponent)(OMX_HANDLETYPE compHandle); 63 }; 64 65 #ifdef __cplusplus 66 } 67 #endif /* __cplusplus */ 68 69 #endif // HDI_OMXCOMPONENTTYPE_H