diff options
author | Raji Reddy Kandi <rajireddy.k@samsung.com> | 2011-09-30 15:16:17 +0530 |
---|---|---|
committer | Wei-Ta Chen <weita@google.com> | 2011-09-30 15:01:08 -0700 |
commit | 575b49275691f5b539fe2c6dfde1741645dc3e93 (patch) | |
tree | 669959a690f7f046ad670a1e5bc16033ef7f076d /src/com | |
parent | ee7912a2f1ae197ec150e033088358cde516bfd5 (diff) | |
download | packages_apps_LegacyCamera-575b49275691f5b539fe2c6dfde1741645dc3e93.zip packages_apps_LegacyCamera-575b49275691f5b539fe2c6dfde1741645dc3e93.tar.gz packages_apps_LegacyCamera-575b49275691f5b539fe2c6dfde1741645dc3e93.tar.bz2 |
Issue: panorama preview is rotated 90 deg after lock and unlock.
Fixed.panorama preview is rotated 90 deg after lock and unlock. Its fixed.
Change-Id: Ibc5e3d18a56b3900c0715a3aeb7f345ccc476fca
Signed-off-by: Raji Reddy Kandi <rajireddy.k@samsung.com>
Diffstat (limited to 'src/com')
-rwxr-xr-x[-rw-r--r--] | src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | src/com/android/camera/panorama/PanoramaActivity.java | 26 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java b/src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java index 5c10209..b2b2f56 100644..100755 --- a/src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java +++ b/src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java @@ -31,6 +31,7 @@ public class MosaicRendererSurfaceViewRenderer implements GLSurfaceView.Renderer /** A callback to be called when the surface is created */ public interface MosaicSurfaceCreateListener { public void onMosaicSurfaceCreated(final int surface); + public void onMosaicSurfaceChanged(); } @Override @@ -42,6 +43,9 @@ public class MosaicRendererSurfaceViewRenderer implements GLSurfaceView.Renderer public void onSurfaceChanged(GL10 gl, int width, int height) { MosaicRenderer.reset(width, height); Log.i(TAG, "Renderer: onSurfaceChanged"); + if (mSurfaceCreateListener != null) { + mSurfaceCreateListener.onMosaicSurfaceChanged(); + } } @Override diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java index fcd47e6..a1605de 100644..100755 --- a/src/com/android/camera/panorama/PanoramaActivity.java +++ b/src/com/android/camera/panorama/PanoramaActivity.java @@ -406,10 +406,6 @@ public class PanoramaActivity extends ActivityBase implements private void configureCamera(Parameters parameters) { mCameraDevice.setParameters(parameters); - - int orientation = Util.getDisplayOrientation(Util.getDisplayRotation(this), - CameraHolder.instance().getBackCameraId()); - mCameraDevice.setDisplayOrientation(orientation); } private boolean switchToOtherMode(int mode) { @@ -430,6 +426,18 @@ public class PanoramaActivity extends ActivityBase implements } @Override + public void onMosaicSurfaceChanged() { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (!mPausing) { + startCameraPreview(); + } + } + }); + } + + @Override public void onMosaicSurfaceCreated(final int textureID) { runOnUiThread(new Runnable() { @Override @@ -440,7 +448,6 @@ public class PanoramaActivity extends ActivityBase implements mSurfaceTexture = new SurfaceTexture(textureID); if (!mPausing) { mSurfaceTexture.setOnFrameAvailableListener(PanoramaActivity.this); - startCameraPreview(); } } }); @@ -902,10 +909,7 @@ public class PanoramaActivity extends ActivityBase implements mCaptureState = CAPTURE_STATE_VIEWFINDER; setupCamera(); - if (mSurfaceTexture != null) { - mSurfaceTexture.setOnFrameAvailableListener(this); - startCameraPreview(); - } + // Camera must be initialized before MosaicFrameProcessor is initialized. The preview size // has to be decided by camera device. initMosaicFrameProcessorIfNeeded(); @@ -1012,6 +1016,10 @@ public class PanoramaActivity extends ActivityBase implements // the screen). if (mCameraState != PREVIEW_STOPPED) stopCameraPreview(); + int orientation = Util.getDisplayOrientation(Util.getDisplayRotation(this), + CameraHolder.instance().getBackCameraId()); + mCameraDevice.setDisplayOrientation(orientation); + setPreviewTexture(mSurfaceTexture); try { |