Exemplo n.º 1
0
/* Create output-selector with given number of src pads and switch
   given number of input buffers to each src pad.
 */
static void
run_output_selector_buffer_count (gint num_output_pads,
    gint num_buffers_per_output)
{
  /* setup input_pad ! selector ! output_pads */
  gint i = 0;
  GList *output_pads = NULL, *input_pads = NULL;
  GstElement *sel = gst_check_setup_element ("output-selector");
  GstPad *input_pad = gst_check_setup_src_pad (sel, &srctemplate);

  input_pads = g_list_append (input_pads, input_pad);
  gst_pad_set_active (input_pad, TRUE);
  for (i = 0; i < num_output_pads; i++) {
    output_pads = g_list_append (output_pads, setup_output_pad (sel, NULL));
  }

  /* run the test */
  fail_unless (gst_element_set_state (sel,
          GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
      "could not set to playing");
  push_newsegment_events (input_pads);
  push_switched_buffers (input_pads, sel, output_pads, num_buffers_per_output);
  count_output_buffers (output_pads, num_buffers_per_output);
  fail_unless (gst_element_set_state (sel,
          GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null");

  /* cleanup input_pad, selector and output_pads */
  gst_pad_set_active (input_pad, FALSE);
  gst_check_teardown_src_pad (sel);
  g_list_foreach (output_pads, (GFunc) cleanup_pad, sel);
  g_list_free (output_pads);
  g_list_free (input_pads);
  gst_check_teardown_element (sel);
}
Exemplo n.º 2
0
static void
cleanup_filesink (GstElement * filesink)
{
  gst_pad_set_active (mysrcpad, FALSE);
  gst_check_teardown_src_pad (filesink);
  gst_check_teardown_element (filesink);
}
Exemplo n.º 3
0
static void
cleanup_gnomevfssink (GstElement * gnomevfssink)
{
  gst_pad_set_active (mysrcpad, FALSE);
  gst_check_teardown_src_pad (gnomevfssink);
  gst_check_teardown_element (gnomevfssink);
}
Exemplo n.º 4
0
static void
cleanup (void)
{
  GST_DEBUG ("cleanup_queue");

  gst_check_drop_buffers ();

  drop_events ();

  g_cond_free (underrun_cond);
  underrun_cond = NULL;
  g_mutex_free (underrun_mutex);
  underrun_mutex = NULL;

  if (mysinkpad != NULL) {
    gst_pad_set_active (mysinkpad, FALSE);
    gst_check_teardown_sink_pad (queue);
  }

  gst_pad_set_active (mysrcpad, FALSE);
  gst_check_teardown_src_pad (queue);

  gst_check_teardown_element (queue);
  queue = NULL;
}
Exemplo n.º 5
0
static void
cleanup_multifdsink (GstElement * multifdsink)
{
  GST_DEBUG ("cleanup_multifdsink");

  gst_check_teardown_src_pad (multifdsink);
  gst_check_teardown_element (multifdsink);
}
Exemplo n.º 6
0
static void
cleanup_appsink (GstElement * appsink)
{
  GST_DEBUG ("cleanup_appsink");

  gst_check_teardown_src_pad (appsink);
  gst_check_teardown_element (appsink);
}
Exemplo n.º 7
0
static void
cleanup_curlfilesink (GstElement * sink)
{
  GST_DEBUG ("cleanup_curlfilesink");

  gst_check_teardown_src_pad (sink);
  gst_check_teardown_element (sink);
}
static void
cleanup_avisubtitle (GstElement * avisubtitle)
{
  gst_pad_set_active (mysinkpad, FALSE);
  gst_pad_set_active (mysrcpad, FALSE);
  gst_check_teardown_sink_pad (avisubtitle);
  gst_check_teardown_src_pad (avisubtitle);
  gst_check_teardown_element (avisubtitle);
}
static void
cleanup_filter (GstElement * filter)
{
  GST_DEBUG ("cleanup_element");

  gst_check_teardown_src_pad (filter);
  gst_check_teardown_sink_pad (filter);
  gst_check_teardown_element (filter);
}
Exemplo n.º 10
0
static void
cleanup_glimagesink (void)
{
  gst_element_set_state (sinkelement, GST_STATE_NULL);
  gst_element_get_state (sinkelement, NULL, NULL, GST_CLOCK_TIME_NONE);
  gst_pad_set_active (srcpad, FALSE);
  gst_check_teardown_src_pad (sinkelement);
  gst_check_teardown_element (sinkelement);
}
Exemplo n.º 11
0
static void
cleanup_audiodecodertest (void)
{
  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (dec);
  gst_check_teardown_sink_pad (dec);
  gst_check_teardown_element (dec);
}
Exemplo n.º 12
0
static void
cleanup_capssetter (GstElement * capssetter)
{
  GST_DEBUG ("cleanup_capssetter");

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (capssetter);
  gst_check_teardown_sink_pad (capssetter);
  gst_check_teardown_element (capssetter);
}
Exemplo n.º 13
0
static void
teardown_output_selector (void)
{
  gst_pad_set_active (input_pad, FALSE);
  gst_object_unref (input_pad);
  gst_check_teardown_src_pad (sel);
  g_list_foreach (output_pads, (GFunc) cleanup_pad, sel);
  g_list_free (output_pads);
  gst_check_teardown_element (sel);
  output_pads = NULL;
}
Exemplo n.º 14
0
static void
cleanup_identity (GstElement * identity)
{
  GST_DEBUG ("cleanup_identity");

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (identity);
  gst_check_teardown_sink_pad (identity);
  gst_check_teardown_element (identity);
}
Exemplo n.º 15
0
void
cleanup_level (GstElement * level)
{
  GST_DEBUG ("cleanup_level");

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (level);
  gst_check_teardown_sink_pad (level);
  gst_check_teardown_element (level);
}
Exemplo n.º 16
0
static void
cleanup_opusdec (GstElement * opusdec)
{
  GST_DEBUG ("cleanup_opusdec");
  gst_element_set_state (opusdec, GST_STATE_NULL);

  gst_pad_set_active (mydecsrcpad, FALSE);
  gst_pad_set_active (mydecsinkpad, FALSE);
  gst_check_teardown_src_pad (opusdec);
  gst_check_teardown_sink_pad (opusdec);
  gst_check_teardown_element (opusdec);
}
Exemplo n.º 17
0
static void
cleanup_mpg123audiodec (GstElement * mpg123audiodec)
{
  GST_DEBUG ("cleanup_mpeg1layer2dec");
  gst_element_set_state (mpg123audiodec, GST_STATE_NULL);

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (mpg123audiodec);
  gst_check_teardown_sink_pad (mpg123audiodec);
  gst_check_teardown_element (mpg123audiodec);
}
static void
cleanup_videodecodertest (void)
{
  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (dec);
  gst_check_teardown_sink_pad (dec);
  gst_check_teardown_element (dec);

  g_list_free_full (events, (GDestroyNotify) gst_event_unref);
  events = NULL;
}
Exemplo n.º 19
0
static void
cleanup_wavpackdec (GstElement * wavpackdec)
{
  GST_DEBUG ("cleanup_wavpackdec");
  gst_element_set_state (wavpackdec, GST_STATE_NULL);

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (wavpackdec);
  gst_check_teardown_sink_pad (wavpackdec);
  gst_check_teardown_element (wavpackdec);
}
Exemplo n.º 20
0
static void
cleanup_vorbistag (GstElement * vorbistag)
{
  GST_DEBUG ("cleanup_vorbistag");
  gst_element_set_state (vorbistag, GST_STATE_NULL);

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (vorbistag);
  gst_check_teardown_sink_pad (vorbistag);
  gst_check_teardown_element (vorbistag);
}
Exemplo n.º 21
0
static void
cleanup_x264enc (GstElement * x264enc)
{
  GST_DEBUG ("cleanup_x264enc");
  gst_element_set_state (x264enc, GST_STATE_NULL);

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (x264enc);
  gst_check_teardown_sink_pad (x264enc);
  gst_check_teardown_element (x264enc);
}
Exemplo n.º 22
0
static void
cleanup_rglimiter (GstElement * element)
{
  GST_DEBUG ("cleanup_rglimiter");

  g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
  g_list_free (buffers);
  buffers = NULL;

  gst_check_teardown_src_pad (element);
  gst_check_teardown_sink_pad (element);
  gst_check_teardown_element (element);
}
Exemplo n.º 23
0
static void
cleanup_audioresample (GstElement * audioresample)
{
  GST_DEBUG ("cleanup_audioresample");

  fail_unless (gst_element_set_state (audioresample,
          GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to NULL");

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (audioresample);
  gst_check_teardown_sink_pad (audioresample);
  gst_check_teardown_element (audioresample);
}
Exemplo n.º 24
0
void test_large_discont()
{
  GstElement *audiorate;
  GstCaps *caps;
  GstPad *srcpad, *sinkpad;
  GstBuffer *buf;

  //xmlfile = "test_large_discont";
      std_log(LOG_FILENAME_LINE, "Test Started test_large_discont");
      
  audiorate = gst_check_setup_element ("audiorate");
  caps = gst_caps_new_simple ("audio/x-raw-float",
      "channels", G_TYPE_INT, 1,
      "rate", G_TYPE_INT, 44100, "width", G_TYPE_INT, 32, NULL);

  srcpad = gst_check_setup_src_pad (audiorate, &srctemplate, caps);
  sinkpad = gst_check_setup_sink_pad (audiorate, &sinktemplate, caps);

  gst_pad_set_active (srcpad, TRUE);
  gst_pad_set_active (sinkpad, TRUE);

  fail_unless (gst_element_set_state (audiorate,
          GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
      "failed to set audiorate playing");

  buf = gst_buffer_new_and_alloc (4);
  gst_buffer_set_caps (buf, caps);
  GST_BUFFER_TIMESTAMP (buf) = 0;
  gst_pad_push (srcpad, buf);

  fail_unless_equals_int (g_list_length (buffers), 1);

  buf = gst_buffer_new_and_alloc (4);
  gst_buffer_set_caps (buf, caps);
  GST_BUFFER_TIMESTAMP (buf) = 2 * GST_SECOND;
  gst_pad_push (srcpad, buf);
  /* Now we should have 3 more buffers: the one we injected, plus _two_ filler
   * buffers, because the gap is > 1 second (but less than 2 seconds) */
  fail_unless_equals_int (g_list_length (buffers), 4);

  gst_element_set_state (audiorate, GST_STATE_NULL);
  gst_caps_unref (caps);

  gst_check_teardown_sink_pad (audiorate);
  gst_check_teardown_src_pad (audiorate);

  gst_object_unref (audiorate);
  std_log(LOG_FILENAME_LINE, "Test Successful");
      create_xml(0);
}
static void
mulawdec_teardown (void)
{
  /* free decoded buffers */
  g_list_foreach (buffers, buffer_unref, NULL);
  g_list_free (buffers);
  buffers = NULL;

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (mulawdec);
  gst_check_teardown_sink_pad (mulawdec);
  gst_check_teardown_element (mulawdec);
  mulawdec = NULL;
}
Exemplo n.º 26
0
static void
cleanup_audioencodertest (void)
{
  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);

  gst_element_set_state (enc, GST_STATE_NULL);

  gst_check_teardown_src_pad (enc);
  gst_check_teardown_sink_pad (enc);
  gst_check_teardown_element (enc);

  g_list_free_full (events, (GDestroyNotify) gst_event_unref);
  events = NULL;
}
Exemplo n.º 27
0
void
cleanup_audiowsincband (GstElement * audiowsincband)
{
  GST_DEBUG ("cleanup_audiowsincband");

  g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
  g_list_free (buffers);
  buffers = NULL;

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (audiowsincband);
  gst_check_teardown_sink_pad (audiowsincband);
  gst_check_teardown_element (audiowsincband);
}
Exemplo n.º 28
0
static void
cleanup_echo (GstElement * echo)
{
  GST_DEBUG ("cleanup_echo");

  g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
  g_list_free (buffers);
  buffers = NULL;

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (echo);
  gst_check_teardown_sink_pad (echo);
  gst_check_teardown_element (echo);
}
Exemplo n.º 29
0
static void
cleanup_mpeg2enc (GstElement * mpeg2enc)
{
  GST_DEBUG ("cleanup_mpeg2enc");
  gst_element_set_state (mpeg2enc, GST_STATE_NULL);

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (mpeg2enc);
  gst_check_teardown_sink_pad (mpeg2enc);
  gst_check_teardown_element (mpeg2enc);

  g_mutex_clear (&mpeg2enc_mutex);
  g_cond_clear (&mpeg2enc_cond);
}
Exemplo n.º 30
0
void
cleanup_spectrum (GstElement * spectrum)
{
  GST_DEBUG ("cleanup_spectrum");

  gst_pad_set_active (mysrcpad, FALSE);
  gst_pad_set_active (mysinkpad, FALSE);
  gst_check_teardown_src_pad (spectrum);
  gst_check_teardown_sink_pad (spectrum);
  gst_check_teardown_element (spectrum);

  g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
  g_list_free (buffers);
  buffers = NULL;
}