Loading core/java/android/hardware/Camera.java +4 −0 Original line number Diff line number Diff line Loading @@ -1007,6 +1007,10 @@ public class Camera { * camera.setDisplayOrientation(result); * } * </pre> * * <p>Starting from API level 14, this method can be called when preview is * active. * * @param degrees the angle that the picture will be rotated clockwise. * Valid values are 0, 90, 180, and 270. The starting * position is 0 (landscape). Loading services/camera/libcameraservice/CameraService.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading
core/java/android/hardware/Camera.java +4 −0 Original line number Diff line number Diff line Loading @@ -1007,6 +1007,10 @@ public class Camera { * camera.setDisplayOrientation(result); * } * </pre> * * <p>Starting from API level 14, this method can be called when preview is * active. * * @param degrees the angle that the picture will be rotated clockwise. * Valid values are 0, 90, 180, and 270. The starting * position is 0 (landscape). Loading
services/camera/libcameraservice/CameraService.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading