ALSA: compress: add alac & ape decoder params
authorVinod Koul <vkoul@kernel.org>
Mon, 16 Mar 2020 05:52:18 +0000 (11:22 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 16 Mar 2020 17:52:09 +0000 (17:52 +0000)
Add ALAC (Apple Lossless Audio Codec) and APE (Monkey's Lossless Audio
Codec) defines and parameters required to configure these.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-7-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
include/uapi/sound/compress_params.h

index bf6f7155e775e75cd40107da6d6317603c2bc1e7..79b14389ae4112fa39f115372fc7901b4427bf4b 100644 (file)
@@ -75,7 +75,9 @@
 #define SND_AUDIOCODEC_G723_1                ((__u32) 0x0000000C)
 #define SND_AUDIOCODEC_G729                  ((__u32) 0x0000000D)
 #define SND_AUDIOCODEC_BESPOKE               ((__u32) 0x0000000E)
-#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_BESPOKE
+#define SND_AUDIOCODEC_ALAC                  ((__u32) 0x0000000F)
+#define SND_AUDIOCODEC_APE                   ((__u32) 0x00000010)
+#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_APE
 
 /*
  * Profile and modes are listed with bit masks. This allows for a
@@ -336,6 +338,26 @@ struct snd_dec_wma {
        __u32 reserved;
 } __attribute__((packed, aligned(4)));
 
+struct snd_dec_alac {
+       __u32 frame_length;
+       __u8 compatible_version;
+       __u8 pb;
+       __u8 mb;
+       __u8 kb;
+       __u32 max_run;
+       __u32 max_frame_bytes;
+} __attribute__((packed, aligned(4)));
+
+struct snd_dec_ape {
+       __u16 compatible_version;
+       __u16 compression_level;
+       __u32 format_flags;
+       __u32 blocks_per_frame;
+       __u32 final_frame_blocks;
+       __u32 total_frames;
+       __u32 seek_table_present;
+} __attribute__((packed, aligned(4)));
+
 union snd_codec_options {
        struct snd_enc_wma wma;
        struct snd_enc_vorbis vorbis;
@@ -344,6 +366,8 @@ union snd_codec_options {
        struct snd_enc_generic generic;
        struct snd_dec_flac flac_d;
        struct snd_dec_wma wma_d;
+       struct snd_dec_alac alac_d;
+       struct snd_dec_ape ape_d;
 } __attribute__((packed, aligned(4)));
 
 /** struct snd_codec_desc - description of codec capabilities