author | jiyu.yang <jiyu.yang@amlogic.com> | 2014-01-09 13:26:20 (GMT) |
---|---|---|
committer | tao.dong <tao.dong@amlogic.com> | 2014-05-27 11:45:40 (GMT) |
commit | c098e2eca6cc877b73d94e8ca3cafde438139e56 (patch) | |
tree | 1ce8ec8a7543cc5fb98d7309b52d65d0dfdda978 | |
parent | a01de5dd648ee9095f3da3bfc4b0466271cd33f7 (diff) | |
download | camera-c098e2eca6cc877b73d94e8ca3cafde438139e56.zip camera-c098e2eca6cc877b73d94e8ca3cafde438139e56.tar.gz camera-c098e2eca6cc877b73d94e8ca3cafde438139e56.tar.bz2 |
PD#86091:fix kk compile error when only one cam
-rwxr-xr-x | V4LCameraAdapter/V4LCameraAdapter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/V4LCameraAdapter/V4LCameraAdapter.cpp b/V4LCameraAdapter/V4LCameraAdapter.cpp index a7e501d..9925e14 100755 --- a/V4LCameraAdapter/V4LCameraAdapter.cpp +++ b/V4LCameraAdapter/V4LCameraAdapter.cpp @@ -2433,9 +2433,10 @@ extern "C" int getValidFrameSize(int camera_fd, int pixel_format, char *framesiz return 0; } -static int getCameraOrientation(bool frontcamera, char* property) +static int getCameraOrientation(bool frontcamera, char* p) { int degree = -1; + char property[PROPERTY_VALUE_MAX]; if(frontcamera){ if (property_get("ro.camera.orientation.front", property, NULL) > 0){ degree = atoi(property); @@ -2448,6 +2449,8 @@ static int getCameraOrientation(bool frontcamera, char* property) if((degree != 0)&&(degree != 90) &&(degree != 180)&&(degree != 270)) degree = -1; + + memcpy( p, property, sizeof(property)); return degree; } @@ -2470,7 +2473,7 @@ static bool is_mjpeg_supported(int camera_fd) static void ParserLimitedRateInfo(LimitedRate_t* rate) { - char property[100]; + char property[PROPERTY_VALUE_MAX]; int w,h,r; char* pos = NULL; memset(property,0,sizeof(property)); @@ -2830,7 +2833,7 @@ extern "C" void loadCaps(int camera_id, CameraProperties::Properties* params) { //should changed while the screen orientation changed. int degree = -1; - char property[64]; + char property[PROPERTY_VALUE_MAX]; memset(property,0,sizeof(property)); if(bFrontCam == true) { params->set(CameraProperties::FACING_INDEX, ExCameraParameters::FACING_FRONT); |