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 * 24 * NOTE, ANY CHANGES TO THIS FILE MAY AFFECT UNDERLYING AUDIO / SPEECH CODEC 25 * LIBRARY COMPONENT FROM CADENCE DESIGN SYSTEMS, INC. 26 * 27 ******************************************************************************/ 28 29 30 31 #ifndef __XA_VORBIS_DEC_API_H__ 32 #define __XA_VORBIS_DEC_API_H__ 33 34 #include <xa_memory_standards.h> 35 36 /* vorbis_dec-specific configuration parameters */ 37 enum xa_config_param_vorbis_dec 38 { 39 XA_VORBISDEC_CONFIG_PARAM_SAMP_FREQ = 0, 40 XA_VORBISDEC_CONFIG_PARAM_NUM_CHANNELS = 1, 41 XA_VORBISDEC_CONFIG_PARAM_PCM_WDSZ = 2, 42 XA_VORBISDEC_CONFIG_PARAM_COMMENT_MEM_PTR = 3, 43 XA_VORBISDEC_CONFIG_PARAM_COMMENT_MEM_SIZE = 4, 44 XA_VORBISDEC_CONFIG_PARAM_GET_CUR_BITRATE = 5, 45 XA_VORBISDEC_CONFIG_PARAM_RAW_VORBIS_FILE_MODE = 6, 46 XA_VORBISDEC_CONFIG_PARAM_RAW_VORBIS_LAST_PKT_GRANULE_POS = 7, 47 XA_VORBISDEC_CONFIG_PARAM_OGG_MAX_PAGE_SIZE = 8, 48 XA_VORBISDEC_CONFIG_PARAM_RUNTIME_MEM = 9 49 }; 50 51 /* commands */ 52 #include <xa_apicmd_standards.h> 53 54 /* vorbis_dec-specific command types */ 55 /* (none) */ 56 57 /* error codes */ 58 #include <xa_error_standards.h> 59 #define XA_CODEC_VORBIS_DEC 7 60 61 /* vorbis_dec-specific error codes */ 62 63 /*****************************************************************************/ 64 /* Class 1: Configuration Errors */ 65 /*****************************************************************************/ 66 /* Nonfatal Errors */ 67 enum xa_error_nonfatal_config_vorbis_dec 68 { 69 XA_VORBISDEC_CONFIG_NONFATAL_GROUPED_STREAM = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_VORBIS_DEC, 0), 70 XA_VORBISDEC_CONFIG_NONFATAL_BAD_PARAM = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_VORBIS_DEC, 1) 71 }; 72 73 /* Fatal Errors */ 74 enum xa_error_fatal_config_vorbis_dec 75 { 76 XA_VORBISDEC_CONFIG_FATAL_BADHDR = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 0), 77 XA_VORBISDEC_CONFIG_FATAL_NOTVORBIS = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 1), 78 XA_VORBISDEC_CONFIG_FATAL_BADINFO = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 2), 79 XA_VORBISDEC_CONFIG_FATAL_BADVERSION = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 3), 80 XA_VORBISDEC_CONFIG_FATAL_BADBOOKS = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 4), 81 XA_VORBISDEC_CONFIG_FATAL_CODEBOOK_DECODE = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 5), 82 XA_VORBISDEC_CONFIG_FATAL_INVALID_PARAM = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_VORBIS_DEC, 6) 83 }; 84 85 /*****************************************************************************/ 86 /* Class 2: Execution Errors */ 87 /*****************************************************************************/ 88 /* Nonfatal Errors */ 89 enum xa_error_nonfatal_execute_vorbis_dec 90 { 91 XA_VORBISDEC_EXECUTE_NONFATAL_OV_HOLE = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 0), 92 XA_VORBISDEC_EXECUTE_NONFATAL_OV_NOTAUDIO = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 1), 93 XA_VORBISDEC_EXECUTE_NONFATAL_OV_BADPACKET = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 2), 94 XA_VORBISDEC_EXECUTE_NONFATAL_OV_RUNTIME_DECODE_FLUSH_IN_PROGRESS = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 3), 95 XA_VORBISDEC_EXECUTE_NONFATAL_OV_INVALID_STRM_POS = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 4), 96 XA_VORBISDEC_EXECUTE_NONFATAL_OV_INSUFFICIENT_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 5), 97 XA_VORBISDEC_EXECUTE_NONFATAL_OV_UNEXPECTED_IDENT_PKT_RECEIVED = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 6), 98 XA_VORBISDEC_EXECUTE_NONFATAL_OV_UNEXPECTED_HEADER_PKT_RECEIVED = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 7) 99 }; 100 /* Fatal Errors */ 101 enum xa_error_fatal_execute_vorbis_dec 102 { 103 XA_VORBISDEC_EXECUTE_FATAL_PERSIST_ALLOC = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 0), 104 XA_VORBISDEC_EXECUTE_FATAL_SCRATCH_ALLOC = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 1), 105 XA_VORBISDEC_EXECUTE_FATAL_CORRUPT_STREAM = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 2), 106 XA_VORBISDEC_EXECUTE_FATAL_INSUFFICIENT_INP_BUF_SIZE = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_VORBIS_DEC, 3) 107 }; 108 109 #include "xa_type_def.h" 110 111 #ifdef __cplusplus 112 extern "C" { 113 #endif /* __cplusplus */ 114 115 xa_codec_func_t xa_vorbis_dec; 116 117 #ifdef __cplusplus 118 } 119 #endif /* __cplusplus */ 120 121 #endif /* __XA_VORBIS_DEC_API_H__ */ 122