blob: e36ffeb58e577e3dc033691743fc1fde7aaf88b9 [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, //֪ͨÖ÷¿Ø£¬ÒµÎñÄ£¿éÍ˳öÒôƵ×ÊÔ´¾ºÕù
lh9ed821d2023-04-07 01:36:19 -070047};
48
49
50typedef struct {
51 int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ
52 int moduleId; //ÉêÇëµÄÄ£¿éºÅ
53 int tempModuleId;
54} T_audio_UseReq;
55
56typedef struct {
57 int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü
58 int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ
59 int using_type; //ָʾµ±Ç°ÕýÔÚʹÓõÄÒµÎñÀàÐÍ£¬Ê§°Üʱ¹©¾ßÌåÒµÎñÄ£¿é²éѯʹÓÃ
60} T_audio_UseRsp;
61
62typedef struct {
63 int using_type; //ָʾµ±Ç°Äĸö¸ßÓÅÏȼ¶ÒµÎñÄ£¿éÔÚÉêÇë×ÊÔ´
64 int mouleId; //Ä£¿éµÄid
65} T_audio_RelReq;
66
67typedef struct {
68 int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü
69 int type; //ָʾÊÍ·Å¿ØÖÆÈ¨µÄÒµÎñ
70 int moduleId; //ÊÍ·Å¿ØÖÆÈ¨µÄÄ£¿éid
71} T_audio_RelInd;
72
73
74/* Ó¦ÓÃÇëÇócodec×ÊÔ´²ÎÊý */
75typedef struct audioResRequest
76{
77 int moduleId; /* ÒµÎñÄ£¿éºÅ */
78 int tempMouduleId; /* ÉêÇë×ÊÔ´µÄ½ÓÊÜÏûÏ¢ÁÙʱId */
79 int audioType; /* ÒµÎñÀàÐÍ */
80}T_audio_Res_Request;
xf.liaa4d92f2023-09-13 00:18:58 -070081
82typedef struct {
83 int type;
84 int moduleId;
85} T_audio_ExitInd;
86
87
lh9ed821d2023-04-07 01:36:19 -070088/**
89 *º¯Êý˵Ã÷£ºÇëÇóʹÓÃcodec×ÊÔ´£¬µÈ´ýcodecÖ÷¿Ø»Ø¸´
90 *@param : Ó¦ÓÃÇëÇóµÄ²ÎÊý
91 *
92 */
93BOOL audio_resource_request(struct audioResRequest *param, T_audio_UseRsp *RspData);
94#endif