blob: 6b08b410088280943e66c0d4fc6354b4234376e5 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/**
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
33enum audio_type {
34 VOICE_23G = 0,
35 VOICE_VOLTE,
36 POC,
37 ZCORE,
38};
39
40enum 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.liaa4d92f2023-09-13 00:18:58 -070045 IDLE_AUDIO_INFO, //Ö÷¿ØÍ¨ÖªËùÓÐÉêÇë¹ýAUDIO×ÊÔ´µÄÒµÎñÄ£¿é£¬¸æÖªµ±Ç°¿ÕÏУ¬ÒÔ½â¾öÒµÎñÄ£¿é´¦ÓÚ¹ÒÆð̬»ò֮ǰ±»Ç¿ÐÐÊͷŵÄÒµÎñÄ£¿é£¬ÈçMP3ÒôÀÖ²¥·ÅµÈ£»
46 EXIT_AUDIO_IND, //֪ͨÖ÷¿Ø£¬ÒµÎñÄ£¿éÍ˳öÒôƵ×ÊÔ´¾ºÕù
xf.lia7d2a2b2025-02-10 01:44:22 -080047 EXIT_AUDIO_REQ, //ÇëÇóÒµÎñÄ£¿éÍ˳öÒôƵ×ÊÔ´¾ºÕù
48 EXIT_AUDIO_RSP, //ÏìÓ¦ÒµÎñÄ£¿éÍ˳öÒôƵ×ÊÔ´¾ºÕù
lh9ed821d2023-04-07 01:36:19 -070049};
50
51
52typedef struct {
53 int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ
54 int moduleId; //ÉêÇëµÄÄ£¿éºÅ
55 int tempModuleId;
56} T_audio_UseReq;
57
58typedef struct {
59 int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü
60 int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ
61 int using_type; //ָʾµ±Ç°ÕýÔÚʹÓõÄÒµÎñÀàÐÍ£¬Ê§°Üʱ¹©¾ßÌåÒµÎñÄ£¿é²éѯʹÓÃ
62} T_audio_UseRsp;
63
64typedef struct {
65 int using_type; //ָʾµ±Ç°Äĸö¸ßÓÅÏȼ¶ÒµÎñÄ£¿éÔÚÉêÇë×ÊÔ´
66 int mouleId; //Ä£¿éµÄid
67} T_audio_RelReq;
68
69typedef struct {
70 int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü
71 int type; //ָʾÊÍ·Å¿ØÖÆÈ¨µÄÒµÎñ
72 int moduleId; //ÊÍ·Å¿ØÖÆÈ¨µÄÄ£¿éid
73} T_audio_RelInd;
74
75
76/* Ó¦ÓÃÇëÇócodec×ÊÔ´²ÎÊý */
77typedef struct audioResRequest
78{
79 int moduleId; /* ÒµÎñÄ£¿éºÅ */
80 int tempMouduleId; /* ÉêÇë×ÊÔ´µÄ½ÓÊÜÏûÏ¢ÁÙʱId */
81 int audioType; /* ÒµÎñÀàÐÍ */
82}T_audio_Res_Request;
xf.liaa4d92f2023-09-13 00:18:58 -070083
84typedef struct {
85 int type;
86 int moduleId;
87} T_audio_ExitInd;
88
89
lh9ed821d2023-04-07 01:36:19 -070090/**
91 *º¯Êý˵Ã÷£ºÇëÇóʹÓÃcodec×ÊÔ´£¬µÈ´ýcodecÖ÷¿Ø»Ø¸´
92 *@param : Ó¦ÓÃÇëÇóµÄ²ÎÊý
93 *
94 */
95BOOL audio_resource_request(struct audioResRequest *param, T_audio_UseRsp *RspData);
96#endif