From 9c2adfca434c73867f5a59236b3c1e0debb16e5f Mon Sep 17 00:00:00 2001 From: Parichay Kapoor Date: Thu, 7 Mar 2019 16:54:55 +0900 Subject: [PATCH] [IIO] Handling queries Handling scheduling query and remaining queries handled with basesrc class All events are handled by basesrc class Signed-off-by: Parichay Kapoor --- gst/nnstreamer/tensor_source/tensor_src_iio.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/gst/nnstreamer/tensor_source/tensor_src_iio.c b/gst/nnstreamer/tensor_source/tensor_src_iio.c index e659b7e..0b495a7 100644 --- a/gst/nnstreamer/tensor_source/tensor_src_iio.c +++ b/gst/nnstreamer/tensor_source/tensor_src_iio.c @@ -1057,7 +1057,7 @@ gst_tensor_src_iio_stop (GstBaseSrc * src) static gboolean gst_tensor_src_iio_event (GstBaseSrc * src, GstEvent * event) { - //FIXME: fill this function + /* No events to be handled yet */ return GST_BASE_SRC_CLASS (parent_class)->event (src, event); } @@ -1067,8 +1067,26 @@ gst_tensor_src_iio_event (GstBaseSrc * src, GstEvent * event) static gboolean gst_tensor_src_iio_query (GstBaseSrc * src, GstQuery * query) { - //FIXME: fill this function - return GST_BASE_SRC_CLASS (parent_class)->query (src, query); + gboolean res = FALSE; + + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_SCHEDULING: + { + /* Only support sequential data access */ + gst_query_set_scheduling (query, GST_SCHEDULING_FLAG_SEQUENTIAL, 1, -1, + 0); + /* Only support push mode for now */ + gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH); + + res = TRUE; + break; + } + default: + res = GST_BASE_SRC_CLASS (parent_class)->query (src, query); + break; + } + + return res; } /** -- 2.7.4