Change int CheckSupportedTargetDevice() to bool IsTargetDeviceSupported() and print... 79/263279/2
authorTae-Young Chung <ty83.chung@samsung.com>
Mon, 30 Aug 2021 12:25:11 +0000 (21:25 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Tue, 31 Aug 2021 00:01:21 +0000 (09:01 +0900)
Change-Id: I1f9e92634a09f1f93222762cea93f0d25a71aeee
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
mv_machine_learning/mv_inference/inference/include/Inference.h
mv_machine_learning/mv_inference/inference/src/Inference.cpp
mv_machine_learning/mv_inference/inference/src/mv_inference_open.cpp
packaging/capi-media-vision.spec

index 8f27975..3d961d8 100644 (file)
@@ -196,7 +196,7 @@ namespace inference
                 *
                 * @since_tizen 6.5
                 */
-               int CheckSupportedTargetDevice(const int targetDevices);
+               bool IsTargetDeviceSupported(const int targetDevices);
 
                /**
                 * @brief   Configure the maximum number of inference results
index 756176f..3db0155 100755 (executable)
@@ -588,14 +588,14 @@ namespace inference
                return MEDIA_VISION_ERROR_NONE;
        }
 
-       int Inference::CheckSupportedTargetDevice(const int targetDevices)
+       bool Inference::IsTargetDeviceSupported(const int targetDevices)
        {
                if (!(mBackendCapacity.supported_accel_devices & targetDevices)) {
-                       LOGE("Backend doesn't support a given %d device acceleration.", targetDevices);
-                       return MEDIA_VISION_ERROR_NOT_SUPPORTED;
+                       LOGE("Backend doesn't support a given %x device acceleration.", targetDevices);
+                       return false;
                }
 
-               return MEDIA_VISION_ERROR_NONE;
+               return true;
        }
 
        void Inference::ConfigureOutput(const int maxOutputNumbers)
index eeca357..6ceb6bd 100644 (file)
@@ -424,14 +424,13 @@ int mv_inference_configure_engine_open(mv_inference_h infer,
                LOGE("Fail to bind a backend engine.");
        }
 
-       if (pInfer->CheckSupportedTargetDevice(targetTypes) !=
-               MEDIA_VISION_ERROR_NONE) {
+       if (!pInfer->IsTargetDeviceSupported(targetTypes)) {
+               ret = MEDIA_VISION_ERROR_NOT_SUPPORTED;
                LOGE("Tried to configure invalid target types.");
-               goto _ERROR_;
        }
 
-       LOGI("LEAVE");
 _ERROR_:
+       LOGI("LEAVE");
        return ret;
 }
 
index 0109d12..61e7685 100644 (file)
@@ -1,7 +1,7 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
 Version:     0.8.12
-Release:     0
+Release:     1
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause
 Source0:     %{name}-%{version}.tar.gz