[Sink] update example code
authorjy1210.jung <jy1210.jung@samsung.com>
Tue, 10 Jul 2018 07:59:39 +0000 (16:59 +0900)
committer함명주/동작제어Lab(SR)/Principal Engineer/삼성전자 <myungjoo.ham@samsung.com>
Tue, 10 Jul 2018 11:32:25 +0000 (20:32 +0900)
1. change to video live stream test.
2. remove unnecessary element in test pipeline.
3. fix doxygen error.

**Self evaluation:**
1. Build test: [*]Passed [ ]Failed [ ]Skipped
2. Run test: [*]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
nnstreamer_example/example_sink/nnstreamer_sink_example.c
nnstreamer_example/example_sink/nnstreamer_sink_example_play.c

index 2347739..cdb41ff 100644 (file)
@@ -4,6 +4,7 @@
  * @brief      Sample code for tensor sink plugin
  * @see                https://github.sec.samsung.net/STAR/nnstreamer
  * @author     Jaeyun Jung <jy1210.jung@samsung.com>
+ * @bug                No known bugs.
  *
  * Simple example to init tensor sink element and get data.
  *
@@ -225,6 +226,8 @@ int
 main (int argc, char **argv)
 {
   const guint num_buffers = 100;
+  const guint width = 640;
+  const guint height = 480;
 
   gchar *str_pipeline;
   gulong handle_id;
@@ -243,8 +246,9 @@ main (int argc, char **argv)
   /* 640x480 30fps for test */
   str_pipeline =
       g_strdup_printf
-      ("videotestsrc num-buffers=%d ! video/x-raw,width=640,height=480 ! videoconvert ! video/x-raw,format=RGB ! tensor_converter ! tensor_sink name=tensor_sink",
-      num_buffers);
+      ("videotestsrc num-buffers=%d ! video/x-raw,format=RGB,width=%d,height=%d ! "
+      "tensor_converter ! tensor_sink name=tensor_sink",
+      num_buffers, width, height);
   g_app_data.pipeline = gst_parse_launch (str_pipeline, NULL);
   g_free (str_pipeline);
   _check_cond_err (g_app_data.pipeline != NULL);
index bbaa2bf..e3b2c14 100644 (file)
@@ -4,6 +4,7 @@
  * @brief      Sample code for tensor sink plugin
  * @see                https://github.sec.samsung.net/STAR/nnstreamer
  * @author     Jaeyun Jung <jy1210.jung@samsung.com>
+ * @bug                No known bugs.
  *
  * This sample app shows video frame using two pipelines.
  *
@@ -235,7 +236,6 @@ _new_data_cb (GstElement * element, GstBuffer * buffer, gpointer user_data)
 int
 main (int argc, char **argv)
 {
-  const guint num_buffers = 200;
   const guint width = 640;
   const guint height = 480;
 
@@ -255,8 +255,8 @@ main (int argc, char **argv)
 
   str_pipeline =
       g_strdup_printf
-      ("videotestsrc num-buffers=%d ! video/x-raw,width=%d,height=%d ! videoconvert ! video/x-raw,format=RGB ! tensor_converter ! tensor_sink name=tensor_sink",
-      num_buffers, width, height);
+      ("videotestsrc is-live=TRUE ! video/x-raw,format=RGB,width=%d,height=%d ! "
+      "tensor_converter ! tensor_sink name=tensor_sink", width, height);
   g_app_data.data_pipeline = gst_parse_launch (str_pipeline, NULL);
   g_free (str_pipeline);
   _check_cond_err (g_app_data.data_pipeline != NULL);