| 1 | /** |
| 2 | * @file constants.h |
| 3 | * @brief PCM Task node protocol constants definition |
| 4 | * <p> |
| 5 | * Copyright (C) 2006 Nokia Corporation |
| 6 | * <p> |
| 7 | * Contact: Eduardo Bezerra Valentin <[email protected]> |
| 8 | * |
| 9 | * This library is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU Library General Public |
| 11 | * License as published by the Free Software Foundation; either |
| 12 | * version 2 of the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This library is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | * Library General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU Library General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 22 | * */ |
| 23 | #ifndef _CONSTANTS_H |
| 24 | #define _CONSTANTS_H |
| 25 | /** |
| 26 | * Commands |
| 27 | * */ |
| 28 | /** No command */ |
| 29 | #define DSP_CMD_NONE 0x00 |
| 30 | /** Informs the DSP that the following data is about initialisation. */ |
| 31 | #define DSP_CMD_INIT 0x01 |
| 32 | /** Informs the DSP that the following data is parameters */ |
| 33 | #define DSP_CMD_SET_PARAMS 0x02 |
| 34 | /** Informs the DSP that the following data is general data (compressed |
| 35 | * or raw audio or video) |
| 36 | * */ |
| 37 | #define DSP_CMD_DATA_WRITE 0x03 |
| 38 | /** Starts audio or video playback or recording */ |
| 39 | #define DSP_CMD_PLAY 0x04 |
| 40 | /** Pauses playback */ |
| 41 | #define DSP_CMD_PAUSE 0x05 |
| 42 | /** Stops playback */ |
| 43 | #define DSP_CMD_STOP 0x06 |
| 44 | /** Informs the DSP that the following data is volume */ |
| 45 | #define DSP_CMD_SET_VOLUME 0x07 |
| 46 | /** Requests from the DSP to send information about current task node |
| 47 | * state |
| 48 | * */ |
| 49 | #define DSP_CMD_STATE 0x08 |
| 50 | /** Informs the DSP that the following data is about setting the current |
| 51 | * presentation time |
| 52 | * */ |
| 53 | #define DSP_CMD_SET_TIME 0x09 |
| 54 | /** Informs the DSP that the ARM queries the current presentation time */ |
| 55 | #define DSP_CMD_GET_TIME 0x0A |
| 56 | /** Informs the DSP that the following data is about setting video |
| 57 | * post-processing parameters |
| 58 | * */ |
| 59 | #define DSP_CMD_SET_POSTPROC 0x0B |
| 60 | /** Informs the DSP that the following data is about setting the panning |
| 61 | * */ |
| 62 | #define DSP_CMD_SET_PANNING 0x0D |
| 63 | /** Informs the DSP about discontinuity in the audio stream */ |
| 64 | #define DSP_CMD_DISCONT 0x0E |
| 65 | /** Mutes the audio playback */ |
| 66 | #define DSP_CMD_MUTE 0x0F |
| 67 | /** Unmutes the audio playback */ |
| 68 | #define DSP_CMD_UNMUTE 0x10 |
| 69 | /**Closes the task node*/ |
| 70 | #define DSP_CMD_CLOSE 0x14 |
| 71 | /** Command from DSP to start to read data*/ |
| 72 | #define DSP_CMD_DATA_READ 0x25 |
| 73 | /**Sets speech parameters*/ |
| 74 | #define DSP_CMD_SET_SPEECH_PARAMS 0x26 |
| 75 | |
| 76 | /** |
| 77 | * Audio formats |
| 78 | * */ |
| 79 | /** Unsigned 8 bits per sample PCM */ |
| 80 | #define DSP_AFMT_U8 0x01 |
| 81 | /** Signed 16 bits per sample PCM, little endian */ |
| 82 | #define DSP_AFMT_S16_LE 0x02 |
| 83 | /** Signed 16 bits per sample PCM, big endian */ |
| 84 | #define DSP_AFMT_S16_BE 0x03 |
| 85 | /** Signed 8 bits per sample PCM */ |
| 86 | #define DSP_AFMT_S8 0x04 |
| 87 | /** Unsigned 16 bits per sample PCM, little endian */ |
| 88 | #define DSP_AFMT_U16_LE 0x05 |
| 89 | /** Unsigned 16 bits per sample PCM, big endian */ |
| 90 | #define DSP_AFMT_U16_BE 0x06 |
| 91 | /** A-law encoded PCM */ |
| 92 | #define DSP_AFMT_ALAW 0x07 |
| 93 | /** μ-Law encoded PCM */ |
| 94 | #define DSP_AFMT_ULAW 0x08 |
| 95 | /** MP3 stream */ |
| 96 | #define DSP_AFMT_MP3 0x09 |
| 97 | /** AAC stream */ |
| 98 | #define DSP_AFMT_AAC 0x0A |
| 99 | /** AMR stream */ |
| 100 | #define DSP_AFMT_AMR 0x0B |
| 101 | /** MP2 stream */ |
| 102 | #define DSP_AFMT_MP2 0x0C |
| 103 | /** iLBC stream */ |
| 104 | #define DSP_AFMT_ILBC 0x0D |
| 105 | /** G.729 stream */ |
| 106 | #define DSP_AFMT_G729 0x0E |
| 107 | /** |
| 108 | * Supported Sample rates |
| 109 | * */ |
| 110 | /** 96KHz sampling rate */ |
| 111 | #define SAMPLE_RATE_96KHZ 0x00 |
| 112 | /** 88.2KHz sampling rate */ |
| 113 | #define SAMPLE_RATE_88_2KHZ 0x01 |
| 114 | /** 64KHz sampling rate */ |
| 115 | #define SAMPLE_RATE_64KHZ 0x02 |
| 116 | /** 48KHz sampling rate */ |
| 117 | #define SAMPLE_RATE_48KHZ 0x03 |
| 118 | /** 44.1KHz sampling rate */ |
| 119 | #define SAMPLE_RATE_44_1KHZ 0x04 |
| 120 | /** 32KHz sampling rate */ |
| 121 | #define SAMPLE_RATE_32KHZ 0x05 |
| 122 | /** 24KHz sampling rate */ |
| 123 | #define SAMPLE_RATE_24KHZ 0x06 |
| 124 | /** 22.05KHz sampling rate */ |
| 125 | #define SAMPLE_RATE_22_05KHZ 0x07 |
| 126 | /** 16KHz sampling rate */ |
| 127 | #define SAMPLE_RATE_16KHZ 0x08 |
| 128 | /** 12KHz sampling rate */ |
| 129 | #define SAMPLE_RATE_12KHZ 0x09 |
| 130 | /** 11.025KHz sampling rate */ |
| 131 | #define SAMPLE_RATE_11_025KHZ 0x0A |
| 132 | /** 8KHz sampling rate */ |
| 133 | #define SAMPLE_RATE_8KHZ 0x0B |
| 134 | /** 5.5125Khz sampling rate */ |
| 135 | #define SAMPLE_RATE_5_5125KHZ 0X0C |
| 136 | /** |
| 137 | * DSP Return values |
| 138 | * */ |
| 139 | /** Operation successful */ |
| 140 | #define DSP_OK 0x01 |
| 141 | /** Unrecognised or unsupported command value */ |
| 142 | #define DSP_ERROR_CMD 0x02 |
| 143 | /** Unrecognised or unsupported audio format value */ |
| 144 | #define DSP_ERROR_FMT 0x03 |
| 145 | /** Unrecognised or unsupported sampling rate value */ |
| 146 | #define DSP_ERROR_RATE 0x04 |
| 147 | /** Unrecognised or unsupported number of channels */ |
| 148 | #define DSP_ERROR_CHANNELS 0x05 |
| 149 | /** Destination/source stream ID out of range */ |
| 150 | #define DSP_ERROR_DS_ID 0x06 |
| 151 | /** Insufficient memory to perform requested action */ |
| 152 | #define DSP_ERROR_MEMORY 0x07 |
| 153 | /** Unspecified error */ |
| 154 | #define DSP_ERROR_GENERAL 0x08 |
| 155 | /** Error in stream (audio or video) */ |
| 156 | #define DSP_ERROR_STREAM 0x09 |
| 157 | /** Unexpected task node state */ |
| 158 | #define DSP_ERROR_STATE 0x0A |
| 159 | /** Error in synchronisation: |
| 160 | For MP3 – synchronisation marker not found */ |
| 161 | #define DSP_ERROR_SYNC 0x0B |
| 162 | /** For MPEG4: non-compliant video stream */ |
| 163 | #define DSP_ERROR_VIDEO_NON_COMPLIANT 0x100 |
| 164 | /** For MPEG4: Error in VOS */ |
| 165 | #define DSP_ERROR_VIDEO_FAULT_IN_VOS 0x101 |
| 166 | /** For MPEG4: Image size not supported */ |
| 167 | #define DSP_ERROR_VIDEO_SIZE_NOT_SUPPORTED 0x102 |
| 168 | /** End of VOS code reached */ |
| 169 | #define DSP_ERROR_VIDEO_VOS_END_CODE 0x103 |
| 170 | /** |
| 171 | * Channels |
| 172 | * */ |
| 173 | /** One channel (mono) */ |
| 174 | #define CHANNELS_1 0x01 |
| 175 | /** Two channels (stereo) */ |
| 176 | #define CHANNELS_2 0x02 |
| 177 | /** |
| 178 | * Audio Task node states |
| 179 | * */ |
| 180 | /** Initialised */ |
| 181 | #define STATE_INITIALISED 0x00 |
| 182 | /** Playing/recording */ |
| 183 | #define STATE_PLAYING 0x01 |
| 184 | /** Stopped */ |
| 185 | #define STATE_STOPPED 0x02 |
| 186 | /** Paused */ |
| 187 | #define STATE_PAUSED 0x03 |
| 188 | /** Not initialised */ |
| 189 | #define STATE_UNINITIALISED 0x04 |
| 190 | /** Reseted */ |
| 191 | #define STATE_RESET 0x05 |
| 192 | /** Muted */ |
| 193 | #define STATE_MUTED 0x06 |
| 194 | |
| 195 | /** Sending commands */ |
| 196 | #define REQUEST_CONFIRMATION 0x01 |
| 197 | #define WITHOU_CONFIRMATION 0x00 |
| 198 | #endif /* _CONSTANTS_H */ |