diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-06-13 17:33:07 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-06-13 17:33:07 +0000 |
commit | c4a8d2ddfff6d91e493692251733f20ece3e713d (patch) | |
tree | a3e4c8c370e1ff5ebe1e21ee4389c93a24a7de6f /services/camera | |
parent | 0662f7b6735df0a140f6512285d05f8f9a38bb98 (diff) | |
parent | a9c64a9398ac2e6173f99e252f305808a34cab1c (diff) | |
download | frameworks_av-c4a8d2ddfff6d91e493692251733f20ece3e713d.zip frameworks_av-c4a8d2ddfff6d91e493692251733f20ece3e713d.tar.gz frameworks_av-c4a8d2ddfff6d91e493692251733f20ece3e713d.tar.bz2 |
Merge "Camera2/3: Create JPEG stream unconditionally." into jb-mr2-dev
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/Camera2Client.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp index 081fdec..a1971e3 100644 --- a/services/camera/libcameraservice/Camera2Client.cpp +++ b/services/camera/libcameraservice/Camera2Client.cpp @@ -682,6 +682,22 @@ status_t Camera2Client::startPreviewL(Parameters ¶ms, bool restart) { return res; } + // We could wait to create the JPEG output stream until first actual use + // (first takePicture call). However, this would substantially increase the + // first capture latency on HAL3 devices, and potentially on some HAL2 + // devices. So create it unconditionally at preview start. As a drawback, + // this increases gralloc memory consumption for applications that don't + // ever take a picture. + // TODO: Find a better compromise, though this likely would involve HAL + // changes. + res = updateProcessorStream(mJpegProcessor, params); + if (res != OK) { + ALOGE("%s: Camera %d: Can't pre-configure still image " + "stream: %s (%d)", + __FUNCTION__, mCameraId, strerror(-res), res); + return res; + } + Vector<uint8_t> outputStreams; bool callbacksEnabled = params.previewCallbackFlags & CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK; @@ -719,18 +735,6 @@ status_t Camera2Client::startPreviewL(Parameters ¶ms, bool restart) { res = mStreamingProcessor->startStream(StreamingProcessor::PREVIEW, outputStreams); } else { - // With recording hint set, we're going to be operating under the - // assumption that the user will record video. To optimize recording - // startup time, create the necessary output streams for recording and - // video snapshot now if they don't already exist. - res = updateProcessorStream(mJpegProcessor, params); - if (res != OK) { - ALOGE("%s: Camera %d: Can't pre-configure still image " - "stream: %s (%d)", - __FUNCTION__, mCameraId, strerror(-res), res); - return res; - } - if (!restart) { res = mStreamingProcessor->updateRecordingRequest(params); if (res != OK) { |