[gstreamer-bugs] [Bug 600004] underrun signal emits when i tested queue overrun test case from file /gstreamerXXXX/tests/check/element/queue.c

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Nov 10 06:18:00 PST 2009


https://bugzilla.gnome.org/show_bug.cgi?id=600004
  GStreamer | gstreamer (core) | 0.10.24

puneet <puneet_aroraa> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |0.10.24
         OS/Version|other                       |Linux
           Severity|major                       |critical

--- Comment #4 from puneet <puneet_aroraa at rediffmail.com> 2009-11-10 14:17:53 UTC ---
hi ,

i tried to debug and do some experiment, did some changes and with this test
cases are passing . want to know ur comments on the same :

static void
queue_underrun (GstElement * queue, gpointer user_data)
{
  GST_DEBUG ("queue underrun");
  g_mutex_lock (check_mutex);
  underrun_count++;
  g_cond_signal (check_cond);
  g_mutex_unlock (check_mutex);
  //change 1 added sleep so that this thread suspends for 2 sec
  sleep(2);
}


/* set queue size to 2 buffers
 * push 2 buffers
 * check over/underuns
 * push 1 more buffer
 * check over/underuns again
 */
GST_START_TEST (test_non_leaky_overrun)
{
  GstElement *queue;
  GstBuffer *buffer1, *buffer2, *buffer3;

  queue = setup_queue ();
  mysrcpad = gst_check_setup_src_pad (queue, &srctemplate, NULL);
  mysinkpad = gst_check_setup_sink_pad (queue, &sinktemplate, NULL);
  gst_pad_set_active (mysrcpad, TRUE);
  g_object_set (G_OBJECT (queue), "max-size-buffers", 2, NULL);

  GST_DEBUG ("starting");

  //fail_unless (gst_element_set_state (queue,
  //        GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
  //    "could not set to playing");
//change 2 : making this thread to wait for cond signal
    g_mutex_lock (check_mutex);
    fail_unless (gst_element_set_state (queue,
            GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
        "could not set to playing");
    TEST_ASSERT_FAIL
    g_cond_wait (check_cond, check_mutex);
    g_mutex_unlock (check_mutex);
    //change 3 : making undercount value zero
    underrun_count = 0;


  buffer1 = gst_buffer_new_and_alloc (4);
  ASSERT_BUFFER_REFCOUNT (buffer1, "buffer", 1);
  /* pushing gives away my reference ... */
  gst_pad_push (mysrcpad, buffer1);

  GST_DEBUG ("added 1st");
  fail_unless (overrun_count == 0);
  fail_unless (underrun_count == 0);

  buffer2 = gst_buffer_new_and_alloc (4);
  ASSERT_BUFFER_REFCOUNT (buffer2, "buffer", 1);
  /* pushing gives away my reference ... */
  gst_pad_push (mysrcpad, buffer2);

  GST_DEBUG ("added 2nd");
  fail_unless (overrun_count == 0);
  fail_unless (underrun_count == 0);

  buffer3 = gst_buffer_new_and_alloc (4);
  ASSERT_BUFFER_REFCOUNT (buffer3, "buffer", 1);
  /* pushing gives away my reference ... */
  gst_pad_push (mysrcpad, buffer3);

  GST_DEBUG ("stopping");

  fail_unless (overrun_count == 1);
  fail_unless (underrun_count == 0);

  /* cleanup */
  gst_pad_set_active (mysrcpad, FALSE);
  gst_check_teardown_src_pad (queue);
  gst_check_teardown_sink_pad (queue);
  cleanup_queue (queue);
}

GST_END_TEST;

added the changes in comments with change : 1/2/3 
is this approach cprrect or am i doing anything wrong ?

still one open question why the underrun callback is getting called in this
test case ?

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list