hal: add support to send compress offload fragment size
In case of compress offload, add support to set offload fragment size.
Change-Id: Ie23803c8d1d26b40a6a61c0d4e7d61e3aba5c86f
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 1ce6fd1..5d0eac5 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -3670,6 +3670,14 @@
fragment_size = atoi(value) * 1024;
}
+ /* Use incoming offload buffer size if default buffer size is less */
+ if ((info != NULL) && (fragment_size < info->offload_buffer_size)) {
+ ALOGI("%s:: Overwriting offload buffer size default:%d new:%d", __func__,
+ fragment_size,
+ info->offload_buffer_size);
+ fragment_size = info->offload_buffer_size;
+ }
+
// For FLAC use max size since it is loss less, and has sampling rates
// upto 192kHZ
if (info != NULL && !info->has_video &&
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index d215a89..53f9833 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -3180,6 +3180,14 @@
fragment_size = atoi(value) * 1024;
}
+ /* Use incoming offload buffer size if default buffer size is less */
+ if ((info != NULL) && (fragment_size < info->offload_buffer_size)) {
+ ALOGI("%s:: Overwriting offload buffer size default:%d new:%d", __func__,
+ fragment_size,
+ info->offload_buffer_size);
+ fragment_size = info->offload_buffer_size;
+ }
+
// For FLAC use max size since it is loss less, and has sampling rates
// upto 192kHZ
if (info != NULL && !info->has_video &&