From f3f384a23d7701e8c767945f1af07fc1815fe2b2 Mon Sep 17 00:00:00 2001 From: "jy1210.jung" Date: Tue, 10 Jul 2018 16:59:39 +0900 Subject: [PATCH] [Sink] update example code 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 --- nnstreamer_example/example_sink/nnstreamer_sink_example.c | 8 ++++++-- nnstreamer_example/example_sink/nnstreamer_sink_example_play.c | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/nnstreamer_example/example_sink/nnstreamer_sink_example.c b/nnstreamer_example/example_sink/nnstreamer_sink_example.c index 2347739..cdb41ff 100644 --- a/nnstreamer_example/example_sink/nnstreamer_sink_example.c +++ b/nnstreamer_example/example_sink/nnstreamer_sink_example.c @@ -4,6 +4,7 @@ * @brief Sample code for tensor sink plugin * @see https://github.sec.samsung.net/STAR/nnstreamer * @author Jaeyun Jung + * @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); diff --git a/nnstreamer_example/example_sink/nnstreamer_sink_example_play.c b/nnstreamer_example/example_sink/nnstreamer_sink_example_play.c index bbaa2bf..e3b2c14 100644 --- a/nnstreamer_example/example_sink/nnstreamer_sink_example_play.c +++ b/nnstreamer_example/example_sink/nnstreamer_sink_example_play.c @@ -4,6 +4,7 @@ * @brief Sample code for tensor sink plugin * @see https://github.sec.samsung.net/STAR/nnstreamer * @author Jaeyun Jung + * @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); -- 2.7.4