^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) AND MIT) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * compress_params.h - codec types and parameters for compressed data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * streaming interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2011 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Vinod Koul <vinod.koul@linux.intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * This program is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * it under the terms of the GNU General Public License as published by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * the Free Software Foundation; version 2 of the License.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * This program is distributed in the hope that it will be useful, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * You should have received a copy of the GNU General Public License along
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * with this program; if not, write to the Free Software Foundation, Inc.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * The definitions in this file are derived from the OpenMAX AL version 1.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * Copyright (c) 2007-2010 The Khronos Group Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * Permission is hereby granted, free of charge, to any person obtaining
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * a copy of this software and/or associated documentation files (the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * "Materials "), to deal in the Materials without restriction, including
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * without limitation the rights to use, copy, modify, merge, publish,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * distribute, sublicense, and/or sell copies of the Materials, and to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * permit persons to whom the Materials are furnished to do so, subject to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * the following conditions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * The above copyright notice and this permission notice shall be included
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * in all copies or substantial portions of the Materials.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #ifndef __SND_COMPRESS_PARAMS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #define __SND_COMPRESS_PARAMS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) /* AUDIO CODECS SUPPORTED */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define MAX_NUM_CODECS 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define MAX_NUM_CODEC_DESCRIPTORS 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define MAX_NUM_BITRATES 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define MAX_NUM_SAMPLE_RATES 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /* Codecs are listed linearly to allow for extensibility */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) #define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) #define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) #define SND_AUDIOCODEC_BESPOKE ((__u32) 0x0000000E)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #define SND_AUDIOCODEC_ALAC ((__u32) 0x0000000F)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #define SND_AUDIOCODEC_APE ((__u32) 0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_APE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) * Profile and modes are listed with bit masks. This allows for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) * more compact representation of fields that will not evolve
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) * (in contrast to the list of codecs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) /* MP3 modes are only useful for encoders */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) #define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) #define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) #define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) #define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) #define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) /* AMR modes are only useful for encoders */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) #define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) #define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) #define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) /* AMRWB modes are only useful for encoders */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) #define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) /* AAC modes are required for encoders and decoders */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) #define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) #define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) #define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) #define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) #define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) #define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) /* AAC formats are required for encoders and decoders */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) #define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) #define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) #define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) #define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) #define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) #define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) #define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) #define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) #define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) #define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) #define SND_AUDIOPROFILE_WMA9_PRO ((__u32) 0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) #define SND_AUDIOPROFILE_WMA9_LOSSLESS ((__u32) 0x00000020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #define SND_AUDIOPROFILE_WMA10_LOSSLESS ((__u32) 0x00000040)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) #define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) #define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) #define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) #define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) #define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) #define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) * Some implementations strip the ASF header and only send ASF packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * to the DSP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) #define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) #define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) #define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) #define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) #define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) #define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) #define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) #define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) #define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) * Define quality levels for FLAC encoders, from LEVEL0 (fast)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) * to LEVEL8 (best)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) #define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) #define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) #define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) #define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) #define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) #define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) #define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) #define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) /* IEC61937 payloads without CUVP and preambles */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) #define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) /* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) #define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) * IEC modes are mandatory for decoders. Format autodetection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) * will only happen on the DSP side with mode 0. The PCM mode should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) * not be used, the PCM codec should be used instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) #define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) #define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) #define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) #define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) #define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) #define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) #define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) #define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) #define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) #define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) #define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) #define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) #define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) #define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) #define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) #define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) #define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) #define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) #define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) #define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) #define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) #define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) /* <FIXME: multichannel encoders aren't supported for now. Would need
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) an additional definition of channel arrangement> */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) /* VBR/CBR definitions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) #define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) #define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) /* Encoder options */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) struct snd_enc_wma {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) __u32 super_block_align; /* WMA Type-specific data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) * struct snd_enc_vorbis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) * In the default mode of operation, the quality level is 3.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) * Normal quality range is 0 - 10.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) * @managed: Boolean. Set bitrate management mode. This turns off the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) * normal VBR encoding, but allows hard or soft bitrate constraints to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) * enforced by the encoder. This mode can be slower, and may also be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) * lower quality. It is primarily useful for streaming.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) * @max_bit_rate: Enabled only if managed is TRUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) * @min_bit_rate: Enabled only if managed is TRUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) * @downmix: Boolean. Downmix input from stereo to mono (has no effect on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) * non-stereo streams). Useful for lower-bitrate encoding.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) * These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) * properties
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) * For best quality users should specify VBR mode and set quality levels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) struct snd_enc_vorbis {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) __s32 quality;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) __u32 managed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) __u32 max_bit_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) __u32 min_bit_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) __u32 downmix;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) * struct snd_enc_real
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) * @quant_bits: number of coupling quantization bits in the stream
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) * @start_region: coupling start region in the stream
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) * @num_regions: number of regions value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) * These options were extracted from the OpenMAX IL spec
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) struct snd_enc_real {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) __u32 quant_bits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) __u32 start_region;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) __u32 num_regions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) * struct snd_enc_flac
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) * @num: serial number, valid only for OGG formats
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) * needs to be set by application
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) * @gain: Add replay gain tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) * These options were extracted from the FLAC online documentation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) * at http://flac.sourceforge.net/documentation_tools_flac.html
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) * To make the API simpler, it is assumed that the user will select quality
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) * profiles. Additional options that affect encoding quality and speed can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) * be added at a later stage if needed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) * By default the Subset format is used by encoders.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) * TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) * not supported in this API.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) struct snd_enc_flac {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) __u32 num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) __u32 gain;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) struct snd_enc_generic {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) __u32 bw; /* encoder bandwidth */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) __s32 reserved[15]; /* Can be used for SND_AUDIOCODEC_BESPOKE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) struct snd_dec_flac {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) __u16 sample_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) __u16 min_blk_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) __u16 max_blk_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) __u16 min_frame_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) __u16 max_frame_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) __u16 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) struct snd_dec_wma {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) __u32 encoder_option;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) __u32 adv_encoder_option;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) __u32 adv_encoder_option2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) __u32 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) struct snd_dec_alac {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) __u32 frame_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) __u8 compatible_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) __u8 pb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) __u8 mb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) __u8 kb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) __u32 max_run;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) __u32 max_frame_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) struct snd_dec_ape {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) __u16 compatible_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) __u16 compression_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) __u32 format_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) __u32 blocks_per_frame;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) __u32 final_frame_blocks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) __u32 total_frames;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) __u32 seek_table_present;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) union snd_codec_options {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) struct snd_enc_wma wma;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) struct snd_enc_vorbis vorbis;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) struct snd_enc_real real;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) struct snd_enc_flac flac;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) struct snd_enc_generic generic;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) struct snd_dec_flac flac_d;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) struct snd_dec_wma wma_d;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) struct snd_dec_alac alac_d;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) struct snd_dec_ape ape_d;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) /** struct snd_codec_desc - description of codec capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) * @max_ch: Maximum number of audio channels
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) * @sample_rates: Sampling rates in Hz, use values like 48000 for this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) * @num_sample_rates: Number of valid values in sample_rates array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) * @bit_rate: Indexed array containing supported bit rates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) * @num_bitrates: Number of valid values in bit_rate array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) * @rate_control: value is specified by SND_RATECONTROLMODE defines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) * @profiles: Supported profiles. See SND_AUDIOPROFILE defines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) * @modes: Supported modes. See SND_AUDIOMODE defines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) * @min_buffer: Minimum buffer size handled by codec implementation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) * @reserved: reserved for future use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) * This structure provides a scalar value for profiles, modes and stream
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) * format fields.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) * If an implementation supports multiple combinations, they will be listed as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) * codecs with different descriptors, for example there would be 2 descriptors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) * for AAC-RAW and AAC-ADTS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) * This entails some redundancy but makes it easier to avoid invalid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) * configurations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) struct snd_codec_desc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) __u32 max_ch;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) __u32 sample_rates[MAX_NUM_SAMPLE_RATES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) __u32 num_sample_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) __u32 bit_rate[MAX_NUM_BITRATES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) __u32 num_bitrates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) __u32 rate_control;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) __u32 profiles;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) __u32 modes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) __u32 formats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) __u32 min_buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) __u32 reserved[15];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) /** struct snd_codec
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) * @id: Identifies the supported audio encoder/decoder.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) * See SND_AUDIOCODEC macros.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) * @ch_in: Number of input audio channels
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) * @ch_out: Number of output channels. In case of contradiction between
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) * this field and the channelMode field, the channelMode field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) * overrides.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) * @sample_rate: Audio sample rate of input data in Hz, use values like 48000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) * for this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) * @bit_rate: Bitrate of encoded data. May be ignored by decoders
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) * Encoders may rely on profiles for quality levels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) * May be ignored by decoders.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) * @profile: Mandatory for encoders, can be mandatory for specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) * decoders as well. See SND_AUDIOPROFILE defines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) * @level: Supported level (Only used by WMA at the moment)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) * @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) * @format: Format of encoded bistream. Mandatory when defined.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) * See SND_AUDIOSTREAMFORMAT defines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) * @align: Block alignment in bytes of an audio sample.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) * Only required for PCM or IEC formats.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) * @options: encoder-specific settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) * @reserved: reserved for future use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) struct snd_codec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) __u32 id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) __u32 ch_in;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) __u32 ch_out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) __u32 sample_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) __u32 bit_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) __u32 rate_control;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) __u32 profile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) __u32 level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) __u32 ch_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) __u32 format;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) __u32 align;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) union snd_codec_options options;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) __u32 reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) #endif