GstBuffer *buffer;
gulong probe_id;
guint64 current_level;
+ GstFlowReturn ret;
/* Test if the bytes limit works correctly with both leaky types */
h = gst_harness_new ("appsrc");
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 0 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* wait until the appsrc is blocked downstream */
while (!gst_pad_is_blocking (srcpad))
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 1 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 2 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The first buffer is not queued anymore but inside the pad probe */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 4 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The new buffer was dropped now, otherwise we would have 2 seconds queued */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 4 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The oldest buffer was dropped now, otherwise we would have only 1 second queued */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 0 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* wait until the appsrc is blocked downstream */
while (!gst_pad_is_blocking (srcpad))
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 1 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 2 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The first buffer is not queued anymore but inside the pad probe */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 4 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The new buffer was dropped now, otherwise we would have 2 seconds queued */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 4 * GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The oldest buffer was dropped now, otherwise we would have only 1 second queued */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 0 * GST_SECOND;
GST_BUFFER_DURATION (buffer) = GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* wait until the appsrc is blocked downstream */
while (!gst_pad_is_blocking (srcpad))
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 1 * GST_SECOND;
GST_BUFFER_DURATION (buffer) = GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 2 * GST_SECOND;
GST_BUFFER_DURATION (buffer) = GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The first buffer is not queued anymore but inside the pad probe */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 4 * GST_SECOND;
GST_BUFFER_DURATION (buffer) = GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The new buffer was dropped now, otherwise we would have more than 2 seconds queued */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);
buffer = gst_buffer_new_and_alloc (100);
GST_BUFFER_PTS (buffer) = 4 * GST_SECOND;
GST_BUFFER_DURATION (buffer) = GST_SECOND;
- gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ ret = gst_app_src_push_buffer (GST_APP_SRC (h->element), buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
/* The oldest buffer was dropped now, otherwise we would have only 1 second queued */
g_object_get (h->element, "current-level-bytes", ¤t_level, NULL);