Merge branch 'tizen' into tizen_line_coverage 66/190566/1
authorJeongmo Yang <jm80.yang@samsung.com>
Thu, 4 Oct 2018 02:07:04 +0000 (11:07 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Thu, 4 Oct 2018 02:07:11 +0000 (11:07 +0900)
Change-Id: Ie1bdf0321e32a6cef46280583eb85a60266e3397
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
CMakeLists.txt
src/camera.c
src/camera_internal.c

index 3d55870..b367a0a 100644 (file)
@@ -27,7 +27,7 @@ FOREACH(flag ${${fw_name}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wextra -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wextra -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -fprofile-arcs -ftest-coverage")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 
 IF("${ARCH}" STREQUAL "arm")
index 28b1399..b2b566a 100644 (file)
@@ -741,6 +741,7 @@ int _camera_get_tbm_surface_format(int in_format, uint32_t *out_format)
        case MM_PIXEL_FORMAT_NV12T:
                *out_format = TBM_FORMAT_NV12;
                break;
+//LCOV_EXCL_START
        case MM_PIXEL_FORMAT_NV16:
                *out_format = TBM_FORMAT_NV16;
                break;
@@ -778,6 +779,7 @@ int _camera_get_tbm_surface_format(int in_format, uint32_t *out_format)
        default:
                LOGE("invalid in_format %d", in_format);
                return CAMERA_ERROR_INVALID_PARAMETER;
+//LCOV_EXCL_STOP
        }
 
        return CAMERA_ERROR_NONE;
@@ -798,6 +800,7 @@ int _camera_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mi
        case MM_PIXEL_FORMAT_NV12T:
                *mimetype = MEDIA_FORMAT_NV12;
                break;
+//LCOV_EXCL_START
        case MM_PIXEL_FORMAT_NV16:
                *mimetype = MEDIA_FORMAT_NV16;
                break;
@@ -835,6 +838,7 @@ int _camera_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mi
        default:
                LOGE("invalid in_format %d", in_format);
                return CAMERA_ERROR_INVALID_PARAMETER;
+//LCOV_EXCL_STOP
        }
 
        return CAMERA_ERROR_NONE;
@@ -863,6 +867,7 @@ static void _camera_preview_frame_create(camera_stream_data_s *stream, int num_b
        frame->num_of_planes = stream->num_planes;
 
        if (num_buffer_key == 0) {
+//LCOV_EXCL_START
                /* non-zero copy */
                if (!data_bo_handle || !data_bo_handle->ptr) {
                        LOGE("NULL pointer");
@@ -917,14 +922,17 @@ static void _camera_preview_frame_create(camera_stream_data_s *stream, int num_b
                                break;
                        }
                }
+//LCOV_EXCL_STOP
        } else {
                /* zero copy */
                switch (stream->num_planes) {
+//LCOV_EXCL_START
                case 1:
                        frame->data.single_plane.yuv = buffer_bo_handle[0].ptr;
                        frame->data.single_plane.size = stream->data.yuv420.length_yuv;
                        total_size = stream->data.yuv420.length_yuv;
                        break;
+//LCOV_EXCL_STOP
                case 2:
                        frame->data.double_plane.y = buffer_bo_handle[0].ptr;
                        if (stream->num_planes == (unsigned int)num_buffer_key)
@@ -937,6 +945,7 @@ static void _camera_preview_frame_create(camera_stream_data_s *stream, int num_b
                                stream->data.yuv420sp.length_uv;
                        break;
                case 3:
+//LCOV_EXCL_START
                        frame->data.triple_plane.y = buffer_bo_handle[0].ptr;
                        if (stream->num_planes == (unsigned int)num_buffer_key) {
                                frame->data.triple_plane.u = buffer_bo_handle[1].ptr;
@@ -952,6 +961,7 @@ static void _camera_preview_frame_create(camera_stream_data_s *stream, int num_b
                                stream->data.yuv420p.length_u + \
                                stream->data.yuv420p.length_v;
                        break;
+//LCOV_EXCL_STOP
                default:
                        break;
                }
@@ -1086,6 +1096,7 @@ static int _camera_media_packet_create(camera_cb_info_s *cb_info, camera_stream_
                                        tsurf_info.planes[1].offset = tsurf_info.planes[0].size;
                                tsurf_info.size = tsurf_info.planes[0].size + tsurf_info.planes[1].size;
                                break;
+//LCOV_EXCL_START
                        case TBM_FORMAT_YUV420:
                        case TBM_FORMAT_YVU420:
                                tsurf_info.planes[0].size = stream->stride[0] * stream->elevation[0];
@@ -1106,10 +1117,12 @@ static int _camera_media_packet_create(camera_cb_info_s *cb_info, camera_stream_
                                break;
                        default:
                                break;
+//LCOV_EXCL_STOP
                        }
 
                        tsurf = tbm_surface_internal_create_with_bos(&tsurf_info, buffer_bo, num_buffer_key);
                } else if (mp_data->data_bo) {
+//LCOV_EXCL_START
                        switch (bo_format) {
                        case TBM_FORMAT_NV12:
                        case TBM_FORMAT_NV21:
@@ -1140,6 +1153,7 @@ static int _camera_media_packet_create(camera_cb_info_s *cb_info, camera_stream_
                        }
 
                        tsurf = tbm_surface_internal_create_with_bos(&tsurf_info, &mp_data->data_bo, 1);
+//LCOV_EXCL_STOP
                }
                /*LOGD("tbm surface %p", tsurf);*/
        }
@@ -1325,6 +1339,7 @@ static void _camera_client_user_callback(camera_cb_info_s *cb_info, char *recv_m
        case MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW:
                __camera_event_handler_preview(cb_info, recv_msg);
                break;
+//LCOV_EXCL_START
        case MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS:
                {
                        int percent = 0;
@@ -1383,6 +1398,7 @@ static void _camera_client_user_callback(camera_cb_info_s *cb_info, char *recv_m
                                (camera_state_e)current_state, cb_info->user_data[event]);
                }
                break;
+//LCOV_EXCL_STOP
        case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
                /* fall through */
        case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
@@ -1423,6 +1439,7 @@ static void _camera_client_user_callback(camera_cb_info_s *cb_info, char *recv_m
                /* fall through */
        case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
                /* fall through */
+//LCOV_EXCL_START
        case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
                /* fall through */
        case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PTZ_TYPE:
@@ -1436,6 +1453,7 @@ static void _camera_client_user_callback(camera_cb_info_s *cb_info, char *recv_m
                        LOGW("stop foreach callback for event %d", event);
                }
                break;
+//LCOV_EXCL_STOP
        case MUSE_CAMERA_EVENT_TYPE_CAPTURE:
                __camera_event_handler_capture(cb_info, recv_msg);
                break;
@@ -2166,7 +2184,7 @@ static camera_cb_info_s *_camera_client_callback_new(gint sockfd)
        cb_info->is_server_connected = TRUE;
 
        return cb_info;
-
+//LCOV_EXCL_START
 ErrorExit:
        if (cb_info) {
                __destroy_msg_handler_thread(&cb_info->msg_handler_info);
@@ -2191,6 +2209,7 @@ ErrorExit:
        }
 
        return NULL;
+//LCOV_EXCL_STOP
 }
 
 static void _camera_client_callback_destroy(camera_cb_info_s *cb_info)
@@ -2251,7 +2270,7 @@ static void _camera_client_callback_destroy(camera_cb_info_s *cb_info)
        return;
 }
 
-
+//LCOV_EXCL_START
 int _camera_start_evas_rendering(camera_h camera)
 {
        camera_cli_s *pc = (camera_cli_s *)camera;
@@ -2305,7 +2324,7 @@ int _camera_stop_evas_rendering(camera_h camera, bool keep_screen)
 
        return ret;
 }
-
+//LCOV_EXCL_STOP
 
 int _camera_independent_request(int api, int device_type, const char *key, int *value)
 {
@@ -2492,7 +2511,7 @@ int camera_create(camera_device_e device, camera_h *camera)
        }
 
        return ret;
-
+//LCOV_EXCL_START
 ErrorExit:
        if (bufmgr) {
                tbm_bufmgr_deinit(bufmgr);
@@ -2526,6 +2545,7 @@ ErrorExit:
        LOGE("camera create error : 0x%x", ret);
 
        return ret;
+//LCOV_EXCL_STOP
 }
 
 
@@ -2641,6 +2661,7 @@ int camera_stop_preview(camera_h camera)
 
        LOGD("Enter");
 
+//LCOV_EXCL_START
        if (CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
                ret = camera_get_state(camera, &current_state);
                if (ret != CAMERA_ERROR_NONE) {
@@ -2654,7 +2675,7 @@ int camera_stop_preview(camera_h camera)
                                return ret;
                }
        }
-
+//LCOV_EXCL_STOP
        /* send stop preview message */
        _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
@@ -3056,6 +3077,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
                }
 
                if (type == CAMERA_DISPLAY_TYPE_EVAS) {
+//LCOV_EXCL_START
                        camera_flip_e flip = CAMERA_FLIP_NONE;
                        camera_display_mode_e mode = CAMERA_DISPLAY_MODE_LETTER_BOX;
                        camera_rotation_e rotation = CAMERA_ROTATION_NONE;
@@ -3081,6 +3103,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
 
                        if (mode == CAMERA_DISPLAY_MODE_CUSTOM_ROI)
                                ret |= mm_display_interface_evas_set_roi_area(cb_info->dp_interface, x, y, width, height);
+//LCOV_EXCL_STOP
                }
        }
 
index ac76cfd..ebc96d2 100644 (file)
@@ -29,7 +29,7 @@
 #endif
 #define LOG_TAG "TIZEN_N_CAMERA"
 
-
+//LCOV_EXCL_START
 int camera_start_evas_rendering(camera_h camera)
 {
        return _camera_start_evas_rendering(camera);
@@ -39,3 +39,4 @@ int camera_stop_evas_rendering(camera_h camera, bool keep_screen)
 {
        return _camera_stop_evas_rendering(camera, keep_screen);
 }
+//LCOV_EXCL_STOP