diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-09-12 14:50:27 -0700 |
---|---|---|
committer | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-09-13 11:54:18 -0700 |
commit | a53021f776d0c82271727e5817388936513feb92 (patch) | |
tree | e327459787f6a4d154131ac8cfbb440b530796de /services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp | |
parent | 98d594620365088e05c4e5925bb00bf065b8caa1 (diff) | |
download | frameworks_av-a53021f776d0c82271727e5817388936513feb92.zip frameworks_av-a53021f776d0c82271727e5817388936513feb92.tar.gz frameworks_av-a53021f776d0c82271727e5817388936513feb92.tar.bz2 |
Camera2: fix 4K recording
Bug: 17484683
Change-Id: I09bb12698057555329286c777102b9b310452fb3
Diffstat (limited to 'services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp')
-rw-r--r-- | services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp b/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp index ab0af0d..9e7fff8 100644 --- a/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp +++ b/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp @@ -318,6 +318,44 @@ status_t StreamingProcessor::updateRecordingRequest(const Parameters ¶ms) { return OK; } +status_t StreamingProcessor::recordingStreamNeedsUpdate( + const Parameters ¶ms, bool *needsUpdate) { + status_t res; + + if (needsUpdate == 0) { + ALOGE("%s: Camera %d: invalid argument", __FUNCTION__, mId); + return INVALID_OPERATION; + } + + if (mRecordingStreamId == NO_STREAM) { + *needsUpdate = true; + return OK; + } + + sp<CameraDeviceBase> device = mDevice.promote(); + if (device == 0) { + ALOGE("%s: Camera %d: Device does not exist", __FUNCTION__, mId); + return INVALID_OPERATION; + } + + uint32_t currentWidth, currentHeight; + res = device->getStreamInfo(mRecordingStreamId, + ¤tWidth, ¤tHeight, 0); + if (res != OK) { + ALOGE("%s: Camera %d: Error querying recording output stream info: " + "%s (%d)", __FUNCTION__, mId, + strerror(-res), res); + return res; + } + + if (mRecordingConsumer == 0 || currentWidth != (uint32_t)params.videoWidth || + currentHeight != (uint32_t)params.videoHeight) { + *needsUpdate = true; + } + *needsUpdate = false; + return res; +} + status_t StreamingProcessor::updateRecordingStream(const Parameters ¶ms) { ATRACE_CALL(); status_t res; |