camera_test.h revision c322989ae6ff6769490828de1b5eda12b749cce9
1#ifndef CAMERA_TEST_H 2#define CAMERA_TEST_H 3 4#define PRINTOVER(arg...) LOGD(#arg) 5#define LOG_FUNCTION_NAME LOGD("%d: %s() ENTER", __LINE__, __FUNCTION__); 6#define LOG_FUNCTION_NAME_EXIT LOGD("%d: %s() EXIT", __LINE__, __FUNCTION__); 7#define KEY_GBCE "gbce" 8#define KEY_CAMERA "camera-index" 9#define KEY_SATURATION "saturation" 10#define KEY_BRIGHTNESS "brightness" 11#define KEY_BURST "burst-capture" 12#define KEY_EXPOSURE "exposure" 13#define KEY_CONTRAST "contrast" 14#define KEY_SHARPNESS "sharpness" 15#define KEY_ISO "iso" 16#define KEY_CAF "caf" 17#define KEY_MODE "mode" 18#define KEY_VNF "vnf" 19#define KEY_VSTAB "vstab" 20#define KEY_COMPENSATION "exposure-compensation" 21 22#if defined(OMAP_ENHANCEMENT) && defined(TARGET_OMAP3) 23#define KEY_IPP "ippMode" 24#else 25#define KEY_IPP "ipp" 26#endif 27 28#define KEY_BUFF_STARV "buff-starvation" 29#define KEY_METERING_MODE "meter-mode" 30#define KEY_AUTOCONVERGENCE "auto-convergence" 31#define KEY_MANUALCONVERGENCE_VALUES "manual-convergence-values" 32#define AUTOCONVERGENCE_MODE_MANUAL "mode-manual" 33#define KEY_EXP_BRACKETING_RANGE "exp-bracketing-range" 34#define KEY_TEMP_BRACKETING "temporal-bracketing" 35#define KEY_TEMP_BRACKETING_POS "temporal-bracketing-range-positive" 36#define KEY_TEMP_BRACKETING_NEG "temporal-bracketing-range-negative" 37#define KEY_MEASUREMENT "measurement" 38#define KEY_S3D2D_PREVIEW_MODE "s3d2d-preview" 39#define KEY_STEREO_CAMERA "s3d-supported" 40#define KEY_EXIF_MODEL "exif-model" 41#define KEY_EXIF_MAKE "exif-make" 42 43#define KEY_AUTO_EXPOSURE_LOCK "auto-exposure-lock" 44#define KEY_AUTO_WHITEBALANCE_LOCK "auto-whitebalance-lock" 45 46#define SDCARD_PATH "/sdcard/" 47 48#define MAX_BURST 15 49#define BURST_INC 5 50#define TEMP_BRACKETING_MAX_RANGE 4 51 52#define MEDIASERVER_DUMP "procmem -w $(ps | grep mediaserver | grep -Eo '[0-9]+' | head -n 1) | grep \"\\(Name\\|libcamera.so\\|libOMX\\|libomxcameraadapter.so\\|librcm.so\\|libnotify.so\\|libipcutils.so\\|libipc.so\\|libsysmgr.so\\|TOTAL\\)\"" 53#define MEMORY_DUMP "procrank -u" 54#define KEY_METERING_MODE "meter-mode" 55 56#define TEST_FOCUS_AREA "(0,0,1000,1000,300),(-1000,-1000,1000,1000,300),(0,0,0,0,0)" 57 58#define COMPENSATION_OFFSET 20 59#define DELIMITER "|" 60 61#define MAX_PREVIEW_SURFACE_WIDTH 800 62#define MAX_PREVIEW_SURFACE_HEIGHT 480 63 64#define MODEL "camera_test" 65#define MAKE "camera_test" 66 67#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 68 69namespace android { 70 class CameraHandler: public CameraListener { 71 public: 72 virtual void notify(int32_t msgType, int32_t ext1, int32_t ext2); 73 virtual void postData(int32_t msgType, 74 const sp<IMemory>& dataPtr, 75 camera_frame_metadata_t *metadata); 76 77 virtual void postDataTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr); 78 }; 79 80}; 81 82using namespace android; 83 84char * get_cycle_cmd(const char *aSrc); 85int execute_functional_script(char *script); 86status_t dump_mem_status(); 87int openCamera(); 88int closeCamera(); 89void initDefaults(); 90int startPreview(); 91void stopPreview(); 92int startRecording(); 93int stopRecording(); 94int closeRecorder(); 95int openRecorder(); 96int configureRecorder(); 97void printSupportedParams(); 98char *load_script(char *config); 99int start_logging(char *config, int &pid); 100int stop_logging(int &pid); 101int execute_error_script(char *script); 102 103typedef struct pixel_format_t { 104 int32_t pixelFormatDesc; 105 const char *pixformat; 106}pixel_format; 107 108typedef struct output_format_t { 109 output_format type; 110 const char *desc; 111} outformat; 112 113typedef struct preview_size_t { 114 int width, height; 115 const char *desc; 116} preview_size; 117 118typedef struct Vcapture_size_t { 119 int width, height; 120 const char *desc; 121} Vcapture_size; 122 123typedef struct capture_Size_t { 124 int width, height; 125 const char *name; 126} capture_Size; 127 128typedef struct video_Codecs_t { 129 video_encoder type; 130 const char *desc; 131} video_Codecs; 132 133typedef struct audio_Codecs_t { 134 audio_encoder type; 135 const char *desc; 136} audio_Codecs; 137 138typedef struct V_bitRate_t { 139 uint32_t bit_rate; 140 const char *desc; 141} V_bitRate; 142 143typedef struct zoom_t { 144 int idx; 145 const char *zoom_description; 146} Zoom; 147 148typedef struct fps_ranges_t { 149 const char *range; 150 const char *rangeDescription; 151} fps_ranges; 152 153typedef struct fpsConst_Ranges_t { 154 const char *range; 155 const char *rangeDescription; 156 int constFramerate; 157} fpsConst_Ranges; 158 159typedef struct fpsConst_RangesSec_t { 160 const char *range; 161 const char *rangeDescription; 162 int constFramerate; 163} fpsConst_RangesSec; 164 165#endif 166