From 418114d1ceb87ec810e68ead4f46826de2ff3047 Mon Sep 17 00:00:00 2001 From: Banajit Goswami Date: Wed, 14 Dec 2016 22:20:15 -0800 Subject: [PATCH] ANDROID: GKI: msm: qdsp6v2: Add timestamp support for compress capture Add timestamp support for compress driver. Modify ASM driver to read the buffer from predefined offset. CRs-fixed: 1072067 Change-Id: I1c46befc223285495b3c0650e6c3eaae81f58771 Signed-off-by: Satish Babu Patakokila Signed-off-by: Banajit Goswami Signed-off-by: Meng Wang Bug: 151372815 (cherry picked from commit a0c23f99153b532fceac480e17519264aa71e867) Signed-off-by: Saravana Kannan --- include/uapi/sound/compress_params.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h index 808f96b758b9..61efb48b9336 100644 --- a/include/uapi/sound/compress_params.h +++ b/include/uapi/sound/compress_params.h @@ -69,6 +69,11 @@ #define Q6_DTS 0x00010D88 #define Q6_DTS_LBR 0x00010DBB +/* Timestamp flsg */ +/* Bit-0 - 1 : Enable Timestamp mode */ +/* Bit-0 - 0 : Disable Timestamp mode */ +#define COMPRESSED_TIMESTAMP_FLAG 0x0001 + /* Codecs are listed linearly to allow for extensibility */ #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) #define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002) @@ -478,9 +483,25 @@ struct snd_codec { __u32 align; union snd_codec_options options; __u32 compr_passthr; - __u32 reserved[2]; + __u32 flags; + __u32 reserved[1]; } __attribute__((packed, aligned(4))); #define SND_CODEC_COMPRESS_PASSTHROUGH +/** struct snd_codec_metadata + * @length: Length of the encoded buffer. + * @offset: Offset from the buffer address to the first byte of the first + * encoded frame. All encoded frames are consecutive starting + * from this offset. + * @timestamp: Session time in microseconds of the first sample in the buffer. + * @reserved: Reserved for future use. + */ +struct snd_codec_metadata { + __u32 length; + __u32 offset; + __u64 timestamp; + __u32 reserved[4]; +}; + #endif