diff options
| -rw-r--r-- | media/libstagefright/codecs/amrwbenc/src/util.c | 19 | ||||
| -rw-r--r-- | services/camera/libcameraservice/device3/Camera3Device.cpp | 6 | ||||
| -rw-r--r-- | services/camera/libcameraservice/device3/Camera3Device.h | 4 |
3 files changed, 19 insertions, 10 deletions
diff --git a/media/libstagefright/codecs/amrwbenc/src/util.c b/media/libstagefright/codecs/amrwbenc/src/util.c index 76ab1b1..333140d 100644 --- a/media/libstagefright/codecs/amrwbenc/src/util.c +++ b/media/libstagefright/codecs/amrwbenc/src/util.c @@ -35,9 +35,10 @@ void Set_zero( ) { Word32 num = (Word32)L; - do{ + while (num > 0) { *x++ = 0; - }while(--num !=0); + --num; + } } @@ -54,20 +55,22 @@ void Copy( ) { Word32 temp1,temp2,num; + if (L <= 0) { + return; + } if(L&1) { temp1 = *x++; *y++ = temp1; } num = (Word32)(L>>1); - temp1 = *x++; - temp2 = *x++; - do{ - *y++ = temp1; - *y++ = temp2; + while (num > 0) { temp1 = *x++; temp2 = *x++; - }while(--num!=0); + *y++ = temp1; + *y++ = temp2; + --num; + } } diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp index f1ccf0b..0c941fb 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.cpp +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp @@ -2113,8 +2113,12 @@ void Camera3Device::removeInFlightRequestIfReadyLocked(int idx) { // Sanity check - if we have too many in-flight frames, something has // likely gone wrong - if (mInFlightMap.size() > kInFlightWarnLimit) { + if (!mIsConstrainedHighSpeedConfiguration && mInFlightMap.size() > kInFlightWarnLimit) { CLOGE("In-flight list too large: %zu", mInFlightMap.size()); + } else if (mIsConstrainedHighSpeedConfiguration && mInFlightMap.size() > + kInFlightWarnLimitHighSpeed) { + CLOGE("In-flight list too large for high speed configuration: %zu", + mInFlightMap.size()); } } diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h index 0ea9b8b..5287058 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.h +++ b/services/camera/libcameraservice/device3/Camera3Device.h @@ -154,9 +154,11 @@ class Camera3Device : private: static const size_t kDumpLockAttempts = 10; static const size_t kDumpSleepDuration = 100000; // 0.10 sec - static const size_t kInFlightWarnLimit = 20; static const nsecs_t kShutdownTimeout = 5000000000; // 5 sec static const nsecs_t kActiveTimeout = 500000000; // 500 ms + static const size_t kInFlightWarnLimit = 20; + static const size_t kInFlightWarnLimitHighSpeed = 256; // batch size 32 * pipe depth 8 + struct RequestTrigger; // minimal jpeg buffer size: 256KB + blob header static const ssize_t kMinJpegBufferSize = 256 * 1024 + sizeof(camera3_jpeg_blob); |
