diff options
| author | Wu-cheng Li <wuchengli@google.com> | 2011-10-07 13:13:54 +0800 | 
|---|---|---|
| committer | Wu-cheng Li <wuchengli@google.com> | 2011-10-07 18:01:09 +0800 | 
| commit | b9f588677910cac6ffc0346092bfcfe1c6620b90 (patch) | |
| tree | 739803b1d5906d94945de8238e43ea61f4ea3ba8 /services | |
| parent | d3523f89a867afa111bb332887bf006ec3ae93e6 (diff) | |
| download | frameworks_av-b9f588677910cac6ffc0346092bfcfe1c6620b90.zip frameworks_av-b9f588677910cac6ffc0346092bfcfe1c6620b90.tar.gz frameworks_av-b9f588677910cac6ffc0346092bfcfe1c6620b90.tar.bz2  | |
Allow Camera.setDisplayOrientation to be called when preview is active.
bug:5422679
Change-Id: I4c936ab00428fc158b5947fe8f10b1028869bbdb
Diffstat (limited to 'services')
| -rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index b178fd9..9f7bd27 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -849,16 +849,16 @@ status_t CameraService::Client::sendCommand(int32_t cmd, int32_t arg1, int32_t a      if (result != NO_ERROR) return result;      if (cmd == CAMERA_CMD_SET_DISPLAY_ORIENTATION) { -        // The orientation cannot be set during preview. -        if (mHardware->previewEnabled()) { -            return INVALID_OPERATION; -        }          // Mirror the preview if the camera is front-facing.          orientation = getOrientation(arg1, mCameraFacing == CAMERA_FACING_FRONT);          if (orientation == -1) return BAD_VALUE;          if (mOrientation != orientation) {              mOrientation = orientation; +            if (mPreviewWindow != 0) { +                native_window_set_buffers_transform(mPreviewWindow.get(), +                        mOrientation); +            }          }          return OK;      } else if (cmd == CAMERA_CMD_ENABLE_SHUTTER_SOUND) {  | 
