aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWind Yuan <feng.yuan@intel.com>2018-01-04 07:43:57 -0500
committerwindyuan <feng.yuan@intel.com>2018-01-04 14:45:04 +0800
commitafa54115907d1a8ab2da4c8cf9907c66fee46e35 (patch)
treebd4230fee192637fc0961b8be38000f9a5068b51
parent8cca30f47e6c2d5006368a241bcba271abf157f9 (diff)
downloadlibxcam-afa54115907d1a8ab2da4c8cf9907c66fee46e35.tar.gz
compile: fix warnings of unused variables
Signed-off-by: Wind Yuan <feng.yuan@intel.com>
-rw-r--r--modules/ocl/cl_fisheye_handler.cpp2
-rw-r--r--modules/ocl/cl_image_handler.cpp2
-rw-r--r--modules/ocl/cl_kernel.cpp1
-rw-r--r--modules/ocl/cl_pyramid_blender.cpp29
-rw-r--r--modules/ocl/cl_utils.cpp6
-rw-r--r--modules/ocl/cl_video_stabilizer.cpp1
-rw-r--r--modules/ocl/cv_feature_match.cpp5
-rw-r--r--modules/soft/cv_capi_feature_match.cpp5
-rw-r--r--modules/soft/soft_geo_mapper.cpp1
-rw-r--r--modules/soft/soft_stitcher.cpp1
-rw-r--r--xcore/image_processor.cpp2
11 files changed, 37 insertions, 18 deletions
diff --git a/modules/ocl/cl_fisheye_handler.cpp b/modules/ocl/cl_fisheye_handler.cpp
index 93b62a5..a7866c5 100644
--- a/modules/ocl/cl_fisheye_handler.cpp
+++ b/modules/ocl/cl_fisheye_handler.cpp
@@ -393,7 +393,7 @@ CLFisheyeHandler::generate_fisheye_table (
size_t row_pitch;
size_t slice_pitch;
XCamReturn ret = _geo_table->enqueue_map ((void *&)map_ptr, origin, region, &row_pitch, &slice_pitch, CL_MAP_WRITE);
- XCAM_ASSERT (ret == XCAM_RETURN_NO_ERROR);
+ XCAM_FAIL_RETURN (ERROR, xcam_ret_is_ok (ret), ret, "CLFisheyeHandler mesh table failed in enqueue_map");
for (uint32_t row = 0; row < table_height; row++) {
for(uint32_t col = 0; col < table_width; col++) {
diff --git a/modules/ocl/cl_image_handler.cpp b/modules/ocl/cl_image_handler.cpp
index c359bcd..f9fc56c 100644
--- a/modules/ocl/cl_image_handler.cpp
+++ b/modules/ocl/cl_image_handler.cpp
@@ -230,6 +230,8 @@ XCamReturn CLImageHandler::prepare_buffer_pool_video_info (
XCamReturn
CLImageHandler::prepare_parameters (SmartPtr<VideoBuffer> &input, SmartPtr<VideoBuffer> &output)
{
+ XCAM_UNUSED (input);
+ XCAM_UNUSED (output);
XCAM_ASSERT (input.ptr () && output.ptr ());
return XCAM_RETURN_NO_ERROR;
}
diff --git a/modules/ocl/cl_kernel.cpp b/modules/ocl/cl_kernel.cpp
index 62dfcb7..fdda8ec 100644
--- a/modules/ocl/cl_kernel.cpp
+++ b/modules/ocl/cl_kernel.cpp
@@ -433,6 +433,7 @@ CLKernel::event_notify (cl_event event, cl_int status, void* data)
KernelUserData *kernel_data = (KernelUserData *)data;
XCAM_ASSERT (event == kernel_data->event->get_event_id ());
XCAM_UNUSED (status);
+ XCAM_UNUSED (event);
delete kernel_data;
}
diff --git a/modules/ocl/cl_pyramid_blender.cpp b/modules/ocl/cl_pyramid_blender.cpp
index c0f4dce..d42fdcf 100644
--- a/modules/ocl/cl_pyramid_blender.cpp
+++ b/modules/ocl/cl_pyramid_blender.cpp
@@ -353,7 +353,7 @@ PyramidLayer::bind_buf_to_layer0 (
cl_desc.width = XCAM_ALIGN_UP (this->blend_width, XCAM_CL_BLENDER_ALIGNMENT_X) / 8;
cl_desc.height = XCAM_ALIGN_UP (this->blend_height, divider_vert[i_plane]) / divider_vert[i_plane];
uint32_t row_pitch = CLImage::calculate_pixel_bytes (cl_desc.format) *
- XCAM_ALIGN_UP (cl_desc.width, XCAM_CL_IMAGE_ALIGNMENT_X);
+ XCAM_ALIGN_UP (cl_desc.width, XCAM_CL_IMAGE_ALIGNMENT_X);
uint32_t size = row_pitch * cl_desc.height;
SmartPtr<CLBuffer> cl_buf = new CLBuffer (context, size);
XCAM_ASSERT (cl_buf.ptr () && cl_buf->is_valid ());
@@ -379,7 +379,11 @@ PyramidLayer::init_layer0 (SmartPtr<CLContext> context, bool last_layer, bool ne
this->blend_mask[0] = new CLBuffer(context, mask_size);
float *blend_ptr = NULL;
XCamReturn ret = this->blend_mask[0]->enqueue_map((void*&)blend_ptr, 0, mask_size);
- XCAM_ASSERT (ret == XCAM_RETURN_NO_ERROR);
+ if (!xcam_ret_is_ok (ret)) {
+ XCAM_LOG_ERROR ("PyramidLayer init layer0 failed in blend_mask mem_map");
+ return;
+ }
+
for (uint32_t i_ptr = 0; i_ptr < this->mask_width[0]; ++i_ptr) {
if (i_ptr <= this->mask_width[0] / 2)
blend_ptr[i_ptr] = 1.0f;
@@ -438,7 +442,7 @@ PyramidLayer::build_cl_images (SmartPtr<CLContext> context, bool last_layer, boo
//gauss y image created by cl buffer
row_pitch = CLImage::calculate_pixel_bytes (cl_desc_set.format) *
- XCAM_ALIGN_UP (cl_desc_set.width, XCAM_CL_IMAGE_ALIGNMENT_X);
+ XCAM_ALIGN_UP (cl_desc_set.width, XCAM_CL_IMAGE_ALIGNMENT_X);
size = row_pitch * cl_desc_set.height;
cl_buf = new CLBuffer (context, size);
XCAM_ASSERT (cl_buf.ptr () && cl_buf->is_valid ());
@@ -451,7 +455,7 @@ PyramidLayer::build_cl_images (SmartPtr<CLContext> context, bool last_layer, boo
cl_desc_set.width = XCAM_ALIGN_UP (this->blend_width, XCAM_CL_BLENDER_ALIGNMENT_X) / 8;
cl_desc_set.height = XCAM_ALIGN_UP (this->blend_height, divider_vert[plane]) / divider_vert[plane];
row_pitch = CLImage::calculate_pixel_bytes (cl_desc_set.format) *
- XCAM_ALIGN_UP (cl_desc_set.width, XCAM_CL_IMAGE_ALIGNMENT_X);
+ XCAM_ALIGN_UP (cl_desc_set.width, XCAM_CL_IMAGE_ALIGNMENT_X);
size = row_pitch * cl_desc_set.height;
cl_buf = new CLBuffer (context, size);
XCAM_ASSERT (cl_buf.ptr () && cl_buf->is_valid ());
@@ -491,9 +495,9 @@ PyramidLayer::copy_mask_from_y_to_uv (SmartPtr<CLContext> &context)
float *from_ptr = NULL;
float *to_ptr = NULL;
ret = this->blend_mask[1]->enqueue_map ((void*&)to_ptr, 0, this->mask_width[1] * sizeof(float));
- XCAM_ASSERT (ret == XCAM_RETURN_NO_ERROR);
+ XCAM_FAIL_RETURN (ERROR, xcam_ret_is_ok (ret), false, "PyramidLayer copy mask failed in blend_mask[1] mem_map");
ret = this->blend_mask[0]->enqueue_map((void*&)from_ptr, 0, this->mask_width[0] * sizeof(float));
- XCAM_ASSERT (ret == XCAM_RETURN_NO_ERROR);
+ XCAM_FAIL_RETURN (ERROR, xcam_ret_is_ok (ret), false, "PyramidLayer copy mask failed in blend_mask[0] mem_map");
for (int i = 0; i < (int)this->mask_width[1]; ++i) {
if (i * 2 + 1 >= (int)this->mask_width[0]) { // todo i* 2 + 1
@@ -532,7 +536,10 @@ CLPyramidBlender::dump_layer_mask (uint32_t layer, bool is_uv)
float *mask_ptr = NULL;
XCamReturn ret = pyr_layer.blend_mask[plane]->enqueue_map ((void*&)mask_ptr, 0, pyr_layer.mask_width[plane] * sizeof(float));
- XCAM_ASSERT (ret == XCAM_RETURN_NO_ERROR);
+ if (!xcam_ret_is_ok (ret)) {
+ XCAM_LOG_ERROR ("CLPyramidBlender dump mask failed in blend_mask(layer:%d) mem_map", layer);
+ return;
+ }
printf ("layer(%d)(-%s) mask, width:%d\n", layer, (is_uv ? "UV" : "Y"), pyr_layer.mask_width[plane]);
for (uint32_t i = 0; i < pyr_layer.mask_width[plane]; ++i) {
@@ -560,10 +567,10 @@ gauss_fill_mask (
XCAM_ASSERT (to.blend_mask[0].ptr ());
float *mask0_ptr = NULL;
ret = to.blend_mask[0]->enqueue_map((void*&)mask0_ptr, 0, mask_size);
- XCAM_ASSERT (ret == XCAM_RETURN_NO_ERROR);
+ XCAM_FAIL_RETURN (ERROR, xcam_ret_is_ok (ret), false, "gauss_fill_mask failed in destination image mem_map");
ret = prev.blend_mask[0]->enqueue_map((void*&)pre_ptr, 0, prev_size);
- XCAM_ASSERT (ret == XCAM_RETURN_NO_ERROR);
+ XCAM_FAIL_RETURN (ERROR, xcam_ret_is_ok (ret), false, "gauss_fill_mask failed in source image mem_map");
for (i = 0; i < (int)to.blend_width; ++i) {
if (i * 2 + 1 >= (int)prev.mask_width[0]) { // todo i* 2 + 1
@@ -659,7 +666,7 @@ CLPyramidBlender::init_seam_buffers (SmartPtr<CLContext> context)
cl_desc.width = _seam_width / 8;
cl_desc.height = _seam_height;
cl_desc.row_pitch = CLImage::calculate_pixel_bytes (cl_desc.format) *
- XCAM_ALIGN_UP (cl_desc.width, XCAM_CL_IMAGE_ALIGNMENT_X);
+ XCAM_ALIGN_UP (cl_desc.width, XCAM_CL_IMAGE_ALIGNMENT_X);
uint32_t image_diff_size = cl_desc.row_pitch * _seam_height;
SmartPtr<CLBuffer> cl_diff_buf = new CLBuffer (context, image_diff_size);
@@ -695,7 +702,7 @@ CLPyramidBlender::init_seam_buffers (SmartPtr<CLContext> context)
cl_desc.width = mask_width / 8;
cl_desc.height = mask_height;
cl_desc.row_pitch = CLImage::calculate_pixel_bytes (cl_desc.format) *
- XCAM_ALIGN_UP (cl_desc.width, XCAM_CL_IMAGE_ALIGNMENT_X);
+ XCAM_ALIGN_UP (cl_desc.width, XCAM_CL_IMAGE_ALIGNMENT_X);
uint32_t mask_size = cl_desc.row_pitch * mask_height;
SmartPtr<CLBuffer> cl_buf0 = new CLBuffer (context, mask_size);
diff --git a/modules/ocl/cl_utils.cpp b/modules/ocl/cl_utils.cpp
index 55b59f5..b8ce3a9 100644
--- a/modules/ocl/cl_utils.cpp
+++ b/modules/ocl/cl_utils.cpp
@@ -60,7 +60,7 @@ dump_image (SmartPtr<CLImage> image, const char *file_name)
size_t slice_pitch;
XCamReturn ret = image->enqueue_map (ptr, origin, region, &row_pitch, &slice_pitch, CL_MAP_READ);
- XCAM_ASSERT (ret == XCAM_RETURN_NO_ERROR);
+ XCAM_FAIL_RETURN (ERROR, xcam_ret_is_ok (ret), false, "dump image failed in enqueue_map");
XCAM_ASSERT (ptr);
XCAM_ASSERT (row_pitch == desc.row_pitch);
uint8_t *buf_start = (uint8_t *)ptr;
@@ -156,7 +156,9 @@ convert_nv12_mem_to_video_buffer (
VideoBufferPlanarInfo planar;
const VideoBufferInfo info = buf->get_video_info ();
- XCAM_ASSERT ((width == info.width) && (height == info.height));
+ XCAM_FAIL_RETURN (
+ DEBUG, (width == info.width) && (height == info.height), XCAM_RETURN_ERROR_PARAM,
+ "convert mem to video buffer failed since image sizes are not matched.");
uint8_t *out_mem = buf->map ();
XCAM_FAIL_RETURN (ERROR, out_mem, XCAM_RETURN_ERROR_MEM, "map buffer failed");
diff --git a/modules/ocl/cl_video_stabilizer.cpp b/modules/ocl/cl_video_stabilizer.cpp
index 66deadf..73b92fe 100644
--- a/modules/ocl/cl_video_stabilizer.cpp
+++ b/modules/ocl/cl_video_stabilizer.cpp
@@ -109,6 +109,7 @@ CLVideoStabilizer::prepare_parameters (SmartPtr<VideoBuffer> &input, SmartPtr<Vi
{
XCamReturn ret = XCAM_RETURN_NO_ERROR;
XCAM_ASSERT (input.ptr () && output.ptr ());
+ XCAM_UNUSED (output);
if (_input_buf_list.size () >= 2 * _filter_radius + 1) {
_input_buf_list.pop_front ();
diff --git a/modules/ocl/cv_feature_match.cpp b/modules/ocl/cv_feature_match.cpp
index d670446..e4e2ea8 100644
--- a/modules/ocl/cv_feature_match.cpp
+++ b/modules/ocl/cv_feature_match.cpp
@@ -121,12 +121,13 @@ CVFeatureMatch::calc_of_match (
{
cv::_InputOutputArray debug_img;
cv::Size img0_size = image0.size ();
- cv::Size img1_size = image1.size ();
- XCAM_ASSERT (img0_size.height == img1_size.height);
+ XCAM_ASSERT (img0_size.height == image1.rows ());
+ XCAM_UNUSED (image1);
#if XCAM_CV_FM_DEBUG
cv::Mat mat;
cv::UMat umat;
+ cv::Size img1_size = image1.size ();
cv::Size size (img0_size.width + img1_size.width, img0_size.height);
if (image0.isUMat ()) {
diff --git a/modules/soft/cv_capi_feature_match.cpp b/modules/soft/cv_capi_feature_match.cpp
index c4a38ac..0e0081c 100644
--- a/modules/soft/cv_capi_feature_match.cpp
+++ b/modules/soft/cv_capi_feature_match.cpp
@@ -134,8 +134,8 @@ CVCapiFeatureMatch::calc_of_match (
{
CvMat debug_image;
CvSize img0_size = cvSize(((CvMat*)image0)->width, ((CvMat*)image0)->height);
- CvSize img1_size = cvSize(((CvMat*)image1)->width, ((CvMat*)image1)->height);
- XCAM_ASSERT (img0_size.height == img1_size.height);
+ XCAM_ASSERT (img0_size.height == ((CvMat*)image1)->height);
+ XCAM_UNUSED (image1);
std::vector<float> offsets;
float offset_sum = 0.0f;
@@ -144,6 +144,7 @@ CVCapiFeatureMatch::calc_of_match (
offsets.reserve (corner0.size ());
#if XCAM_CV_CAPI_FM_DEBUG
+ CvSize img1_size = cvSize(((CvMat*)image1)->width, ((CvMat*)image1)->height);
cv::Mat mat;
mat.create (img0_size.height, img0_size.width + img1_size.width, ((CvMat*)image0)->type);
debug_image = cvMat (img0_size.height, img0_size.width + img1_size.width, ((CvMat*)image0)->type, mat.ptr());
diff --git a/modules/soft/soft_geo_mapper.cpp b/modules/soft/soft_geo_mapper.cpp
index 88ee870..478b025 100644
--- a/modules/soft/soft_geo_mapper.cpp
+++ b/modules/soft/soft_geo_mapper.cpp
@@ -178,6 +178,7 @@ void
SoftGeoMapper::remap_task_done (
const SmartPtr<Worker> &worker, const SmartPtr<Worker::Arguments> &base, const XCamReturn error)
{
+ XCAM_UNUSED (worker);
XCAM_ASSERT (worker.ptr () == _map_task.ptr ());
SmartPtr<XCamSoftTasks::GeoMapTask::Args> args = base.dynamic_cast_ptr<XCamSoftTasks::GeoMapTask::Args> ();
XCAM_ASSERT (args.ptr ());
diff --git a/modules/soft/soft_stitcher.cpp b/modules/soft/soft_stitcher.cpp
index 895597a..c345dcd 100644
--- a/modules/soft/soft_stitcher.cpp
+++ b/modules/soft/soft_stitcher.cpp
@@ -843,6 +843,7 @@ SoftStitcher::copy_task_done (
const SmartPtr<Worker::Arguments> &base,
const XCamReturn error)
{
+ XCAM_UNUSED (worker);
XCAM_ASSERT (worker.ptr ());
SmartPtr<SoftSitcherPriv::StitcherCopyArgs> args = base.dynamic_cast_ptr<SoftSitcherPriv::StitcherCopyArgs> ();
XCAM_ASSERT (args.ptr ());
diff --git a/xcore/image_processor.cpp b/xcore/image_processor.cpp
index f9914d2..928cbcc 100644
--- a/xcore/image_processor.cpp
+++ b/xcore/image_processor.cpp
@@ -25,6 +25,7 @@ namespace XCam {
void
ImageProcessCallback::process_buffer_done (ImageProcessor *processor, const SmartPtr<VideoBuffer> &buf) {
+ XCAM_UNUSED (processor);
XCAM_ASSERT (buf.ptr() && processor);
int64_t ts = buf->get_timestamp();
@@ -51,6 +52,7 @@ ImageProcessCallback::process_buffer_failed (ImageProcessor *processor, const Sm
void
ImageProcessCallback::process_image_result_done (ImageProcessor *processor, const SmartPtr<X3aResult> &result)
{
+ XCAM_UNUSED (processor);
XCAM_ASSERT (result.ptr() && processor);
int64_t ts = result->get_timestamp();