summaryrefslogtreecommitdiffstats
path: root/jni
Commit message (Collapse)AuthorAgeFilesLines
* Rename Camera to LegacyCamera for SDK inclusion.Eino-Ville Talvala2012-06-041-1/+1
| | | | | | | The SDK needs a camera app that does not require GPU acceleration. The Camera app from 4.0.4 meets these requirements. Change-Id: Idb42d4b9e47d584ef1da10e3ba672d537c8db94b
* Changes to resolve jagged horizontal edge and blurred vertical edge issues.mbansal2011-11-082-11/+18
| | | | | | | | | 1) Made the strip width and cross-fading parameters absolute pixel values. 2) Updated the above parameters to use thinner strips with lower cross-fading radius. 3) Added another parameter to limit the number of pyramid levels at which cross-fading is applied. Bug: 5578488 Change-Id: I69161bfbb535dc5bfcd647cfa6d6e050b6ad0068
* Fix an OOM issue in mosaic blending.Wei-Ta Chen2011-11-042-3/+39
| | | | | | | | | | | | Set two limits on when we will do mosaic blending. 1) mosaic_width * mosaic_height < (5 * frame_width) * (2 * frame_height) 2) mosaic_height < 2.5 * frame_height The latter limit rejects blending for the cases having too much movement in the secondary direction. Bug: 5554762 Change-Id: I05fb24bb1ff5446bea0cc1a1de8a02c37fb642d7
* Make Panorama work in portrait layout.Wei-Ta Chen2011-10-261-34/+111
| | | | | | | | Add the support of both portrait and landscape layout to the panorama library. Add a step into the preview renderer that rotates the content in the offscreen buffer by 90 degrees in the case of a portrait layout. Change-Id: I879e3476daac522b0c8b27fe3ef5b17ebf0797e3
* Eliminating aliasing vertical lines.Wei-Ta Chen2011-10-142-55/+73
| | | | | | | | | Reduce the cross-fading factor to eliminate the aliasing vertical lines. Also, fix an issues in blending: skipping cross-fading when the cross-fading width is 0. Bug: 5446629 Change-Id: Id5fed50824a2b93d80ad464864e4e74a656acb82
* Avoid a possible overflow on setting the mosaic size.Wei-Ta Chen2011-10-123-2/+3
| | | | | | | | Log the size of the mosaic image before cropping, so as to help debug. Also, fix another issue that NV21 should be vertically subsmapled. Bug: 5412447 Change-Id: I20b0ef7fc1968517c63b7f599f04c8126adc0471
* Blending updates to handle the case of mosaicing with the device in portrait ↵mbansal2011-10-031-49/+170
| | | | | | | | | mode. 1) Updated the wide-strip blending algorithm to select the strips correctly for portrait mode mosaicing. 2) Updated the cropping algorithm to crop correctly for portrait mode mosaicing. Change-Id: I0f613367d86c8ef380e1334b13426671182ddb85
* Reduce the frame memory we allocate.Wei-Ta Chen2011-10-031-14/+7
| | | | | | | | | | We increment the LR frame counter and the HR frame counter at the same time and check the frame limit condition based on which counter hits the limit first. We can just combine the MAX_FRAMES_HR and MAX_FRAMES_LR to one. This reduces the memory we allocate to LR frames by 8~20 MBytes depending on the size of an input frame. Change-Id: I1b76d94db09985df21c946830295b94f39e99e59
* Updates to handle textureless scenes during capture.mbansal2011-09-227-50/+159
| | | | | | | | | | 1) Starts stitching only when the camera sees a textured scene at the beginning. 2) If a texturess scene is encountered in the middle of a capture, the stitching continues with the intermediate frames translated using the pan velocity estimate. 3) Added more error codes and percolated them up to the java layer. 4) Fix a build error in Mosaic::addFrame() and added comments. 5) Update the javadoc in Mosaic.java to reflect the new returning codes. Change-Id: I7727ace615ece22adefe313a19ac2cbe8c8d21a8
* Bug fixes to the cropping region selection algorithm.mbansal2011-09-211-29/+18
| | | | | | | | 1) The library should now return proper error code for the negative width scenario. 2) Also fixed a round-off issue which lead to improper cropping behavior for low-res output. Bug: 5330440, 5350580 Change-Id: I010be9b8a2b1252c1d2e0528956e512126f6246a
* Merge "Correct the YUV444 to NV21 conversion." into ics-factoryromWei-Ta Chen2011-09-211-1/+1
|\
| * Correct the YUV444 to NV21 conversion.Wei-Ta Chen2011-09-201-1/+1
| | | | | | | | | | | | | | For the downsampling, we should use the same pixel's UV channel, instead of even pixel's V and odd pixel's U. Change-Id: If94ac380b77dc776d61fdab3a31697f9fadfbad1
* | Blending algorithm updates to support WIDE strip-based blending.mbansal2011-09-206-18/+232
|/ | | | | | | 1) Added algorithm to select wider strips (and made it the default mode in the app). 2) Added algorithm to cross-fade blend between the wider strips. Change-Id: I744e69edb16a20f0040ee82c3390548b78853087
* Updated cropping algorithm to get rid of gray pixels around the mosaic border.mbansal2011-09-151-84/+102
| | | | | | | 1) Added documentation to the ComputeBlendParameters(...) function. Bug: 5279291 Change-Id: Iad1c9388ec939c2969b550ee3c194c3d191eb492
* Use the high-resolution data to render the preview.Wei-Ta Chen2011-09-113-23/+30
| | | | | | | | We now use high-res data, instead of low-res data, to render the viewfinder/preview mosaic. This results in a much better quality in viewfinder/preview mosaic. Bug: 5271646 Change-Id: I5e9c466d86b95699b94beb56d809a3249972341f
* Clean up the logs.Wei-Ta Chen2011-09-1111-138/+144
| | | | | Bug: 5277853 Change-Id: Ic1c9a0395846b6815f2c18663e3c9078781a6194
* Make the preview mosaic leave a margin.Wei-Ta Chen2011-09-091-3/+9
| | | | | | | | | To follow the UI spec, the preview mosaic shouldn't grow to the boundary of control bar when we pan the device. Also, the height of the preview track on Xoom is increased to better match the spec. Change-Id: Ic1184b00b3b9efd6232c51fa666ba7a0862c1a98
* Updates to allow cancellation of mosaic computation from a UI trigger.mbansal2011-09-095-23/+81
| | | | | | | | 1) reportProgress now takes a new boolean parameter that can be used to break out of the mosaic computation loop at the library level. 2) Added a cancel button to the progressDialog and a new Handler message to handle the button click so that the user can be taken back to the capture stage. 3) Updates to address the code review. Change-Id: I0768da55dd6ccd9b1464d456ab41973779734c65
* Fix a warping bug that makes images slant.Wei-Ta Chen2011-08-312-1/+3
| | | | Change-Id: Ia580bf037de698ac4a8a8e98b649f284bb1e299b
* Fix a monkey bug - a null pointer issue in native.Wei-Ta Chen2011-08-301-0/+8
| | | | | | | | | | | A monkey report shows that we try to generate a mosaic even before we added any frame to the aligner. This is unlikely to be triggered by human actions but machine generated sequences. To fix it, we ensure that we do blending on frames only after we have accepted frames in aligner. Bug: 5182097 Change-Id: I16c8efea2b1e3f5b53e65e480da169e24c939ec2
* Update the transform matrix from SurfaceTexture.Wei-Ta Chen2011-08-291-8/+6
| | | | | | | | | | Bug: 5211070 Fix the issue that the transform matrix from SurfaceTexture is not set into the shader. Also, the texture coordinates are corrected to fix the upside down issue. Change-Id: Ia97f590a572aff64c65b6fb94672752e1634405b
* Updates to allow the mosaic library to report the mosaic computation ↵mbansal2011-08-245-9/+49
| | | | | | | | | | | progress (both low-res and high-res). 1) Added a new method to the Mosaic class that reports the percent progress for both LR and HR mosaicers. 2) Added a test function to the activity that logs the reported progress. 3) [REMOVED] Added a test progress-bar to the UI for quick testing of the progress reporting UI. 4) Made minor updates in response to Wei-Ta's review. Change-Id: Iaf8ccf771579a40580a868743a6b53c6b05f14c6
* Updates to remove compile warnings and stop the viewfinder panning at UI ↵mbansal2011-08-228-166/+229
| | | | | | | | | | boundary. Also, new logic for rendering the preview mosaic. 1) Fixed compiler warnings reported by Wei-Ta. 2) The viewfinder now stops panning (for both left-to-right and right-to-left motions) when it hits a pre-defined border region within the screen viewport. 3) Updated the logic for rendering to always maintain the preview mosaic (previewFBO) in the current-frame coordinate system. This fixes the repeating issues. Change-Id: I6619ffe96955965ba523e330fa6561c88e6e6d5c
* Updates to allow the viewfinder to slide across the UI with device panning. ↵mbansal2011-08-1814-700/+903
| | | | | | | | | | | | | | | Also, rendering updates for color conversion using GPU. 1) Refactored the SurfaceTextureRenderer and WarpRenderer classes to inherit from a new base class Renderer. 2) Fixed a minor bug in the Blend class and added a helper function to create the mosaic in middle frame coordinate system [no changes in run-time behavior]. 3) Added a flip-flop gPreviewFBO to allow panning the viewfinder across the UI when the user pans the device. 4) Fixed the size of the viewfinder and preview mosaic to match the UI layout height. 5) The viewfinder in the preview stage is now aligned with the viewfinder in the capture stage. 6) Added new class YVURenderer that converts from RGB to YVU data using GLSL shaders. 7) Modified the rendering pipeline to use GPU for RGB to YVU conversion. The processing thread now only performs conversion from YVUA interlaced to YVU planar format. 8) Updates following Wei-Ta's code-review comments. Change-Id: I6c18df3b57d1c2d78d55da8a8f3b9cd970c8d903
* Updates to allow using SurfaceTexture for reading the preview frames ↵mbansal2011-08-1210-86/+776
| | | | | | | | | | | | | | | | | | | directly from GPU memory. 1) SurfaceTexture is now used to obtain the data processed by the mosaicing library. 2) SurfaceTexture in GPU memory is directly rendered using the transformation from the mosaicing library to generate the preview mosaic. 3) GPU is also used to generate the Low-Res frames from the High-res frames (was being done in CPU before). 4) SurfaceTexture is also used to render the viewfinder as soon as the mosaicing application starts (eliminating the need for a separate SurfaceHolder to render the camera). 5) Modified the XML layout during the preview state to be the same size as during the capture stage to accommodate the SurfaceTexture based viewfinder [this needs to be reviewed and adjusted]. 6) Fixed the viewfinder and back button issues identified by Wei-Ta. 7) Round-1 of removing trailing spaces and tabs. 8) Added documentation to new Java side interfaces and cleaned up code in general. 9) Cleaned up redundant and commented out code from the native side. 10) Merged with latest updates from the main trunk. 11) Fixed issues identified in code review and also cleaned up and refactored some code. 12) Added layout-w1024dp/pano_capture.xml for tablet layout. Change-Id: If8fb0116de6c7fc6652cc67ac453553726961c32
* Updates for mosaic preview rendering to happen using native GLES2.0 code.mbansal2011-08-058-14/+1034
| | | | | | | | | | | | | 1) Added new subfolder mosaic_renderer in feature_mos/src with FrameBuffer and WarpRenderer classes. 2) Added mosaic_renderer_jni.h|cpp files to the jni folder to perform GL calls for rendering on the GL thread. 3) Updated code in feature_mos_jni.cpp to connect with mosaic_renderer_jni.cpp. 4) Added new java files in com.android.camera.panorama to encapsulate the GL JNI interface, a GLSurfaceView for display and a GLSurfaceView.Renderer for rendering. 5) Modified APP code to enable the new GL-based rendering and made relevant changes to the UI (in pano_views.xml). 6) Fixed a GL bug which was preventing the rendering from working properly after hitting the back button once. 7) Preview rendering now displays in the current frame coordinate system. 8) Fixed the ghost preview rendering bug. Change-Id: Ieb64ee3fd4a9a2c6563a311a4930ddc85ce2247c
* Add a freeMosaicMemory function in JNI to address the leaks.mbansal2011-07-281-46/+120
| | | | | | | | | 1) Fix coding style issues. 2) Added native and java functions to freeMosaicMemory. 3) Added optimized YUV420to444 conversion routine to native side. 4) Fixed more style issues based on code review comments. Change-Id: Ic824584f6b3a02e4d0d7b472bed57637873ca622
* Check in the Mosaic Stitching codes.Wei-Ta Chen2011-07-271-2/+0
| | | | | | | | | | 1. Camera setup moved to activity level. 2. Fixed releasing and acquiring camera process. 3. Unused .xml files removed. 4. Style issues fixed. Bug: 5031489 Change-Id: Ifd271588ca2168398e17f204f065681ead2d8f2f
* Check in Mosaic.java - the Java interface to JNI.Wei-Ta Chen2011-07-081-20/+8
| | | | Change-Id: Id3a84177aa6978499c5a8b1cff78b44759989119
* Check in mosaic stitching codes - the native partWei-Ta Chen2011-07-0468-0/+23339
Updated to v4-3-2. Bug: 4990566 Change-Id: I779dcc930323353964572918510f1492828c4db4