diff options
Diffstat (limited to 'services')
5 files changed, 44 insertions, 9 deletions
diff --git a/services/audiopolicy/AudioPolicyInterface.h b/services/audiopolicy/AudioPolicyInterface.h index 8523fc5..c1e7bc0 100644 --- a/services/audiopolicy/AudioPolicyInterface.h +++ b/services/audiopolicy/AudioPolicyInterface.h @@ -64,6 +64,7 @@ public: API_INPUT_MIX_EXT_POLICY_REROUTE,// used for platform audio rerouting, where mixes are // handled by external and dynamically installed // policies which reroute audio mixes + API_INPUT_TELEPHONY_RX, // used for capture from telephony RX path } input_type_t; public: diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index 3e6df38..b1d7b13 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -1351,6 +1351,8 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr, } else if (audio_is_remote_submix_device(device)) { address = String8("0"); *inputType = API_INPUT_MIX_CAPTURE; + } else if (device == AUDIO_DEVICE_IN_TELEPHONY_RX) { + *inputType = API_INPUT_TELEPHONY_RX; } else { *inputType = API_INPUT_LEGACY; } diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp index 65639c3..793c26a 100644 --- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp +++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp @@ -303,6 +303,8 @@ status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr, switch (inputType) { case AudioPolicyInterface::API_INPUT_LEGACY: break; + case AudioPolicyInterface::API_INPUT_TELEPHONY_RX: + // FIXME: use the same permission as for remote submix for now. case AudioPolicyInterface::API_INPUT_MIX_CAPTURE: if (!captureAudioOutputAllowed()) { ALOGE("getInputForAttr() permission denied: capture not allowed"); diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp index 3afbd89..0a4440f 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.cpp +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp @@ -370,7 +370,7 @@ ssize_t Camera3Device::getJpegBufferSize(uint32_t width, uint32_t height) const // Get max jpeg size (area-wise). Size maxJpegResolution = getMaxJpegResolution(); if (maxJpegResolution.width == 0) { - ALOGE("%s: Camera %d: Can't find find valid available jpeg sizes in static metadata!", + ALOGE("%s: Camera %d: Can't find valid available jpeg sizes in static metadata!", __FUNCTION__, mId); return BAD_VALUE; } @@ -397,6 +397,21 @@ ssize_t Camera3Device::getJpegBufferSize(uint32_t width, uint32_t height) const return jpegBufferSize; } +ssize_t Camera3Device::getPointCloudBufferSize() const { + const int FLOATS_PER_POINT=4; + camera_metadata_ro_entry maxPointCount = mDeviceInfo.find(ANDROID_DEPTH_MAX_DEPTH_SAMPLES); + if (maxPointCount.count == 0) { + ALOGE("%s: Camera %d: Can't find maximum depth point cloud size in static metadata!", + __FUNCTION__, mId); + return BAD_VALUE; + } + ssize_t maxBytesForPointCloud = sizeof(android_depth_points) + + maxPointCount.data.i32[0] * sizeof(float) * FLOATS_PER_POINT; + return maxBytesForPointCloud; +} + + + status_t Camera3Device::dump(int fd, const Vector<String16> &args) { ATRACE_CALL(); (void)args; @@ -865,14 +880,22 @@ status_t Camera3Device::createStream(sp<Surface> consumer, sp<Camera3OutputStream> newStream; if (format == HAL_PIXEL_FORMAT_BLOB) { - ssize_t jpegBufferSize = getJpegBufferSize(width, height); - if (jpegBufferSize <= 0) { - SET_ERR_L("Invalid jpeg buffer size %zd", jpegBufferSize); - return BAD_VALUE; + ssize_t blobBufferSize; + if (dataSpace != HAL_DATASPACE_DEPTH) { + blobBufferSize = getJpegBufferSize(width, height); + if (blobBufferSize <= 0) { + SET_ERR_L("Invalid jpeg buffer size %zd", blobBufferSize); + return BAD_VALUE; + } + } else { + blobBufferSize = getPointCloudBufferSize(); + if (blobBufferSize <= 0) { + SET_ERR_L("Invalid point cloud buffer size %zd", blobBufferSize); + return BAD_VALUE; + } } - newStream = new Camera3OutputStream(mNextStreamId, consumer, - width, height, jpegBufferSize, format, dataSpace, rotation); + width, height, blobBufferSize, format, dataSpace, rotation); } else { newStream = new Camera3OutputStream(mNextStreamId, consumer, width, height, format, dataSpace, rotation); @@ -2067,8 +2090,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 140da98..8bd0f8e 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.h +++ b/services/camera/libcameraservice/device3/Camera3Device.h @@ -146,6 +146,7 @@ class Camera3Device : virtual uint32_t getDeviceVersion(); virtual ssize_t getJpegBufferSize(uint32_t width, uint32_t height) const; + ssize_t getPointCloudBufferSize() const; // Methods called by subclasses void notifyStatus(bool idle); // updates from StatusTracker @@ -153,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); |