コード例 #1
0
ファイル: deinterlace.c プロジェクト: ted-n/gst-plugins-good
/*
 * Sets the caps on deinterlace sinkpad and validates the
 * caps that is set on the srcpad
 */
static void
deinterlace_set_caps_and_check (GstCaps * input, gboolean must_deinterlace)
{
  GstCaps *othercaps = NULL;

  fail_unless (gst_pad_set_caps (sinkpad, input));
  g_object_get (srcpad, "caps", &othercaps, NULL);

  if (must_deinterlace) {
    fail_if (gst_caps_is_interlaced (othercaps));
  } else {
    GstStructure *s;

    fail_unless (gst_caps_is_interlaced (input) ==
        gst_caps_is_interlaced (othercaps));

    othercaps = gst_caps_make_writable (othercaps);
    s = gst_caps_get_structure (othercaps, 0);
    gst_structure_remove_field (s, "interlace-mode");

    input = gst_caps_make_writable (input);
    s = gst_caps_get_structure (input, 0);
    gst_structure_remove_field (s, "interlace-mode");

    fail_unless (gst_caps_is_equal (input, othercaps));
  }
  gst_caps_unref (input);
  gst_caps_unref (othercaps);
}
コード例 #2
0
/*
 * Sets the caps on deinterlace sinkpad and validates the
 * caps that is set on the srcpad
 */
static void
deinterlace_set_caps_and_check (GstCaps * input, gboolean must_deinterlace)
{
  GstCaps *othercaps = NULL;
  GstSegment segment;

  gst_pad_send_event (sinkpad, gst_event_new_stream_start ("test"));
  fail_unless (gst_pad_set_caps (sinkpad, input));
  gst_segment_init (&segment, GST_FORMAT_TIME);
  gst_pad_send_event (sinkpad, gst_event_new_segment (&segment));

  g_object_get (srcpad, "caps", &othercaps, NULL);

  if (must_deinterlace) {
    fail_if (gst_caps_is_interlaced (othercaps));
  } else {
    GstStructure *s;

    fail_unless (gst_caps_is_interlaced (input) ==
        gst_caps_is_interlaced (othercaps));

    othercaps = gst_caps_make_writable (othercaps);
    s = gst_caps_get_structure (othercaps, 0);
    gst_structure_remove_field (s, "interlace-mode");

    input = gst_caps_make_writable (input);
    s = gst_caps_get_structure (input, 0);
    gst_structure_remove_field (s, "interlace-mode");

    fail_unless (gst_caps_is_equal (input, othercaps));
  }
  gst_caps_unref (input);
  gst_caps_unref (othercaps);
}