[Filter/MvNCSDK] Revise error handling for unsupported API version
authorWook Song <wook16.song@samsung.com>
Wed, 29 Jan 2020 02:36:07 +0000 (11:36 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 4 Feb 2020 09:32:58 +0000 (01:32 -0800)
This patch revises the error handling mechanism for the API version of
MvNCSDK not supported by NNStreamer.

Signed-off-by: Wook Song <wook16.song@samsung.com>
ext/nnstreamer/tensor_filter/tensor_filter_movidius_ncsdk2.c

index 79c3135..efe6416 100644 (file)
@@ -117,11 +117,15 @@ _mvncsdk2_open (const GstTensorFilterProperties * prop, void **private_data)
 
   /* 0. Check the API version */
   ret_code = ncGlobalGetOption (NC_RO_API_VERSION, sdk_ver, &size_sdk_ver);
-  if ((ret_code != NC_OK) && (sdk_ver[0] != NNS_MVNCSDK2_SUPPORT_API_MAJOR_VER)) {
+  if ((ret_code == NC_OK) && (sdk_ver[0] != NNS_MVNCSDK2_SUPPORT_API_MAJOR_VER)) {
     g_printerr
         ("The major version number of the MVNCSDK API should be %d, not %d\n",
         NNS_MVNCSDK2_SUPPORT_API_MAJOR_VER, sdk_ver[0]);
     return -1;
+  } else if (ret_code != NC_OK) {
+    g_printerr
+        ("Failed to get the information about the version of the MVNCSDK API\n");
+    return -1;
   }
 
   /**