Camera3HWI: Improve slow motion perf

Increase the number of minimal in-flight requests for slow motion and
avoid blocking requests in the middle of a batch.

Bug: 28246165
Change-Id: I7e440a7b9863b5a54969252feae0445d41e2c669
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 094c340..5add368 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -3831,7 +3831,10 @@
         minInFlightRequests = MIN_INFLIGHT_HFR_REQUESTS;
         maxInFlightRequests = MAX_INFLIGHT_HFR_REQUESTS;
     }
-    while ((mPendingLiveRequest >= minInFlightRequests) && !pInputBuffer) {
+
+    // Do not block in the middle of a batch.
+    while ((mPendingLiveRequest >= minInFlightRequests) && !pInputBuffer &&
+            mToBeQueuedVidBufs == 0) {
         if (!isValidTimeout) {
             CDBG("%s: Blocking on conditional wait", __func__);
             pthread_cond_wait(&mRequestCond, &mMutex);
diff --git a/camera/QCamera2/stack/common/cam_types.h b/camera/QCamera2/stack/common/cam_types.h
index 8a3a471..d132c01 100644
--- a/camera/QCamera2/stack/common/cam_types.h
+++ b/camera/QCamera2/stack/common/cam_types.h
@@ -114,7 +114,7 @@
 #define MIN_INFLIGHT_REQUESTS  3
 #define MAX_INFLIGHT_REPROCESS_REQUESTS 1
 #define MAX_INFLIGHT_HFR_REQUESTS (48)
-#define MIN_INFLIGHT_HFR_REQUESTS (40)
+#define MIN_INFLIGHT_HFR_REQUESTS (48)
 
 #define QCAMERA_DUMP_FRM_LOCATION "/data/misc/camera/"
 #define QCAMERA_MAX_FILEPATH_LENGTH 64