[Filter/TF-Lite] make model path as const
authorHyoungjooAhn <hello.ahn@samsung.com>
Tue, 17 Jul 2018 10:27:18 +0000 (19:27 +0900)
committer함명주/동작제어Lab(SR)/Principal Engineer/삼성전자 <myungjoo.ham@samsung.com>
Tue, 17 Jul 2018 11:01:50 +0000 (20:01 +0900)
changing model path at tflite core is prevented by using const

Signed-off-by: HyoungjooAhn <hello.ahn@samsung.com>
gst/tensor_filter/tensor_filter_tensorflow_lite_core.cc
gst/tensor_filter/tensor_filter_tensorflow_lite_core.h

index 155d46a..b02fb50 100644 (file)
@@ -30,7 +30,7 @@
  * @note       the model of _model_path will be loaded simultaneously
  * @return     Nothing
  */
-TFLiteCore::TFLiteCore (char *_model_path)
+TFLiteCore::TFLiteCore (const char *_model_path)
 {
   model_path = _model_path;
   input_idx_list_len = 0;
@@ -207,7 +207,7 @@ TFLiteCore::invoke (uint8_t * inptr, uint8_t ** outptr)
  * @return     TFLiteCore class
  */
 extern void *
-tflite_core_new (char *_model_path)
+tflite_core_new (const char *_model_path)
 {
   return new TFLiteCore (_model_path);
 }
@@ -229,7 +229,7 @@ tflite_core_delete (void *tflite)
  * @param      tflite  : the class object
  * @return     model path
  */
-extern char *
+extern const char *
 tflite_core_getModelPath (void *tflite)
 {
   TFLiteCore *c = (TFLiteCore *) tflite;
index 299a4ef..9971c12 100644 (file)
@@ -41,14 +41,14 @@ public:
   /**
    * member functions.
    */
-  TFLiteCore (char *_model_path);
+  TFLiteCore (const char *_model_path);
    ~TFLiteCore ();
 
   /**
    * @brief    get the model path.
    * @return   saved model path.
    */
-  char *getModelPath ()
+  const char *getModelPath ()
   {
     return model_path;
   }
@@ -68,7 +68,7 @@ private:
   /**
    * member variables.
    */
-  char *model_path;
+  const char *model_path;
   int tensor_size;
   int node_size;
   int input_size;
@@ -88,9 +88,9 @@ extern "C"
 {
 #endif
 
-  extern void *tflite_core_new (char *_model_path);
+  extern void *tflite_core_new (const char *_model_path);
   extern void tflite_core_delete (void *tflite);
-  extern char *tflite_core_getModelPath (void *tflite);
+  extern const char *tflite_core_getModelPath (void *tflite);
   extern int tflite_core_getInputDim (void *tflite, int idx, int **dim,
       int *len);
   extern int tflite_core_getOutputDim (void *tflite, int idx, int **dim,