History

ALSA: compress_offload: Add SNDRV_COMPRESS_AVAIL64 ioctl

The previous patch introduced a 64-bit timestamp ioctl (SNDRV_COMPRESS_TSTAMP64). To provide a consistent API, this patch adds a corresponding 64-bit version of the SNDRV_COMPRESS_AVAIL ioctl. A new struct snd_compr_avail64 is added to the UAPI, which includes the 64-bit timestamp. The existing ioctl implementation is refactored to handle both the 32-bit and 64-bit variants.

Joris Verhaegen committed 1 year ago

Commit 86eec881 parent f20a5392 files · +39 −15Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/sound/compress_offload.h+11−0
@@ -84,6 +84,16 @@ struct snd_compr_avail { · 83 unmodified lines
8484 struct snd_compr_tstamp tstamp;
8585 } __attribute__((packed, aligned(4)));
8686
87+/**
88+ * struct snd_compr_avail64 - avail descriptor with tstamp in 64 bit format
89+ * @avail: Number of bytes available in ring buffer for writing/reading
90+ * @tstamp: timestamp information
91+ */
92+struct snd_compr_avail64 {
93+ __u64 avail;
94+ struct snd_compr_tstamp64 tstamp;
95+} __attribute__((packed, aligned(4)));
96+
8797 enum snd_compr_direction {
8898 SND_COMPRESS_PLAYBACK = 0,
8999 SND_COMPRESS_CAPTURE,
@@ -231,6 +241,7 @@ struct snd_compr_task_status { · 141 unmodified lines
231241 #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
232242 #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
233243 #define SNDRV_COMPRESS_TSTAMP64 _IOR('C', 0x22, struct snd_compr_tstamp64)
244+#define SNDRV_COMPRESS_AVAIL64 _IOR('C', 0x23, struct snd_compr_avail64)
234245 #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
235246 #define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
236247 #define SNDRV_COMPRESS_START _IO('C', 0x32)