Niranjan Yadla | cee816e | 2018-04-19 12:03:47 -0700 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (C) 2018 Cadence Design Systems, Inc. |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining |
| 5 | * a copy of this software and associated documentation files (the |
| 6 | * "Software"), to use this Software with Cadence processor cores only and |
| 7 | * not with any other processors and platforms, subject to |
| 8 | * the following conditions: |
| 9 | * |
| 10 | * The above copyright notice and this permission notice shall be included |
| 11 | * in all copies or substantial portions of the Software. |
| 12 | * |
| 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 14 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 15 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 16 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 17 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 18 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 20 | |
| 21 | ******************************************************************************/ |
| 22 | |
| 23 | #ifndef __XA_PCM_API_H__ |
| 24 | #define __XA_PCM_API_H__ |
| 25 | |
| 26 | /******************************************************************************* |
| 27 | * Includes |
| 28 | ******************************************************************************/ |
| 29 | |
| 30 | #include "xa_type_def.h" |
| 31 | #include "xa_error_standards.h" |
| 32 | #include "xa_apicmd_standards.h" |
| 33 | #include "xa_memory_standards.h" |
| 34 | |
| 35 | /******************************************************************************* |
| 36 | * Constants definitions |
| 37 | ******************************************************************************/ |
| 38 | |
| 39 | /* ...codec-specific configuration parameters */ |
| 40 | enum xa_config_param_pcm { |
| 41 | XA_PCM_CONFIG_PARAM_SAMPLE_RATE = 0, |
| 42 | XA_PCM_CONFIG_PARAM_IN_PCM_WIDTH = 1, |
| 43 | XA_PCM_CONFIG_PARAM_IN_CHANNELS = 2, |
| 44 | XA_PCM_CONFIG_PARAM_OUT_PCM_WIDTH = 3, |
| 45 | XA_PCM_CONFIG_PARAM_OUT_CHANNELS = 4, |
| 46 | XA_PCM_CONFIG_PARAM_CHANROUTING = 5, |
| 47 | XA_PCM_CONFIG_PARAM_NUM = 6, |
| 48 | }; |
| 49 | |
| 50 | /* ...component identifier (informative) */ |
| 51 | #define XA_CODEC_PCM 16 |
| 52 | |
| 53 | /******************************************************************************* |
| 54 | * Class 0: API Errors |
| 55 | ******************************************************************************/ |
| 56 | |
| 57 | #define XA_PCM_API_NONFATAL(e) \ |
| 58 | XA_ERROR_CODE(xa_severity_nonfatal, xa_class_api, XA_CODEC_PCM, (e)) |
| 59 | |
| 60 | #define XA_PCM_API_FATAL(e) \ |
| 61 | XA_ERROR_CODE(xa_severity_fatal, xa_class_api, XA_CODEC_PCM, (e)) |
| 62 | |
| 63 | enum xa_error_nonfatal_api_pcm { |
| 64 | XA_PCM_API_NONFATAL_MAX = XA_PCM_API_NONFATAL(0) |
| 65 | }; |
| 66 | |
| 67 | enum xa_error_fatal_api_pcm { |
| 68 | XA_PCM_API_FATAL_MAX = XA_PCM_API_FATAL(0) |
| 69 | }; |
| 70 | |
| 71 | /******************************************************************************* |
| 72 | * Class 1: Configuration Errors |
| 73 | ******************************************************************************/ |
| 74 | |
| 75 | #define XA_PCM_CONFIG_NONFATAL(e) \ |
| 76 | XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_PCM, (e)) |
| 77 | |
| 78 | #define XA_PCM_CONFIG_FATAL(e) \ |
| 79 | XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_PCM, (e)) |
| 80 | |
| 81 | enum xa_error_nonfatal_config_pcm { |
| 82 | XA_PCM_CONFIG_NONFATAL_RANGE = XA_PCM_CONFIG_NONFATAL(0), |
| 83 | XA_PCM_CONFIG_NONFATAL_STATE = XA_PCM_CONFIG_NONFATAL(1), |
| 84 | XA_PCM_CONFIG_NONFATAL_MAX = XA_PCM_CONFIG_NONFATAL(2) |
| 85 | }; |
| 86 | |
| 87 | enum xa_error_fatal_config_pcm { |
| 88 | XA_PCM_CONFIG_FATAL_RANGE = XA_PCM_CONFIG_FATAL(0), |
| 89 | XA_PCM_CONFIG_FATAL_MAX = XA_PCM_CONFIG_FATAL(1) |
| 90 | }; |
| 91 | |
| 92 | /******************************************************************************* |
| 93 | * Class 2: Execution Class Errors |
| 94 | ******************************************************************************/ |
| 95 | |
| 96 | #define XA_PCM_EXEC_NONFATAL(e) \ |
| 97 | XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_PCM, (e)) |
| 98 | |
| 99 | #define XA_PCM_EXEC_FATAL(e) \ |
| 100 | XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_PCM, (e)) |
| 101 | |
| 102 | enum xa_error_nonfatal_execute_pcm { |
| 103 | XA_PCM_EXEC_NONFATAL_STATE = XA_PCM_EXEC_NONFATAL(0), |
| 104 | XA_PCM_EXEC_NONFATAL_NO_DATA = XA_PCM_EXEC_NONFATAL(1), |
| 105 | XA_PCM_EXEC_NONFATAL_INPUT = XA_PCM_EXEC_NONFATAL(2), |
| 106 | XA_PCM_EXEC_NONFATAL_OUTPUT = XA_PCM_EXEC_NONFATAL(3), |
| 107 | XA_PCM_EXEC_NONFATAL_MAX = XA_PCM_EXEC_NONFATAL(4) |
| 108 | }; |
| 109 | |
| 110 | enum xa_error_fatal_execute_pcm { |
| 111 | XA_PCM_EXEC_FATAL_STATE = XA_PCM_EXEC_FATAL(0), |
| 112 | XA_PCM_EXEC_FATAL_INPUT = XA_PCM_EXEC_FATAL(1), |
| 113 | XA_PCM_EXEC_FATAL_OUTPUT = XA_PCM_EXEC_FATAL(2), |
| 114 | XA_PCM_EXEC_FATAL_MAX = XA_PCM_EXEC_FATAL(3) |
| 115 | }; |
| 116 | |
| 117 | /******************************************************************************* |
| 118 | * API function definition |
| 119 | ******************************************************************************/ |
| 120 | |
| 121 | #if defined(USE_DLL) && defined(_WIN32) |
| 122 | #define DLL_SHARED __declspec(dllimport) |
| 123 | #elif defined (_WINDLL) |
| 124 | #define DLL_SHARED __declspec(dllexport) |
| 125 | #else |
| 126 | #define DLL_SHARED |
| 127 | #endif |
| 128 | |
| 129 | #if defined(__cplusplus) |
| 130 | extern "C" { |
| 131 | #endif /* __cplusplus */ |
| 132 | DLL_SHARED xa_codec_func_t xa_pcm_codec; |
| 133 | #if defined(__cplusplus) |
| 134 | } |
| 135 | #endif /* __cplusplus */ |
| 136 | |
| 137 | #endif /* __XA_PCM_API_H__ */ |
| 138 | |