Skip to content

Commit d252233

Browse files
vinodkoulbroonie
authored andcommitted
ALSA: compress: add flac decoder params
The current design of sending codec parameters assumes that decoders will have parsers so they can parse the encoded stream for parameters and configure the decoder. But this assumption may not be universally true and we know some DSPs which do not contain the parsers so additional parameters are required to be passed. So add these parameters starting with FLAC decoder. The size of snd_codec_options is still 120 bytes after this change (due to this being a union) Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20191115102705.649976-2-vkoul@kernel.org Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent a3b9ed5 commit d252233

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎include/uapi/sound/compress_params.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,22 @@ struct snd_enc_generic {
317317
__s32 reserved[15]; /* Can be used for SND_AUDIOCODEC_BESPOKE */
318318
} __attribute__((packed, aligned(4)));
319319

320+
struct snd_dec_flac {
321+
__u16 sample_size;
322+
__u16 min_blk_size;
323+
__u16 max_blk_size;
324+
__u16 min_frame_size;
325+
__u16 max_frame_size;
326+
__u16 reserved;
327+
} __attribute__((packed, aligned(4)));
328+
320329
union snd_codec_options {
321330
struct snd_enc_wma wma;
322331
struct snd_enc_vorbis vorbis;
323332
struct snd_enc_real real;
324333
struct snd_enc_flac flac;
325334
struct snd_enc_generic generic;
335+
struct snd_dec_flac flac_d;
326336
} __attribute__((packed, aligned(4)));
327337

328338
/** struct snd_codec_desc - description of codec capabilities

0 commit comments

Comments
 (0)