1 /* 2 * This file is auto-generated. Modifications will be lost. 3 * 4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ 5 * for more information. 6 */ 7 #ifndef __COMPRESS_OFFLOAD_H 8 #define __COMPRESS_OFFLOAD_H 9 #include <linux/types.h> 10 #include <sound/asound.h> 11 #include <sound/compress_params.h> 12 #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 2, 0) 13 struct snd_compressed_buffer { 14 __u32 fragment_size; 15 __u32 fragments; 16 } __attribute__((packed, aligned(4))); 17 struct snd_compr_params { 18 struct snd_compressed_buffer buffer; 19 struct snd_codec codec; 20 __u8 no_wake_mode; 21 } __attribute__((packed, aligned(4))); 22 struct snd_compr_tstamp { 23 __u32 byte_offset; 24 __u32 copied_total; 25 __u32 pcm_frames; 26 __u32 pcm_io_frames; 27 __u32 sampling_rate; 28 } __attribute__((packed, aligned(4))); 29 struct snd_compr_avail { 30 __u64 avail; 31 struct snd_compr_tstamp tstamp; 32 } __attribute__((packed, aligned(4))); 33 enum snd_compr_direction { 34 SND_COMPRESS_PLAYBACK = 0, 35 SND_COMPRESS_CAPTURE 36 }; 37 struct snd_compr_caps { 38 __u32 num_codecs; 39 __u32 direction; 40 __u32 min_fragment_size; 41 __u32 max_fragment_size; 42 __u32 min_fragments; 43 __u32 max_fragments; 44 __u32 codecs[MAX_NUM_CODECS]; 45 __u32 reserved[11]; 46 } __attribute__((packed, aligned(4))); 47 struct snd_compr_codec_caps { 48 __u32 codec; 49 __u32 num_descriptors; 50 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS]; 51 } __attribute__((packed, aligned(4))); 52 enum sndrv_compress_encoder { 53 SNDRV_COMPRESS_ENCODER_PADDING = 1, 54 SNDRV_COMPRESS_ENCODER_DELAY = 2, 55 }; 56 struct snd_compr_metadata { 57 __u32 key; 58 __u32 value[8]; 59 } __attribute__((packed, aligned(4))); 60 #define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int) 61 #define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps) 62 #define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11, struct snd_compr_codec_caps) 63 #define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params) 64 #define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec) 65 #define SNDRV_COMPRESS_SET_METADATA _IOW('C', 0x14, struct snd_compr_metadata) 66 #define SNDRV_COMPRESS_GET_METADATA _IOWR('C', 0x15, struct snd_compr_metadata) 67 #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp) 68 #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail) 69 #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30) 70 #define SNDRV_COMPRESS_RESUME _IO('C', 0x31) 71 #define SNDRV_COMPRESS_START _IO('C', 0x32) 72 #define SNDRV_COMPRESS_STOP _IO('C', 0x33) 73 #define SNDRV_COMPRESS_DRAIN _IO('C', 0x34) 74 #define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35) 75 #define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36) 76 #define SND_COMPR_TRIGGER_DRAIN 7 77 #define SND_COMPR_TRIGGER_NEXT_TRACK 8 78 #define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9 79 #endif 80