gst-plugins-base: tests: video: Add a test for checking rgb caps creation

Thiago Sousa Santos thiagoss at kemper.freedesktop.org
Wed Mar 23 08:32:12 PDT 2011


Module: gst-plugins-base
Branch: master
Commit: 2ab592bac9054859172e4aa7336997b306fa4ba8
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=2ab592bac9054859172e4aa7336997b306fa4ba8

Author: Thiago Santos <thiago.sousa.santos at collabora.co.uk>
Date:   Wed Mar 23 11:13:57 2011 -0300

tests: video: Add a test for checking rgb caps creation

This new test for checking rgb caps creation exposes a regression

---

 tests/check/libs/video.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/tests/check/libs/video.c b/tests/check/libs/video.c
index eedab1c..d0115e3 100644
--- a/tests/check/libs/video.c
+++ b/tests/check/libs/video.c
@@ -491,6 +491,46 @@ GST_START_TEST (test_video_formats)
 
 GST_END_TEST;
 
+GST_START_TEST (test_video_formats_rgb)
+{
+  gint width, height, framerate_n, framerate_d, par_n, par_d;
+  GstCaps *caps =
+      gst_video_format_new_caps (GST_VIDEO_FORMAT_RGB, 800, 600, 0, 1, 1, 1);
+  GstStructure *structure;
+
+  structure = gst_caps_get_structure (caps, 0);
+
+  fail_unless (gst_structure_get_int (structure, "width", &width));
+  fail_unless (gst_structure_get_int (structure, "height", &height));
+  fail_unless (gst_structure_get_fraction (structure, "framerate", &framerate_n,
+          &framerate_d));
+  fail_unless (gst_structure_get_fraction (structure, "pixel-aspect-ratio",
+          &par_n, &par_d));
+
+  fail_unless (width == 800);
+  fail_unless (height == 600);
+  fail_unless (framerate_n == 0);
+  fail_unless (framerate_d == 1);
+  fail_unless (par_n == 1);
+  fail_unless (par_d == 1);
+
+  gst_caps_unref (caps);
+}
+
+GST_END_TEST;
+
+GST_START_TEST (test_video_template_caps)
+{
+/*
+  GstCaps *caps =
+      gst_video_format_new_template_caps (GST_VIDEO_FORMAT_RGB);
+  gst_caps_unref (caps);
+*/
+}
+
+GST_END_TEST;
+
+
 GST_START_TEST (test_dar_calc)
 {
   guint display_ratio_n, display_ratio_d;
@@ -734,6 +774,8 @@ video_suite (void)
 
   suite_add_tcase (s, tc_chain);
   tcase_add_test (tc_chain, test_video_formats);
+  tcase_add_test (tc_chain, test_video_formats_rgb);
+  tcase_add_test (tc_chain, test_video_template_caps);
   tcase_add_test (tc_chain, test_dar_calc);
   tcase_add_test (tc_chain, test_parse_caps_rgb);
   tcase_add_test (tc_chain, test_events);



More information about the gstreamer-commits mailing list