blob: 74914a36995f56ddd73e3a59edda8cc699b85c4e [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µÄ½á¹ûÓ¦´ð£¬Èôʧ°Ü£¬¶ÏÑÔ£»»»ÑÔÖ®£¬±ØÐë³É¹¦
45 IDLE_AUDIO_INFO //Ö÷¿ØÍ¨ÖªËùÓÐÉêÇë¹ýAUDIO×ÊÔ´µÄÒµÎñÄ£¿é£¬¸æÖªµ±Ç°¿ÕÏУ¬ÒÔ½â¾öÒµÎñÄ£¿é´¦ÓÚ¹ÒÆð̬»ò֮ǰ±»Ç¿ÐÐÊͷŵÄÒµÎñÄ£¿é£¬ÈçMP3ÒôÀÖ²¥·ÅµÈ£»
46};
47
48
49typedef struct {
50 int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ
51 int moduleId; //ÉêÇëµÄÄ£¿éºÅ
52 int tempModuleId;
53} T_audio_UseReq;
54
55typedef struct {
56 int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü
57 int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ
58 int using_type; //ָʾµ±Ç°ÕýÔÚʹÓõÄÒµÎñÀàÐÍ£¬Ê§°Üʱ¹©¾ßÌåÒµÎñÄ£¿é²éѯʹÓÃ
59} T_audio_UseRsp;
60
61typedef struct {
62 int using_type; //ָʾµ±Ç°Äĸö¸ßÓÅÏȼ¶ÒµÎñÄ£¿éÔÚÉêÇë×ÊÔ´
63 int mouleId; //Ä£¿éµÄid
64} T_audio_RelReq;
65
66typedef struct {
67 int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü
68 int type; //ָʾÊÍ·Å¿ØÖÆÈ¨µÄÒµÎñ
69 int moduleId; //ÊÍ·Å¿ØÖÆÈ¨µÄÄ£¿éid
70} T_audio_RelInd;
71
72
73/* Ó¦ÓÃÇëÇócodec×ÊÔ´²ÎÊý */
74typedef struct audioResRequest
75{
76 int moduleId; /* ÒµÎñÄ£¿éºÅ */
77 int tempMouduleId; /* ÉêÇë×ÊÔ´µÄ½ÓÊÜÏûÏ¢ÁÙʱId */
78 int audioType; /* ÒµÎñÀàÐÍ */
79}T_audio_Res_Request;
80/**
81 *º¯Êý˵Ã÷£ºÇëÇóʹÓÃcodec×ÊÔ´£¬µÈ´ýcodecÖ÷¿Ø»Ø¸´
82 *@param : Ó¦ÓÃÇëÇóµÄ²ÎÊý
83 *
84 */
85BOOL audio_resource_request(struct audioResRequest *param, T_audio_UseRsp *RspData);
86#endif