blob: 74914a36995f56ddd73e3a59edda8cc699b85c4e [file] [log] [blame]
/**
* @File: codec_res_main_ctrl.h
* @Brief: Implementation of Device Manager in Sanechips
*
* Copyright (C) 2017 Sanechips Technology Co., Ltd.
* @Author: sun.quan@zte.com.cn
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* */
#ifndef _AUDIO_RES_CTRL_
#define _AUDIO_RES_CTRL_
/*******************************************************************************
* Í·Îļþ *
******************************************************************************/
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
/*******************************************************************************
* ºê¶¨Òå *
******************************************************************************/
//#define MODULE_ID_CODEC 0
/*******************************************************************************
* Êý¾ÝÀàÐͶ¨Òå *
******************************************************************************/
enum audio_type {
VOICE_23G = 0,
VOICE_VOLTE,
POC,
ZCORE,
};
enum audio_msg_type {
USE_AUDIO_REQ = 0, //¹©ÒµÎñÄ£¿éÉêÇëʹÓÃȨ
USE_AUDIO_RSP, //ÏûÏ¢µÚÒ»¸ö²ÎÊýָʾÉêÇë³É¹¦»¹ÊÇʧ°Ü£¬µÚ¶þ¸ö²ÎÊýָʾµ±Ç°Ê¹ÓõÄÒµÎñ
REL_AUDIO_REQ, //¹©Ö÷¿ØÇëÇóijҵÎñÄ£¿éÊÍ·ÅÕýÔÚ½øÐеÄAUDIOʹÓÃȨ
REL_AUDIO_IND, //ÇëÇóijҵÎñÄ£¿éÊÍ·ÅaudioµÄ½á¹ûÓ¦´ð£¬Èôʧ°Ü£¬¶ÏÑÔ£»»»ÑÔÖ®£¬±ØÐë³É¹¦
IDLE_AUDIO_INFO //Ö÷¿ØÍ¨ÖªËùÓÐÉêÇë¹ýAUDIO×ÊÔ´µÄÒµÎñÄ£¿é£¬¸æÖªµ±Ç°¿ÕÏУ¬ÒÔ½â¾öÒµÎñÄ£¿é´¦ÓÚ¹ÒÆð̬»ò֮ǰ±»Ç¿ÐÐÊͷŵÄÒµÎñÄ£¿é£¬ÈçMP3ÒôÀÖ²¥·ÅµÈ£»
};
typedef struct {
int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ
int moduleId; //ÉêÇëµÄÄ£¿éºÅ
int tempModuleId;
} T_audio_UseReq;
typedef struct {
int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü
int type; //ָʾÉêÇëµÄ¾ßÌåÒµÎñÀàÐÍ
int using_type; //ָʾµ±Ç°ÕýÔÚʹÓõÄÒµÎñÀàÐÍ£¬Ê§°Üʱ¹©¾ßÌåÒµÎñÄ£¿é²éѯʹÓÃ
} T_audio_UseRsp;
typedef struct {
int using_type; //ָʾµ±Ç°Äĸö¸ßÓÅÏȼ¶ÒµÎñÄ£¿éÔÚÉêÇë×ÊÔ´
int mouleId; //Ä£¿éµÄid
} T_audio_RelReq;
typedef struct {
int result; //ָʾÉêÇëµÄ½á¹û£¬0±íʾ³É¹¦£¬1±íʾʧ°Ü
int type; //ָʾÊÍ·Å¿ØÖÆÈ¨µÄÒµÎñ
int moduleId; //ÊÍ·Å¿ØÖÆÈ¨µÄÄ£¿éid
} T_audio_RelInd;
/* Ó¦ÓÃÇëÇócodec×ÊÔ´²ÎÊý */
typedef struct audioResRequest
{
int moduleId; /* ÒµÎñÄ£¿éºÅ */
int tempMouduleId; /* ÉêÇë×ÊÔ´µÄ½ÓÊÜÏûÏ¢ÁÙʱId */
int audioType; /* ÒµÎñÀàÐÍ */
}T_audio_Res_Request;
/**
*º¯Êý˵Ã÷£ºÇëÇóʹÓÃcodec×ÊÔ´£¬µÈ´ýcodecÖ÷¿Ø»Ø¸´
*@param : Ó¦ÓÃÇëÇóµÄ²ÎÊý
*
*/
BOOL audio_resource_request(struct audioResRequest *param, T_audio_UseRsp *RspData);
#endif