summaryrefslogtreecommitdiffstats
path: root/jni/mosaic_renderer_jni.h
diff options
context:
space:
mode:
authormbansal <mayank.bansal@sri.com>2011-08-08 20:23:02 -0400
committerWei-Ta Chen <weita@google.com>2011-08-12 15:05:43 -0700
commit41a2e9735136f372de95652d0828600282c8e967 (patch)
tree25e946121b6940cd3dfa19746a393e5c05179ef4 /jni/mosaic_renderer_jni.h
parent7058a9318dd5d6d5a1e79a84080cdc02975f68c1 (diff)
downloadLegacyCamera-41a2e9735136f372de95652d0828600282c8e967.zip
LegacyCamera-41a2e9735136f372de95652d0828600282c8e967.tar.gz
LegacyCamera-41a2e9735136f372de95652d0828600282c8e967.tar.bz2
Updates to allow using SurfaceTexture for reading the preview frames 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
Diffstat (limited to 'jni/mosaic_renderer_jni.h')
-rw-r--r--jni/mosaic_renderer_jni.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/jni/mosaic_renderer_jni.h b/jni/mosaic_renderer_jni.h
index ed4180f..c4ba500 100644
--- a/jni/mosaic_renderer_jni.h
+++ b/jni/mosaic_renderer_jni.h
@@ -9,15 +9,21 @@
const int PREVIEW_FBO_WIDTH_SCALE = 4;
const int PREVIEW_FBO_HEIGHT_SCALE = 2;
-extern "C" void AllocateTextureMemory(int width, int height);
+const int LR = 0; // Low-resolution mode
+const int HR = 1; // High-resolution mode
+const int NR = 2; // Number of resolution modes
+
+extern "C" void AllocateTextureMemory(int widthHR, int heightHR,
+ int widthLR, int heightLR);
extern "C" void FreeTextureMemory();
extern "C" void UpdateWarpTransformation(float *trs);
-extern unsigned char* gPreviewImageRGB;
-extern int gPreviewImageRGBWidth;
-extern int gPreviewImageRGBHeight;
+extern unsigned char* gPreviewImageRGB[NR];
+extern int gPreviewImageRGBWidth[NR];
+extern int gPreviewImageRGBHeight[NR];
extern sem_t gPreviewImageRGB_semaphore;
+extern sem_t gPreviewImageReady_semaphore;
extern double g_dAffinetrans[16];
extern double g_dAffinetransInv[16];