audio: Presentation time enhancements

1) Add API to query platform render latency. This API is only
valid for deep-buffer and low-latency streams.
2) Adjust frames rendered for deep-buffer and low-latency streams
with the platform render latency
3) Use tinycompress APIs to query presentation time in case of
offload streams.

Bug: 10551158
Change-Id: If94e0994bfc0b757f29aa4b48be6fc63dc17bca0
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index e533f33..b200e27 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -200,6 +200,9 @@
     [SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE] = 5,
 };
 
+#define DEEP_BUFFER_PLATFORM_DELAY (29*1000LL)
+#define LOW_LATENCY_PLATFORM_DELAY (13*1000LL)
+
 static pthread_once_t check_op_once_ctl = PTHREAD_ONCE_INIT;
 static bool is_tmus = false;
 
@@ -880,3 +883,16 @@
 
     return max_channels;
 }
+
+/* Delay in Us */
+int64_t platform_render_latency(audio_usecase_t usecase)
+{
+    switch (usecase) {
+        case USECASE_AUDIO_PLAYBACK_DEEP_BUFFER:
+            return DEEP_BUFFER_PLATFORM_DELAY;
+        case USECASE_AUDIO_PLAYBACK_LOW_LATENCY:
+            return LOW_LATENCY_PLATFORM_DELAY;
+        default:
+            return 0;
+    }
+}