[C-API] appsink function in old version
authorJaeyun <jy1210.jung@samsung.com>
Fri, 14 Jun 2019 11:37:17 +0000 (20:37 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Thu, 27 Jun 2019 02:24:12 +0000 (11:24 +0900)
gst_app_sink_try_pull_sample is available at ver 1.10.
check minor version and get buffer from appsink with gst_app_sink_pull_sample.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
api/capi/src/nnstreamer-capi-single.c

index 954d8e2..8416a7d 100644 (file)
@@ -333,8 +333,14 @@ ml_single_inference (ml_single_h single,
   }
 
   /* Try to get the result */
+#if (GST_VERSION_MAJOR > 1 || (GST_VERSION_MAJOR == 1 && GST_VERSION_MINOR >= 10))
+  /* gst_app_sink_try_pull_sample() is available at gstreamer-1.10 */
   sample =
       gst_app_sink_try_pull_sample (GST_APP_SINK (single_h->sink), GST_SECOND);
+#else
+  sample = gst_app_sink_pull_sample (GST_APP_SINK (single_h->sink));
+#endif
+
   if (!sample) {
     ml_loge ("Failed to get the result from sink element.");
     status = ML_ERROR_TIMED_OUT;