summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rwxr-xr-xservices/audioflinger/Threads.cpp13
-rw-r--r--services/audioflinger/Tracks.cpp4
-rw-r--r--services/camera/libcameraservice/CameraService.cpp29
3 files changed, 30 insertions, 16 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index c0daa08..d6390b1 100755
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -5139,7 +5139,7 @@ reacquire_wakelock:
sleepUs = kRecordThreadSleepUs;
}
if (framesRead <= 0) {
- continue;
+ goto unlock;
}
ALOG_ASSERT(framesRead > 0);
@@ -5147,10 +5147,12 @@ reacquire_wakelock:
(void) mTeeSink->write(&mRsmpInBuffer[rear * mChannelCount], framesRead);
}
// If destination is non-contiguous, we now correct for reading past end of buffer.
- size_t part1 = mRsmpInFramesP2 - rear;
- if ((size_t) framesRead > part1) {
- memcpy(mRsmpInBuffer, &mRsmpInBuffer[mRsmpInFramesP2 * mChannelCount],
- (framesRead - part1) * mFrameSize);
+ {
+ size_t part1 = mRsmpInFramesP2 - rear;
+ if ((size_t) framesRead > part1) {
+ memcpy(mRsmpInBuffer, &mRsmpInBuffer[mRsmpInFramesP2 * mChannelCount],
+ (framesRead - part1) * mFrameSize);
+ }
}
rear = mRsmpInRear += framesRead;
@@ -5358,6 +5360,7 @@ reacquire_wakelock:
}
+unlock:
// enable changes in effect chain
unlockEffectChains(effectChains);
// effectChains doesn't need to be cleared, since it is cleared by destructor at scope end
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 4e8a058..1e906ad 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -223,6 +223,8 @@ AudioFlinger::ThreadBase::TrackBase::~TrackBase()
// relying on the automatic clear() at end of scope.
mClient.clear();
}
+ // flush the binder command buffer
+ IPCThreadState::self()->flushCommands();
}
// AudioBufferProvider interface
@@ -432,8 +434,6 @@ AudioFlinger::PlaybackThread::Track::~Track()
// This prevents that leak.
if (mSharedBuffer != 0) {
mSharedBuffer.clear();
- // flush the binder command buffer
- IPCThreadState::self()->flushCommands();
}
}
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 9fd35e1..280478c 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -278,6 +278,7 @@ status_t CameraService::generateShimMetadata(int cameraId, /*out*/CameraMetadata
}
Vector<Size> sizes;
+ Vector<Size> jpegSizes;
Vector<int32_t> formats;
const char* supportedPreviewFormats;
{ // Scope for service lock
@@ -287,6 +288,8 @@ status_t CameraService::generateShimMetadata(int cameraId, /*out*/CameraMetadata
mShimParams[index].getSupportedPreviewSizes(/*out*/sizes);
mShimParams[index].getSupportedPreviewFormats(/*out*/formats);
+
+ mShimParams[index].getSupportedPictureSizes(/*out*/jpegSizes);
}
// Always include IMPLEMENTATION_DEFINED
@@ -295,21 +298,29 @@ status_t CameraService::generateShimMetadata(int cameraId, /*out*/CameraMetadata
const size_t INTS_PER_CONFIG = 4;
// Build available stream configurations metadata
- size_t streamConfigSize = sizes.size() * formats.size() * INTS_PER_CONFIG;
- int32_t streamConfigs[streamConfigSize];
- size_t configIndex = 0;
+ size_t streamConfigSize = (sizes.size() * formats.size() + jpegSizes.size()) * INTS_PER_CONFIG;
+
+ Vector<int32_t> streamConfigs;
+ streamConfigs.setCapacity(streamConfigSize);
+
for (size_t i = 0; i < formats.size(); ++i) {
for (size_t j = 0; j < sizes.size(); ++j) {
- streamConfigs[configIndex++] = formats[i];
- streamConfigs[configIndex++] = sizes[j].width;
- streamConfigs[configIndex++] = sizes[j].height;
- streamConfigs[configIndex++] =
- ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT;
+ streamConfigs.add(formats[i]);
+ streamConfigs.add(sizes[j].width);
+ streamConfigs.add(sizes[j].height);
+ streamConfigs.add(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT);
}
}
+ for (size_t i = 0; i < jpegSizes.size(); ++i) {
+ streamConfigs.add(HAL_PIXEL_FORMAT_BLOB);
+ streamConfigs.add(jpegSizes[i].width);
+ streamConfigs.add(jpegSizes[i].height);
+ streamConfigs.add(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT);
+ }
+
if ((ret = shimInfo.update(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,
- streamConfigs, streamConfigSize)) != OK) {
+ streamConfigs.array(), streamConfigSize)) != OK) {
return ret;
}