From c413f9c00c214bd8a529ecf28b85bbfd3bc8eee8 Mon Sep 17 00:00:00 2001 From: Tae-Young Chung Date: Tue, 29 Nov 2016 19:34:05 +0900 Subject: [PATCH] Eliminated unreachable codes Change-Id: Ib2d7cf5a226338c62996312e05569ec7ab71a989 Signed-off-by: Tae-Young Chung --- mv_face/face/src/mv_face_open.cpp | 47 --------------------------------------- packaging/capi-media-vision.spec | 2 +- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/mv_face/face/src/mv_face_open.cpp b/mv_face/face/src/mv_face_open.cpp index 292c10a..d340744 100644 --- a/mv_face/face/src/mv_face_open.cpp +++ b/mv_face/face/src/mv_face_open.cpp @@ -210,11 +210,6 @@ int mv_face_recognize_open( FaceRecognitionModel *pRecModel = static_cast(recognition_model); - if (!pRecModel) { - LOGE("Face recognition failed. Incorrect Media Vision Face recognition model handle is used"); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } - cv::Mat grayImage; int ret = convertSourceMV2GrayCV(source, grayImage); @@ -309,12 +304,6 @@ int mv_face_track_open( FaceTrackingModel *pTrackModel = static_cast(tracking_model); - if (!pTrackModel) { - LOGE("Face tracking failed. " - "Incorrect Media Vision Face tracking model handle is used"); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } - cv::Mat grayImage; int ret = convertSourceMV2GrayCV(source, grayImage); @@ -591,12 +580,6 @@ int mv_face_recognition_model_add_open( FaceRecognitionModel *pRecModel = static_cast(recognition_model); - if (!pRecModel) { - LOGE("Add face image example to the model failed. " - "Incorrect Media Vision Face recognition model handle is used"); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } - cv::Mat image; int ret = convertSourceMV2GrayCV(source, image); if (MEDIA_VISION_ERROR_NONE != ret) { @@ -637,12 +620,6 @@ int mv_face_recognition_model_reset_open( FaceRecognitionModel *pRecModel = static_cast(recognition_model); - if (!pRecModel) { - LOGE("Loading of the face recognition model from file failed. " - "Incorrect Media Vision Face recognition model handle is used"); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } - int ret = (NULL != face_label ? pRecModel->resetFaceExamples(*face_label) : pRecModel->resetFaceExamples()); @@ -668,12 +645,6 @@ int mv_face_recognition_model_learn_open( FaceRecognitionModel *pRecModel = static_cast(recognition_model); - if (!pRecModel) { - LOGE("Learning of the face recognition model failed. " - "Incorrect Media Vision Face recognition model handle is used"); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } - RecognitionParams recognitionParams; extractRecognitionParams(engine_cfg, recognitionParams); FaceRecognitionModelConfig learnConfig; @@ -709,12 +680,6 @@ int mv_face_recognition_model_query_labels_open( FaceRecognitionModel *pRecModel = static_cast(recognition_model); - if (!pRecModel) { - LOGE("Learning of the face recognition model failed. " - "Incorrect Media Vision Face recognition model handle is used"); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } - const std::set& learnedLabels = pRecModel->getFaceLabels(); *number_of_labels = learnedLabels.size(); @@ -789,12 +754,6 @@ int mv_face_tracking_model_prepare_open( FaceTrackingModel *pTrackModel = static_cast(tracking_model); - if (!pTrackModel) { - LOGE("Preparation of the face tracking model failed. " - "Incorrect Media Vision Face tracking model handle is used"); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } - cv::Mat image; int ret = convertSourceMV2GrayCV(source, image); if (MEDIA_VISION_ERROR_NONE != ret) { @@ -881,12 +840,6 @@ int mv_face_tracking_model_save_open( FaceTrackingModel *pTrackModel = static_cast(tracking_model); - if (!pTrackModel) { - LOGE("Saving of the face tracking model to file failed. " - "Incorrect Media Vision Face tracking model handle is used"); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } - const int ret = pTrackModel->save(std::string(file_name)); if (MEDIA_VISION_ERROR_NONE != ret) { diff --git a/packaging/capi-media-vision.spec b/packaging/capi-media-vision.spec index 3f8bf78..59c1217 100644 --- a/packaging/capi-media-vision.spec +++ b/packaging/capi-media-vision.spec @@ -1,6 +1,6 @@ Name: capi-media-vision Summary: Media Vision library for Tizen Native API -Version: 0.3.21 +Version: 0.3.22 Release: 1 Group: Multimedia/Framework License: Apache-2.0 and BSD-2.0 -- 2.7.4