summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-07-20 11:05:20 -0700
committerEino-Ville Talvala <etalvala@google.com>2012-07-20 11:05:20 -0700
commit898a9a9b867e5d209671feee4c92266f90a55aa3 (patch)
treef27edb5a194a91270307f3289fd8ef6ac392b99d /services/camera
parent4865aa8a84465108e044480c1d976677f138fca6 (diff)
downloadframeworks_av-898a9a9b867e5d209671feee4c92266f90a55aa3.zip
frameworks_av-898a9a9b867e5d209671feee4c92266f90a55aa3.tar.gz
frameworks_av-898a9a9b867e5d209671feee4c92266f90a55aa3.tar.bz2
Camera2: Fix recording bugs
- Release recording stream on shutdown - Return recording gralloc buffers to queue when they are received by camera service after recording has been stopped (which is normal behavior thanks to pipeline latencies in camera pipelines) Bug: 6243944 Change-Id: Ia13a501c726613fd1e404733456dbd10d7b00132
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/Camera2Client.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
index 8d4add4..9d904e8 100644
--- a/services/camera/libcameraservice/Camera2Client.cpp
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -338,6 +338,11 @@ void Camera2Client::disconnect() {
mCaptureStreamId = NO_STREAM;
}
+ if (mRecordingStreamId != NO_STREAM) {
+ mDevice->deleteStream(mRecordingStreamId);
+ mRecordingStreamId = NO_STREAM;
+ }
+
CameraService::Client::disconnect();
}
@@ -1492,10 +1497,12 @@ void Camera2Client::onRecordingFrameAvailable() {
{
Mutex::Autolock icl(mICameraLock);
// TODO: Signal errors here upstream
+ bool discardData = false;
if (mState != RECORD && mState != VIDEO_SNAPSHOT) {
- ALOGE("%s: Camera %d: Recording image buffer produced unexpectedly!",
+ ALOGV("%s: Camera %d: Discarding recording image buffers received after "
+ "recording done",
__FUNCTION__, mCameraId);
- return;
+ discardData = true;
}
CpuConsumer::LockedBuffer imgBuffer;
@@ -1509,9 +1516,14 @@ void Camera2Client::onRecordingFrameAvailable() {
if (imgBuffer.format != (int)kRecordingFormat) {
ALOGE("%s: Camera %d: Unexpected recording format: %x",
__FUNCTION__, mCameraId, imgBuffer.format);
+ discardData = true;
+ }
+
+ if (discardData) {
mRecordingConsumer->unlockBuffer(imgBuffer);
return;
}
+
size_t bufferSize = imgBuffer.width * imgBuffer.height * 3 / 2;
if (mRecordingHeap == 0 ||