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, 1, 2) 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 __u64 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 struct snd_compr_audio_info { 53 __u32 frame_size; 54 __u32 reserved[15]; 55 } __attribute__((packed, aligned(4))); 56 #define SND_COMPR_AUDIO_INFO 57 #define SNDRV_COMPRESS_RENDER_MODE_AUDIO_MASTER 0 58 #define SNDRV_COMPRESS_RENDER_MODE_STC_MASTER 1 59 #define SNDRV_COMPRESS_RENDER_MODE_TTP 2 60 #define SNDRV_COMPRESS_RENDER_MODE_TTP_PASS_THROUGH 3 61 #define SNDRV_COMPRESS_RENDER_MODE_ABSOLUTETIME 4 62 #define SNDRV_COMPRESS_CLK_REC_MODE_NONE 0 63 #define SNDRV_COMPRESS_CLK_REC_MODE_AUTO 1 64 enum sndrv_compress_latency_mode { 65 SNDRV_COMPRESS_LEGACY_LATENCY_MODE = 0, 66 SNDRV_COMPRESS_LOW_LATENCY_MODE = 1, 67 }; 68 enum sndrv_compress_encoder { 69 SNDRV_COMPRESS_ENCODER_PADDING = 1, 70 SNDRV_COMPRESS_ENCODER_DELAY = 2, 71 SNDRV_COMPRESS_MIN_BLK_SIZE = 3, 72 SNDRV_COMPRESS_MAX_BLK_SIZE = 4, 73 SNDRV_COMPRESS_PATH_DELAY = 5, 74 SNDRV_COMPRESS_RENDER_MODE = 6, 75 SNDRV_COMPRESS_CLK_REC_MODE = 7, 76 SNDRV_COMPRESS_RENDER_WINDOW = 8, 77 SNDRV_COMPRESS_START_DELAY = 9, 78 SNDRV_COMPRESS_ENABLE_ADJUST_SESSION_CLOCK = 10, 79 SNDRV_COMPRESS_ADJUST_SESSION_CLOCK = 11, 80 SNDRV_COMPRESS_LATENCY_MODE = 12, 81 SNDRV_COMPRESS_IN_TTP_OFFSET = 13, 82 SNDRV_COMPRESS_OUT_EXTERNAL_SINK_LATENCY = 14, 83 }; 84 #define SNDRV_COMPRESS_MIN_BLK_SIZE SNDRV_COMPRESS_MIN_BLK_SIZE 85 #define SNDRV_COMPRESS_MAX_BLK_SIZE SNDRV_COMPRESS_MAX_BLK_SIZE 86 #define SNDRV_COMPRESS_PATH_DELAY SNDRV_COMPRESS_PATH_DELAY 87 #define SNDRV_COMPRESS_RENDER_MODE SNDRV_COMPRESS_RENDER_MODE 88 #define SNDRV_COMPRESS_CLK_REC_MODE SNDRV_COMPRESS_CLK_REC_MODE 89 #define SNDRV_COMPRESS_RENDER_WINDOW SNDRV_COMPRESS_RENDER_WINDOW 90 #define SNDRV_COMPRESS_START_DELAY SNDRV_COMPRESS_START_DELAY 91 #define SNDRV_COMPRESS_ENABLE_ADJUST_SESSION_CLOCK SNDRV_COMPRESS_ENABLE_ADJUST_SESSION_CLOCK 92 #define SNDRV_COMPRESS_ADJUST_SESSION_CLOCK SNDRV_COMPRESS_ADJUST_SESSION_CLOCK 93 #define SNDRV_COMPRESS_LATENCY_MODE SNDRV_COMPRESS_LATENCY_MODE 94 #define SNDRV_COMPRESS_IN_TTP_OFFSET SNDRV_COMPRESS_IN_TTP_OFFSET 95 #define SNDRV_COMPRESS_OUT_EXTERNAL_SINK_LATENCY SNDRV_COMPRESS_OUT_EXTERNAL_SINK_LATENCY 96 struct snd_compr_metadata { 97 __u32 key; 98 __u32 value[8]; 99 } __attribute__((packed, aligned(4))); 100 #define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int) 101 #define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps) 102 #define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11, struct snd_compr_codec_caps) 103 #define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params) 104 #define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec) 105 #define SNDRV_COMPRESS_SET_METADATA _IOW('C', 0x14, struct snd_compr_metadata) 106 #define SNDRV_COMPRESS_GET_METADATA _IOWR('C', 0x15, struct snd_compr_metadata) 107 #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp) 108 #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail) 109 #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30) 110 #define SNDRV_COMPRESS_RESUME _IO('C', 0x31) 111 #define SNDRV_COMPRESS_START _IO('C', 0x32) 112 #define SNDRV_COMPRESS_STOP _IO('C', 0x33) 113 #define SNDRV_COMPRESS_DRAIN _IO('C', 0x34) 114 #define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35) 115 #define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36) 116 #define SNDRV_COMPRESS_SET_NEXT_TRACK_PARAM _IOW('C', 0x80, union snd_codec_options) 117 #define SND_COMPR_TRIGGER_DRAIN 7 118 #define SND_COMPR_TRIGGER_NEXT_TRACK 8 119 #define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9 120 #define SNDRV_COMPRESS_DSP_POSITION 10 121 #endif 122