summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
Diffstat (limited to 'camera')
-rw-r--r--camera/ANativeWindowDisplayAdapter.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/camera/ANativeWindowDisplayAdapter.cpp b/camera/ANativeWindowDisplayAdapter.cpp
index 7fe574a..ae11f4a 100644
--- a/camera/ANativeWindowDisplayAdapter.cpp
+++ b/camera/ANativeWindowDisplayAdapter.cpp
@@ -1099,13 +1099,14 @@ status_t ANativeWindowDisplayAdapter::PostFrame(ANativeWindowDisplayAdapter::Dis
}
- mFramesType.add( (int)mBuffers[i].opaque ,dispFrame.mType );
+ android::AutoMutex lock(mLock);
+
+ mFramesType.add( (int)mBuffers[i].opaque, dispFrame.mType);
if ( mDisplayState == ANativeWindowDisplayAdapter::DISPLAY_STARTED &&
(!mPaused || CameraFrame::CameraFrame::SNAPSHOT_FRAME == dispFrame.mType) &&
!mSuspend)
{
- android::AutoMutex lock(mLock);
uint32_t xOff = (dispFrame.mOffset% PAGE_SIZE);
uint32_t yOff = (dispFrame.mOffset / PAGE_SIZE);
@@ -1185,7 +1186,6 @@ status_t ANativeWindowDisplayAdapter::PostFrame(ANativeWindowDisplayAdapter::Dis
}
else
{
- android::AutoMutex lock(mLock);
buffer_handle_t *handle = (buffer_handle_t *) mBuffers[i].opaque;
// unlock buffer before giving it up
@@ -1217,6 +1217,8 @@ bool ANativeWindowDisplayAdapter::handleFrameReturn()
int stride; // dummy variable to get stride
android::GraphicBufferMapper &mapper = android::GraphicBufferMapper::get();
android::Rect bounds;
+ CameraFrame::FrameType frameType = CameraFrame::PREVIEW_FRAME_SYNC;
+
void *y_uv[2];
// TODO(XXX): Do we need to keep stride information in camera hal?
@@ -1279,18 +1281,19 @@ bool ANativeWindowDisplayAdapter::handleFrameReturn()
{
android::AutoMutex lock(mLock);
mFramesWithCameraAdapterMap.add((buffer_handle_t *) mBuffers[i].opaque, i);
- }
- for( k = 0; k < mFramesType.size() ; k++) {
- if(mFramesType.keyAt(k) == (int)mBuffers[i].opaque)
- break;
- }
- if ( k == mFramesType.size() ) {
- CAMHAL_LOGE("Frame type for preview buffer 0%x not found!!", mBuffers[i].opaque);
- return false;
- }
+ for( k = 0; k < mFramesType.size() ; k++) {
+ if(mFramesType.keyAt(k) == (int)mBuffers[i].opaque)
+ break;
+ }
- CameraFrame::FrameType frameType = (CameraFrame::FrameType) mFramesType.valueAt(k);
+ if ( k == mFramesType.size() ) {
+ CAMHAL_LOGE("Frame type for preview buffer 0%x not found!!", mBuffers[i].opaque);
+ return false;
+ }
+
+ frameType = (CameraFrame::FrameType) mFramesType.valueAt(k);
+ }
CAMHAL_LOGVB("handleFrameReturn: found graphic buffer %d of %d", i, mBufferCount-1);
mFrameProvider->returnFrame(&mBuffers[i], frameType);