lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @File: codec_res_main_ctrl.h |
| 3 | * @Brief: Implementation of Device Manager in Sanechips |
| 4 | * |
| 5 | * Copyright (C) 2017 Sanechips Technology Co., Ltd. |
| 6 | * @Author: sun.quan@zte.com.cn |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * */ |
| 12 | #ifndef _AUDIO_RES_CTRL_ |
| 13 | #define _AUDIO_RES_CTRL_ |
| 14 | /******************************************************************************* |
| 15 | * Í·Îļþ * |
| 16 | ******************************************************************************/ |
| 17 | #include <sys/types.h> |
| 18 | #include <sys/ipc.h> |
| 19 | #include <sys/msg.h> |
| 20 | #include <stdio.h> |
| 21 | #include <errno.h> |
| 22 | #include <unistd.h> |
| 23 | |
| 24 | /******************************************************************************* |
| 25 | * ºê¶¨Òå * |
| 26 | ******************************************************************************/ |
| 27 | //#define MODULE_ID_CODEC 0 |
| 28 | |
| 29 | /******************************************************************************* |
| 30 | * Êý¾ÝÀàÐͶ¨Òå * |
| 31 | ******************************************************************************/ |
| 32 | |
| 33 | enum audio_type { |
| 34 | VOICE_23G = 0, |
| 35 | VOICE_VOLTE, |
| 36 | POC, |
| 37 | ZCORE, |
| 38 | }; |
| 39 | |
| 40 | enum audio_msg_type { |
| 41 | USE_AUDIO_REQ = 0, //¹©ÒµÎñÄ£¿éÉêÇëʹÓÃȨ |
| 42 | USE_AUDIO_RSP, //ÏûÏ¢µÚÒ»¸ö²ÎÊýָʾÉêÇë³É¹¦»¹ÊÇʧ°Ü£¬µÚ¶þ¸ö²ÎÊýָʾµ±Ç°Ê¹ÓõÄÒµÎñ |
| 43 | REL_AUDIO_REQ, //¹©Ö÷¿ØÇëÇóijҵÎñÄ£¿éÊÍ·ÅÕýÔÚ½øÐеÄAUDIOʹÓÃȨ |
| 44 | REL_AUDIO_IND, //ÇëÇóijҵÎñÄ£¿éÊÍ·ÅaudioµÄ½á¹ûÓ¦´ð£¬Èôʧ°Ü£¬¶ÏÑÔ£»»»ÑÔÖ®£¬±ØÐë³É¹¦ |
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame^] | 45 | IDLE_AUDIO_INFO, //Ö÷¿ØÍ¨ÖªËùÓÐÉêÇë¹ýAUDIO×ÊÔ´µÄÒµÎñÄ£¿é£¬¸æÖªµ±Ç°¿ÕÏУ¬ÒÔ½â¾öÒµÎñÄ£¿é´¦ÓÚ¹ÒÆð̬»ò֮ǰ±»Ç¿ÐÐÊͷŵÄÒµÎñÄ£¿é£¬ÈçMP3ÒôÀÖ²¥·ÅµÈ£» |
| 46 | EXIT_AUDIO_IND, //֪ͨÖ÷¿Ø£¬ÒµÎñÄ£¿éÍ˳öÒôƵ×ÊÔ´¾ºÕù |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | |
| 50 | typedef struct { |
| 51 | int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ |
| 52 | int moduleId; //ÉêÇëµÄÄ£¿éºÅ |
| 53 | int tempModuleId; |
| 54 | } T_audio_UseReq; |
| 55 | |
| 56 | typedef struct { |
| 57 | int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü |
| 58 | int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ |
| 59 | int using_type; //ָʾµ±Ç°ÕýÔÚʹÓõÄÒµÎñÀàÐÍ£¬Ê§°Üʱ¹©¾ßÌåÒµÎñÄ£¿é²éѯʹÓà |
| 60 | } T_audio_UseRsp; |
| 61 | |
| 62 | typedef struct { |
| 63 | int using_type; //ָʾµ±Ç°Äĸö¸ßÓÅÏȼ¶ÒµÎñÄ£¿éÔÚÉêÇë×ÊÔ´ |
| 64 | int mouleId; //Ä£¿éµÄid |
| 65 | } T_audio_RelReq; |
| 66 | |
| 67 | typedef struct { |
| 68 | int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü |
| 69 | int type; //ָʾÊÍ·Å¿ØÖÆÈ¨µÄÒµÎñ |
| 70 | int moduleId; //ÊÍ·Å¿ØÖÆÈ¨µÄÄ£¿éid |
| 71 | } T_audio_RelInd; |
| 72 | |
| 73 | |
| 74 | /* Ó¦ÓÃÇëÇócodec×ÊÔ´²ÎÊý */ |
| 75 | typedef struct audioResRequest |
| 76 | { |
| 77 | int moduleId; /* ÒµÎñÄ£¿éºÅ */ |
| 78 | int tempMouduleId; /* ÉêÇë×ÊÔ´µÄ½ÓÊÜÏûÏ¢ÁÙʱId */ |
| 79 | int audioType; /* ÒµÎñÀàÐÍ */ |
| 80 | }T_audio_Res_Request; |
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame^] | 81 | |
| 82 | typedef struct { |
| 83 | int type; |
| 84 | int moduleId; |
| 85 | } T_audio_ExitInd; |
| 86 | |
| 87 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 88 | /** |
| 89 | *º¯Êý˵Ã÷£ºÇëÇóʹÓÃcodec×ÊÔ´£¬µÈ´ýcodecÖ÷¿Ø»Ø¸´ |
| 90 | *@param : Ó¦ÓÃÇëÇóµÄ²ÎÊý |
| 91 | * |
| 92 | */ |
| 93 | BOOL audio_resource_request(struct audioResRequest *param, T_audio_UseRsp *RspData); |
| 94 | #endif |